ASP Error 0223 - TypeLib Not Found, intermittent, resolved after IIS restart - iis

I'm currently in the process of migrating an ASP platform from Windows 2003 R2 IIS 6 web servers to Windows 2012 R2 IIS 8.5 web servers. I'm at the stage where I've migrated a number of sites across to two separate 2012 web servers, all looked great, clients and developers are happy... However the following error has presented itself after a few days hosting on one of the new servers.
Active Server Pages error 'ASP 0223'
TypeLib Not Found
/jobboard/conf/constants.vbs.inc, line 1
METADATA tag contains a Type Library specification that does not match any Registry entry.
The METADATA tag is below:
<!--METADATA TYPE="typelib" NAME="Microsoft ActiveX Data Objects 2.8 Library" UUID="{2A75196C-D9EB-4129-B803-931327F72D5C}" VERSION="2.8"-->
Restarting IIS on this server resolved the issue (albeit temporarily).
Subsequently the other 2012 web server in production presented the same error a couple of days later, again, restarted IIS and works for now.
I've checked the registry and the relevant tag exists with the right UUID and correct permissions.
It doesn't affect all sites on the server, only all sites in a particular application pool.
The application pools use a domain user identity and sites are split up into a number of shared pools.

I've now determined what was causing the above problem...
Our sites on IIS run in a number of shared application pools running as a domain user. We also have a Windows scheduler job which runs a number of scripts over night which also run as the same domain user.
It seems there are cases when this scheduler job runs it interferes with the IIS worker processes. When it completes and ends its user session it unloads the registry file in memory, which the w3wp.exe processes could also using.
This error is presented in the Event log...
Windows detected your registry file is still in use by other
applications or services. The file will be unloaded now. The
applications or services that hold your registry file may not function
properly afterwards. No user action is required.
Along with references to the w3wp.exe processes currently running.
It was replicated when I terminal serviced in as the domain user and logged out again after a period of time. The event log presented the error and the sites all bombed shortly afterwards.
Running the scheduled job as a different user has fixed this issue for us.

I remember having an include file for ADOVBS.inc with all the ADO constants inside and including it as a standard ASP include inside my global include file which is included on every page on the site.
This was before I used the META way of including the file.
So maybe a last resort is to revert to that method of loading in the ADO constants.
It seems like some sort of threshold is being hit, CPU/Memory?, which then prevents IIS caching/loading the file in from the registry. This then causes the error and a recycle of the pool. As no redirect is being done to the 500.100.asp error handler page which hides the error details from the user. It would suggest the error is in IIS and related to the server.
Thanks

Related

Why is w3wp.exe looking through my dotnetcore api path to find web.config?

