PDA

View Full Version : II6 Invalid Application Pool



anthonyjb
06-02-2005, 06:12 AM
I am using an evaluation of InstallShield 11 and trying to create new web site and application pool. Both are created but the web site reports the application pool is invalid. If i just create an install that creates an application pool, this application pool is then unavailable to select in the drop down within a web site.

Any ideas anyone?

bsabell
07-27-2005, 10:52 PM
Did you manage to solve this problem? I'm having the exact same problem now, and I can't figure it out. Its bizzarre, not to mention frustrating. If you have any relevant info on this problem, please pass it on. Thanks.

cthulhi
07-10-2008, 11:44 PM
I've seen this happen several times...

InstallShield 11.5, 12 and 2008 (Basic MSI) on Windows Server 2003 systems with IIS 6.0



At first I thought it was the use of MSI properties in the IIS Web site name or in the IIS Application Pool... so I stopped doing that.

Recently I've seen this reoccur with some of my installs where I'm not using MSI properties in the names of the sites or application pools. I thought I had it licked... so much for that.


I can't seem to trace down what the trigger is... however once this issue does occur, it causes other sites on the web server to inherit the Invalid Application Pool, and more strangeness, when you attempt to select another application pool from the drop-down menu (re-assign to another existing application pool), the list of available application pools has been greatly reduced, sometimes to NONE!

Only if I uninstall the last installation has does this issue go away... but if this occurs on a client's machine, then you have the pleasure of potentially screwing up a client's existing websites.

This is absolutely unacceptable. :mad:

I've examined the IIS metabase XML and have not been able to hand fix it.

This latest install has 1 web site, 9 virtual directories, 2 application pools and 2 web service extensions... I'm sure you can imagine how intolerably frustrating it is to have an enterprise-sized web application not only not install incorrectly (if it is due to my mistake, nothing in the log files or build are directing me that way) but even more absurd to have an install totally destroy the functionality of completely unrelated websites on the target machine.

I'd be more than happy to provide someone at InstallShield/Macrovision/Acresso with the source projects, logs or anything else they'd need to help identify the cause.

I understand applications have bugs, but this is a bug that has far-reaching consequences... being that this has been around since at least version 11.5, I'm going under the assumption that this is a difficult to identify/track issue.

Not to come off like a complete jackboot, I've been impressed by the developers when they have been able to address issues presented by users.



Update:
Since the issue had cropped up again prompting me to post the above reply, I've uninstalled the offending installation, checked IIS and all my application pools are available (to be expected), so i ran IIS reset, re-installed, ran IIS reset again, opened the inetmgr (iis snap-in) and checked and my application pools are fine now... WTF?...I don't enjoy making these discoveries at 1AM.

Same MSI, Same Box, .... so if something isn't installing correctly it definitely does NOT show up in the MSI log... i'm beginning to suspect the built in DLL InstallShield uses to create the IIS objects (i'm guessing through ADSI ).... I've seen possibly related behavior where during installation, the setup rolls back saying it has been interrupted, but if you re-run the install after running an IIS reset, it installs fine.
After examining the MSI logs, you'll see a message indicating IIS was not ready (i'm guessing the DLL timed out while trying to create a virtual directory) since these servers are massive production web servers and if IIS weren't ready alarms would sound and geeks would come running... it might be related or not.

