Microsoft KB Archive/827905

= &quot;An unexpected error has occurred in the modeling server&quot; error message when you try to create a model in Project Server 2002 =

Article ID: 827905

Article Last Modified on 1/5/2007

-

APPLIES TO


 * Microsoft Project Server 2002

-





Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SYMPTOMS
When you try to create a Portfolio Model in Microsoft Project Web Access (PWA), you may receive the following error message:

An unexpected error has occurred in the modeling server. Please see your server administrator.

If you have turned on modeling error logging, the following text may appear in the Modeler trace log: SERVER COMPONENT ERROR occurred at 12-Nov-03 10:30:25 PM Error#   = 5 Source  = mspjwms Descr   = Invalid procedure call or argument Server Component Info: Component Title   = mspjwms Component AppName = C:\Program Files\Microsoft Project Server\Bin\MSPJWMS.(EXE or DLL) Component Version = 10.2003.723 Server Info: Server UserID  = Test User Computer = Test1 Client Info: Calling procedure = /tests/Modeling/modeldtl1.asp Calling Username = Test User Procedure Nesting: (3) procedures. mspjwms.CSession.SaveModelDetails [95] mspjwms.CSession.CreateModel [44] mspjwms.CSession.LoadCalendars - SERVER COMPONENT ERROR occurred at 12-Nov-03 10:30:25 PM Error#   = -2147220495 Source  = mspjwms.DBFunctions Descr   = Connection opened by mspjwms.CSession.SaveModelDetails and closed by Error handler Server Component Info: Component Title   = mspjwms Component AppName = C:\Program Files\Microsoft Project Server\Bin\MSPJWMS.(EXE or DLL) Component Version = 10.2003.723 Server Info: Server UserID  = Test User Computer = Test1 Client Info: Calling procedure = /tests/Modeling/modeldtl1.asp Calling Username = Test User Procedure Nesting: (2) procedures. Error handler mspjwms.DBFunctions.DBCloseConnection



CAUSE
This problem may occur if one of the following conditions is true:
 * The Microsoft SQL account that is used to access the Microsoft Project Server database is not configured to use the current database as the default database. This configuration may occur when multiple Project Server sites are configured to point to different databases by using the same pair of SQL accounts. However, the default MSProjectServerUser and MSProjectUser accounts can only be configured for one database.
 * The localized calendars are missing. For example, the default Enterprise Calendar in the Dutch version of Project Server is labeled &quot;Standaard&quot;. The Portfolio Modeler tries to load the default calendar at startup. If this calendar is missing or is corrupted, you may receive the error message that is described in the &quot;Symptoms&quot; section of this article.



The localized default calendar is missing
To resolve this problem, restore the Enterprise Global template to make sure that the localized default calendar is valid. To do this, follow these steps:
 * 1) Log on to Microsoft Project Professional as an administrator.
 * 2) On the Tools menu, point to Enterprise Options, and then click Restore Enterprise Global.
 * 3) Select the user account, and then click Browse to locate your Enterprise Global backup file.

Note Do not use the Global.mpt file to restore your Enterprise Global. Make sure that you locate an actual backup of your Enterprise Global.
 * 1) Click Restore.
 * 2) Restart Project Professional.

Configure the Microsoft SQL Server accounts
To resolve this issue, each Project Server database must have its own unique pair of SQL accounts configured to use the current database as the default database. Additionally, the SQL accounts must be configured as an MSProjectRole or an MSProjectServerRole role.

To create and to assign SQL accounts to a default database, follow these steps.

Note This example creates a pair of SQL accounts that are named MSProjectUser1 and MSProjectServerUser1, and configures each database that is accessed as the default database. This example also assigns the accounts to the correct roles in the current database.
 * 1) Click Start, point to All Programs, point to Microsoft SQL Server, and then click Enterprise Manager.
 * 2) Expand the tree to find the Security container, and then expand the Security container.
 * 3) Right-click Logins, and then click New Login.
 * 4) In the Name box, type the name of the account.

For this example, name the account MSProjectUSer1.
 * 1) Click the SQL Server Authentication option button, and then provide the system administrator user account password.
 * 2) In the Database drop-down list, click the Project Server database that you want to use as the default database for this account.
 * 3) Click the Database Access tab.
 * 4) Click the check box next to the database that you want to access.
 * 5) In the Permit in database role area, click the check box that is next to MSProjectRole.
 * 6) Repeat steps 3 through 9, replacing MSProjectServerUSer1 as the account name in step 4, and then replace MSProjectServerRole as the role in step 9.



MORE INFORMATION
Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

To turn on modeling error logging, follow these steps:
 * 1) Click Start, and then click Run.
 * 2) Type regedit, and then click OK.
 * 3) Locate or create the   registry key.

The WARP key can contain the following registry entries. Note that you may have to create one or more of these entries:
 * ErrorLog (Type REG_SZ): Use this entry to define the log file name and the path of the text file that the modeling server will use to write error information.
 * BypassSecurity (Type REG_DWORD): Any non-zero value will force the modeler to bypass typical security checking on models, and to grant access to all users.
 * MaxCalendars (Type REG_DWORD): This entry defines the number of calendars that the modeling engine should allocate space for. The default value is 3000.
 * MaxResources (Type REG_DWORD): This entry defines the number of resources that the modeling engine should allocate space for. The default value is 2000.
 * MaxSkills (Type REG_DWORD): This entry defines the number of skills that the modeling engine should allocate space for. the default value is 2000.
 * StretchTime (Type REG_DWORD): This entry defines the number of milliseconds per thousand tasks that the engine should allow before returning a timeout error message.