Using IIS 7 with a deployed dotnetcore 2.1 or 3.1 web API alone in an application pool, we discovered while looking at Process Monitor on the server, the w3wp.exe workers were logging many errors where they were apparently looking for a web.config. They checked every route in the api's route. The expected behavior was that the w3wp.exe (an IIS worker) would "hand off" the request to the dotnetcore application's routing, which would find the endpoint, but instead, it appeared to be also checking for a web.config. The process monitor revealed w3wp.exe QueryOpen NAME NOT FOUND and PATH NOT FOUND errors.
I looked at a few articles and concluded it was a problem with web.config inheritance, and there must be some setting in IIS or a dotnetcore configuration that was dictating the behavior of checking each API route path as if it were a virtual directory folder system that might contain a new web.config. The benefit would be that you could have a different web.config in a sub-application, but we didn't want that benefit and we didn't want these IIS workers blowing up the logs with thousands of these errors throughout the day. We found an insanely simple solution that an IIS admin might say "duh" but will hopefully save someone out there some time.
We found the answer on an old blog.iis.net post about web.config inheritance (https://blogs.iis.net/steveschofield/control-web-config-inheritance-with-iis-7-asp-net-options). There is a configuration called allowsubdirconfig that directs the w3wp.exe worker to check subdirectories for a web.config file. Here's how you change it in IIS applicationhost.config that can be found through IIS Manager:
Go to configuration editor
Go to system.applicationHost => sites => virtual directory defaults
Set allowSubDirConfig to False
We also discovered that Microsoft recommends you use this setting for hosting dotnetcore applications on IIS
Skipping the additional file operations can significantly improve
performance of websites that have a very large set of randomly
accessed static content.
https://learn.microsoft.com/en-us/previous-versions//dn529134(v=vs.85)?redirectedfrom=MSDN
Keep in mind, if you use this setting, you'll need to come up with a solution to separate applications that use or don't use the setting.
Related issue with MVC:
ASP.NET MVC security and IIS allowSubDirConfig configuration

IIS Error - It is not possible to run two different versions of ASP.NET

I'm getting this error thrown repeatedly on my IIS 6.0 server:
It is not possible to run two different versions of ASP.NET in the
same IIS process. Please use the IIS Administration Tool to
reconfigure your server to run the application in a separate process.
However, I ran an IIS MetaBase Analyzer to view all AppPools and AspNetVersions they're running and do not see any AppPools running different versions of AspNet. Is this a bug in IIS or is there definitely an AppPool running multiple versions of AspNet?
Thanks
Although it's an old question, for the benefit of future users who visit this yet unanswered question, here is the solution that worked for me.
In my case, the following worked.
Symptom :
The ASP.NET tab, for the "Default Website" node of the IIS Admin was showing a version of 1.1.
The ASP.NET tab, for my virtual directory application, was showing a version of 2.0 (which is the right one for my application).
Solution :
I changed the first one from 1.1 to 2.0. The application worked.
Cause :
The cause, however, seems "mysteriously unrelated", as it often happens in Windows. It was working fine with the same old (different) settings until a week back. What happened during the week, was that the machine A running the web server for my web application, had to unjoin a domain B and join another domain C, because the primary domain controller on B failed and had to be replaced with C. Why on earth would that affect IIS Admin or the web application hosted on A, and why it should generate this particular error is beyond me. Such a cause for this error seems undocumented.
It is not possible to run two different versions of ASP.NET in the same IIS process. This would mean you have multiple applications (either sites or virtual directories) using the same appPool, but one of these sites/applications has a different .NET version setting in the .NET tab. You would have to create another appPool to use different .NET versions.
To create another appPool and associate it to your application do (Windows Server 2003):
1.Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
2.In Internet Information Services (IIS) Manager, expand , right-click Application Pools, point to New, and then click Application Pool
3.Right-click on application that uses a different .NET version and click on Properties
4.On menu Virtual Directory choose in the item Application Pool the application pool that you created in point 2.
Regards!

Application pools won't run

I have two servers sitting behind a loadbalancer in my service tier. Both of them should be identical - IIS setup the same, AppFabric (to keep two services warmed up), app pools running under either a service account or the app pool identity. On one server, everything works. On the other server, three of my app pools (the two that AppFabric is warming up, under the service accounts, and one that's just a standard app pool with no changes made from default settings) stop running almost as soon as I start them up (sometimes on the first request).
I get five of the following error in the Application log each time I try to start one of the app pools:
There was an error during processing of the managed application service auto-start for configuration path: 'MACHINE/WEBROOT/APPHOST/Site/App'. The error message returned is: ''. The worker process will be marked unhealthy and be shutdown. The data field contains the error code.
The error code referenced is 80070005.
This is actually for the same Site/App regardless of the app pool being started (though it may change after recreating the app pools).
In the System log, I get the following warning five times before it errors (Application pool 'AppPool' is being automatically disabled due to a series of failures in the process(es) serving that application pool.):
A process serving application pool 'AppPool' reported a failure during application preloading or service loading. The process id was '2396'. Please ensure that all application preload or service settings in the application pool are configured properly. The data field contains the error number.
The error code referenced is 80004005.
The AppPool here is the one being started.
I've tried recreating; I've tried uninstalling AppFabric (but we need it, so reinstalled and still no go). I'm out of ideas. Any suggestions?
EDIT: I tried copying the applicationHost.config over from the working server, but that didn't work either..
EDIT2: One of the app pools works when running under a real user account but doesn't when running under the ApplicationPoolIdentity....
(Also, we had an issue where the site was running under 2.0 and the apps were running under 4.0. That may have resolved the ones that are running as the service accounts.)
I was just wrestling with this same problem for a few hours and found a different culprit.
I had added a new configuration section to my Web.config in a recent commit. I also added this section to a separate ERB file used by Puppet to generate a custom Web.config at the point of deployment. In this template file, I added the new section but forgot to include its declaration in <configSections>.
Once I added the declaration to the template, our app's test VMs were able to start up again and this error went away.
While the app pools for the applications were 4.0, the app pool for the site itself was 2.0, causing some of the issues. We also had inetpub on a different drive, and we had to grant access to SERVER\Users.

Clustered Web Servers Failing

I have three web servers running Windows Server 2008. Two are clustered, the third a standalone server (two live, one test). They use shared configuration with the configuration file located on a central file server. Every so often one live web server will stop responding. The event log shows the following error.
The worker process for application pool 'My Website' encountered an error 'Configuration file is not well-formed XML
' trying to read configuration data from file '\\?\C:\inetpub\temp\apppools\My Website\My Website.config', line number '3'. The data field contains the error code.
The config file has the following data
<!-- ERROR: There's been an error reading or processing the applicationhost.config file. Line number: 0 Error message: Cannot read configuration file
-->
There is nothing in the event viewer on the file server.
When I restart the web server everything works fine.
Any ideas?
Edit
I have around 30 websites. 10 are true standalone websites running in their own application pools. The other 20 are old websites that just redirect all requests to a different URL (some on my server, some external), these share the same application pool.
One of the 10 "standalone" websites is running php. One is .NET 2.0. One is classic asp with two virtual directories set up to run as a .NET 2.0 applications. The other 7 are running classic asp only.
It's quite old but I came here because I had this issue today and it seems to be still around. The reason is usually the DFSR feature, which is especially valid if one runs a cluster. There are three possible solutions.
Change a registry key to reduce the speed of synchronization and avoid the file lock the leads to the error as described here: https://blogs.msdn.microsoft.com/asiatech/2013/12/01/you-may-experience-configuration-file-is-not-well-formed-xml-error-while-using-dfsr-to-synchronize-the-iis-configuration-files/
Install a Hotfix provided by Microsoft. The direct link is https://support.microsoft.com/de-de/hotfix/kbhotfix?kbnum=960412&kbln=en-US
Configure your DFSR environment properly and exclude the folder *\inetpub\temp\apppools* explicitly (after DFSR replicated the applicationHost.config the WAS will rebuild the files anyway)
Despite the Hotfix I personally like the third option most.
The purpose of this late answer is documentation, as others may come here and the page seems well ranked on Google.
This is a long shot but...
If the file is accessed through netbios and its regularly accessed you may be hitting the fileserver too hard and windows thinks you are trying to do a DOS attack so it starts rejecting requests. This may also be caused by a firewall interpreting this very samething when accessing the file server.
Also, from this, check you that the temp folder for the iis user is full, the problem may not only be the file server, but failure to temporary store the config file.
Can you share some volume information of your server layout? (# application pools / # websites , etc)
Edit:
I assume you're not interested in workarounds to this, especially if it means changing the location of the file :)

SharePoint Solution Deployment: How do I prevent SP from resetting IIS when upgrading or retracting a globally deployed solutions?

So I figured out that by adding the ResetWebServer="FALSE" attribute to the solution manifest prevents SharePoint from recycling any app pools.
However, when upgrading a solution that originally did not specify ResetWebServer="FALSE" or when retracting a solution that does specify ResetWebServer="FALSE", the application pools are still being recycled. Is there a way to prevent any auto-recycling of app pools?
This does not seem possible given the document on MSDN (see below), note that I included Deploying a Solution over Upgrading a solution as underneath it is effectively doing a file replacement. I believe the restart/recycling is necessary as a result of how IIS functions. An option to explore if you wanted to manage when this occurs is to ensure that all deployments are done via timer jobs and execute when their impact will be minimized.
Deploying a solution
Initially, manifest and feature manifests are parsed to find assembly and _layouts files, which are copied to the appropriate locations. All other files contained within a feature directory are copied to the feature directory. After solution files are copied to the target computers, a configuration reset is scheduled for all front-end Web servers; the reset then deploys the files and restarts Microsoft Internet Information Services (IIS).
Retracting a solution
On each front-end Web server, the following occurs:
Microsoft Internet Information Services (IIS) is disabled.
Files are removed from the system.
IIS is re-enabled and Windows SharePoint Services is reloaded when
a user browses to a page.
You might also take a look at the "-local" switch. Didn't try it yet but it seemed that it allowed deployment server per server when you are in a load balanced situation.
Might be a good lead.

Resources