joshstechnij
07-11-2008, 02:43 PM
The original issue described in this thread was a bug with application pool support in InstallShield 11. If I remember correctly, it was resolved in IS 11 hotfix 3 or 4 (it's been a while).

Regarding the issues you are seeing, can you reproduce them in a sample project or a stripped-down version of your project in IS 2008/2009? Also, can you post a verbose log of one of these installs that encountered a failure/rollback?

cthulhi
07-11-2008, 04:41 PM
Firstly, thank you for the prompt response, it is appreciated.


Steps I took to reproduce:

1. Created a sample project similar to others being used as suggested.
2. Upped the version number built and deployed to a Windows Server 2003 box
3. Repeated step 2 seven more times, just upping the version number to force a major upgrade.
4. Received error (attached the verbose MSI log [passwords/user names altered] and attached image of IIS and the project zipped)

It is a bit string that on the eighth install (seventh upgrade) this popped up... Same project, same install, just upping the version number and rebuilding.


Note:
This time there was an error in the MSI log (1: AddKey failed with the following error: -2147024713) however this install didn't fail.
I've also seen this occur where there is NO error regarding an application pool. Since this one of those things that occurs sometimes and not always in the same way, this doesn't surprise me.
I've seen this particular error occur before (I mentioned in previous post) but it has always cause a rollback to occur.

Any suggestions or ideas you can offer would be appreciated.

joshstechnij
07-14-2008, 03:28 PM
The error -2147024713 indicates that the application pool key already existed in the IIS metabase at the time we tried to add the key (using IMSAdminBase::AddKey (http://msdn.microsoft.com/en-us/library/ms526054.aspx)). Since this isn't necessarily a problem, the installation is allowed to continue (all other return codes except S_OK will fail the install).

After looking through the log, there doesn't seem to be anything out of place compared to a test log I created with a sample project.

Does application pool corruption behavior still occur if you restart the IIS service just prior to installing the seventh upgrade? Also, is one of the application pools consistently left on the machine after a normal uninstall, or does it only seem to be after installing/upgrading multiple times?

cthulhi
08-12-2008, 02:11 PM
I just ran in to this "invalid application pool" error again. After the last post suggested running an IISReset prior to installation and I've also run IISReset post installation.


The IISReset prior to install may have helped minimize the occurrence of this issue but obviously doesn't solve it. :mad:

TheTraveler
08-12-2008, 03:10 PM
Here are functions that I have written and I have found in the forum. I have been creating IIS AppPools for the longest time without any problems. For some more IIS functions that I have written, here is a link (http://community.macrovision.com/showthread.php?t=164734). If you need more information about how to use these functions, let me know.


///////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////
EXTERNAL prototype BOOL ExFnCreateAppPool(BYVAL STRING, // szAppPoolName,
BYVAL STRING, // szUser,
BYVAL STRING, // szPass
);

EXTERNAL prototype BOOL ExFnDeleteAppPool(BYVAL STRING); // szAppPoolName
EXTERNAL prototype BOOL SetVirtualDirProp(BYVAL STRING, // strName
BYVAL STRING, // strVirtualDir
BYVAL STRING // szAppPoolName
);
EXTERNAL prototype BOOL AppPoolExists(BYVAL STRING); //strAppPoolName
EXTERNAL prototype GetAppPoolList(BYREF LIST);

///////////////////////////////////////////////////////////////////////////////
// ExFnCreateAppPool
// Create an Application Pool
///////////////////////////////////////////////////////////////////////////////
function BOOL ExFnCreateAppPool(szAppPoolName, szUser, szPass)
OBJECT objApplicationPools,objNewAppPool ;
STRING szInfo,szWebSiteNumber,szMsg;
BOOL bRet;
NUMBER nTemp;
begin

szMsg = "Create Application Pool '"+szAppPoolName+"' for " + IFX_PRODUCT_NAME + " , Please Wait ...";
SdShowMsg(szMsg,TRUE);
bRet=TRUE;

try
set objApplicationPools = CoGetObject("IIS://localhost/W3SVC/AppPools","");
if (!IsObject(objApplicationPools)) then
bRet=FALSE;
Err.Raise(IIS_ERR_GET_IISAPPPOOLS);
endif;

//check if Application Pool already exists
//MessageBox("Check for Application Pool existence",INFORMATION);
try
set objNewAppPool = objApplicationPools.GetObject("IIsApplicationPool", szAppPoolName);
if (IsObject(objNewAppPool )) then
SdShowMsg(szMsg,FALSE);
//App Pool already exists
//szInfo = "Application Pool '"+szAppPoolName+"' already exists!";
//MessageBox(szInfo,INFORMATION);
set objApplicationPools = NOTHING;
set objNewAppPool = NOTHING;
return TRUE;
endif;
catch
//App Pool doesn't exist
//next line of code is executed which is App Pool creation
endcatch;


//if we are here->the Application Pool doesn't exist
//create Application Pool
//MessageBox("Creating IIsApplicationPool",INFORMATION);
set objNewAppPool = objApplicationPools.Create("IIsApplicationPool", szAppPoolName);
if (!IsObject(objNewAppPool )) then
//set objApplicationPools = NOTHING;
bRet=FALSE;
Err.Raise(IIS_ERR_CREATE_IISAPPPOOL);
endif;

if(szUser!="")then
// Tell IIS to use configurable identity for worker process.
objNewAppPool.AppPoolIdentityType = 3;

// Set the username and password.
objNewAppPool.WAMUserName = szUser;
objNewAppPool.WAMUserPass = szPass;
endif;

// Save the changes to the IIS metabase
objNewAppPool.SetInfo();

set objApplicationPools = NOTHING;
set objNewAppPool = NOTHING;
catch
set objApplicationPools = NOTHING;
set objNewAppPool = NOTHING;

bRet=FALSE;
//set szInfo according to the err type
nTemp = Err.Number;

// Handle the exception based on its cause.
switch (nTemp)
case IIS_ERR_GET_IISAPPPOOLS:
szInfo = "Could not get IIS Application Pools";
case IIS_ERR_CREATE_IISAPPPOOL:
szInfo = "Application Pool '"+szAppPoolName+"' couldn't be created!";
default:
szInfo = "Error while creating Application Pool '"+szAppPoolName+"' for " + IFX_PRODUCT_NAME + " ";
endswitch;

endcatch;

SdShowMsg(szMsg,FALSE);
if (!bRet) then
MessageBox(szInfo, SEVERE);
endif;

return bRet;
end;

///////////////////////////////////////////////////////////////////////////////
// ExFnDeleteAppPool
// Delete Application Pool (used only for Win2003 Server)
// return TRUE when succeed, FALSE when failure
///////////////////////////////////////////////////////////////////////////////
function BOOL ExFnDeleteAppPool(szAppPoolName)
OBJECT objApplicationPools,objDeleteAppPool;
STRING szMsg,szInfo;
BOOL bRet;
NUMBER nTemp;
begin
//if OS isn't Win2003 Server-return TRUE
if(!SYSINFO.WINNT.bWinServer2003)then
MessageBox("Cannot delete Application Pool on operating system\n different than Win 2003 Server!",INFORMATION);
return TRUE;
endif;

szMsg = "Deleting Application Pool '"+szAppPoolName+"' for " + IFX_PRODUCT_NAME + " , Please wait...";
SdShowMsg(szMsg,TRUE);
bRet=TRUE;
try
set objApplicationPools = CoGetObject("IIS://localhost/W3SVC/AppPools","");
if (!IsObject(objApplicationPools)) then
bRet=FALSE;
Err.Raise(IIS_ERR_GET_IISAPPPOOLS);
endif;

set objDeleteAppPool = objApplicationPools.GetObject("IIsApplicationPool", szAppPoolName);
if (!IsObject(objDeleteAppPool )) then
//set objApplicationPools = NOTHING;
bRet=FALSE;
Err.Raise(IIS_ERR_GET_IISAPPPOOL);
endif;

//*****************
// Delete App Pool
//could be one problem->if a web site is set to this app pool and this app pool
//is deleted ->the web site is wrong configured
//but when I delete the app pool I would delete also the web site (first
//web site should be deleted and then the app pool)

//(Delete should be called for objDeleteAppPool or for objApplicationPools ?)
// Stop Web Site
objDeleteAppPool.Stop();
set objDeleteAppPool = NOTHING;

objApplicationPools.Delete("IIsApplicationPool",szAppPoolName);
set objApplicationPools = NOTHING;
catch
bRet=FALSE;
set objApplicationPools = NOTHING;
set objDeleteAppPool = NOTHING;

//set szInfo according to the err type
nTemp = Err.Number;

// Handle the exception based on its cause.
switch (nTemp)
case IIS_ERR_GET_IISAPPPOOLS:
szInfo = "Could not get IIS Application Pools";
case IIS_ERR_GET_IISAPPPOOL:
szInfo = "Couldn't get Application Pool '"+szAppPoolName+"' !";
default:
szInfo = "Error while deleting Application Pool '"+szAppPoolName+"' for " + IFX_PRODUCT_NAME + " ";
endswitch;

endcatch;

SdShowMsg(szMsg,FALSE);
if (!bRet) then
MessageBox(szInfo, SEVERE);
endif;

return bRet;
end;

///////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////
function BOOL AppPoolExists(strAppPoolName)
OBJECT objApplicationPools;
OBJECT objAppPool;
BOOL bResult;
begin
My_AddToLog("");
My_AddToLog("AppPoolExists("+ strAppPoolName +")");
bResult = FALSE;

try
set objApplicationPools = CoGetObject("IIS://localhost/W3SVC/AppPools", "");
if ( IsObject(objApplicationPools) ) then
set objAppPool = CoGetObject("IIS://localhost/W3SVC/AppPools/" + strAppPoolName, "");
if (IsObject(objAppPool )) then
bResult = TRUE;
My_AddToLog("|> Found it...");
else
My_AddToLog("|> Application pool not found...");
endif;
else
My_AddToLog("Doesn't have an Application Pool...");
endif;
catch
bResult = FALSE;
My_AddToLog("|> Exception occured...");
endcatch;

try
objApplicationPools = NOTHING;
catch
endcatch;

try
objAppPool = NOTHING;
catch
endcatch;

return bResult;
end;

///////////////////////////////////////////////////////////////////////////////
// ExFnSetVirtualDirProp //
// Associates the Applicaiton pool to the virtual directory //
///////////////////////////////////////////////////////////////////////////////
function BOOL SetVirtualDirProp(strName, strVirtualDir, szAppPoolName)
OBJECT objIIsVirDir;
STRING svIIsVDirPath, szInfo;
BOOL bRet;
NUMBER nTemp;
begin
Sprintf(svIIsVDirPath, "IIS://localhost/W3SVC/%s/ROOT/%s", strName, strVirtualDir);
try
set objIIsVirDir = CoGetObject(svIIsVDirPath, "");
if (!IsObject(objIIsVirDir)) then
bRet=FALSE;
Err.Raise( IIS_ERR_GET_IISAPPPOOLS );
endif;

objIIsVirDir.AppPoolID = szAppPoolName;
objIIsVirDir.SetInfo();

bRet = TRUE;
set objIIsVirDir = NOTHING;
catch
set objIIsVirDir = NOTHING;
bRet=FALSE;

///////////////////////////////////////////////////////////////////////
// set szInfo according to the err type
///////////////////////////////////////////////////////////////////////
nTemp = Err.Number;

///////////////////////////////////////////////////////////////////////
// Handle the exception based on its cause.
///////////////////////////////////////////////////////////////////////
switch (nTemp)
case IIS_ERR_GET_IISAPPPOOLS:
szInfo = "Could not get IIS Virtualdirectory " + strVirtualDir;
case IIS_ERR_CREATE_IISAPPPOOL:
szInfo = "Application Pool '"+ szAppPoolName +"' couldn't be created!";
default:
szInfo = "Error while creating Application Pool '"+ szAppPoolName +"' for " + IFX_PRODUCT_NAME + " ";
endswitch;
endcatch;
end;

///////////////////////////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////////////////////////
function GetAppPoolList(listAppPools)
OBJECT objApplicationPools;
OBJECT objAppPool;
STRING strError;
STRING strTemp;
VARIANT __varEnumHolder; //Hold IEnumVariant during the ForEachLoop, don't use OBJECT type, this is an IUnknown!!
NUMBER nResult;
STRING strValue;
STRING strDLL;
NUMBER nCount;
NUMBER nIndex;
STRING strPort;
begin
My_AddToLog("");
My_AddToLog( "Get App Pool List..." );
ListDeleteAll( listAppPools );

if !m_bMyForEachLoaded then
My_ForEachDLL_Load("");
endif;

nCount = 0;
if m_bMyForEachLoaded then
strError = "";
try
///////////////////////////////////////////////////////////////////
// Get the ROOT of the application pools... //
///////////////////////////////////////////////////////////////////
set objApplicationPools = CoGetObject("IIS://localhost/W3SVC/AppPools", "");
if IsObject( objApplicationPools ) then
///////////////////////////////////////////////////////////////
// Set Starting point for ForEach... //
///////////////////////////////////////////////////////////////
ForEachStart(objApplicationPools, __varEnumHolder);

///////////////////////////////////////////////////////////////
// Get First Application Pool Object... //

///////////////////////////////////////////////////////////////
nResult = ForEachGetNextItem(__varEnumHolder, objAppPool);
while ( nResult = ERROR_SUCCESS )
if IsObject( objAppPool ) then
if objAppPool.class = "IIsApplicationPool" then
nCount = nCount + 1;
strValue = objAppPool.Name;
strValue = strValue + " ("+ objAppPool.class +")";

nIndex = My_InsertionSort(listAppPools, objAppPool.Name);

ListAddString( listAppPools, strValue, AFTER );

Sprintf(strTemp, "%d> \"%s\"", nCount, strValue);
My_AddToLog(strTemp);
endif;
endif;

///////////////////////////////////////////////////////////
// Get the next object in the list... //
///////////////////////////////////////////////////////////
nResult = ForEachGetNextItem(__varEnumHolder, objAppPool);
endwhile;
else
strError = "Could not get the Application Pool object.";
endif;
catch
strError = "An exception has ocurred...";
endcatch;

if strError != "" then
My_AddToLog(strError);
endif;
else
strTemp = "Could not load the DLL \""+ strDLL +"\"";
My_AddToLog(strTemp);
endif;
end;

cthulhi
08-12-2008, 03:40 PM
Thank you TheTraveler for the suggestion and obvious effort you've put in to this solution, however we do not/cannot not use InstallScript in our shop.
Not to mention the time involved in re-writing/converting/testing more installs than I care to count.

While I'm sure your scripts work flawlessly (no sarcasm), I cannot and should not have to rely on you to support functions within the IS product that should be functioning correctly to begin with, that is why we fork over the bux, to have a reliable platform with which to distribute our software, and in all honesty we've found InstallShield to be that product over their competitors.

Not intending to sound too much like a horse's hind quarters, but I don't think it is too much to have the software producer correct the issue, or at the very least put a retry throw when it encounters a busy application pool which would then allow the end-user to take action instead of rolling back the entire installation and/or corrupting the IIS metabase.
Wouldn't that better follow the standard practice of notifying the user that a dependent application is using a file/directory/process to be modified? Or perhaps I'm just being too optimistic.

TheTraveler
08-12-2008, 04:32 PM
Hello,

That is definitely one point of view on things. I agree that if a problem or bug presents itself, that the owner of the product should try and fix it or at least come up with a work around the problem. However, this forum is about installation developers helping each other with possible solutions and to share each others experience. So that the installation developer has a good experience in writing their own installation project. That is the best thing, in my opinion, about this forum. Furthermore, I wrote almost all of my IIS functions before Install Shield had the capability of doing them in the IDE. So one of the biggest strengths with the tool is the ability to do customized functions or features that the install shield developers haven't thought of yet. I should also mention that the functions used to perform IIS configuration have all been documented in the Microsoft MSDN. The functions I wrote uses COM Objects that integrate with IIS.

Well, good luck in getting your solution.