Starting the ELMA Server: Typical Errors and How to Fix Them

In this article, you can find a list of typical errors and ways to fix them. 

  1. Error initializing ELMA configuration ---> System.InvalidOperationException: Cannot check if database exists ---> System.Data.SqlClient.SqlException: Failed to log in as user "IIS APPPOOL\ELMA3-Standard":
  • Reason: The user account that is specified as an identity of ELMA application pool in IIS does not have administrator privileges.
  • Solution:
    • If ELMA uses Cassini web server: to solve this problem, go to the list of Windows services (in Windows Server 2008 you can do that by pressing CTRL + R and typing mcs) – ELMA Web Server 3.9 service – go to the service’s properties and specify the account with administrative privileges, that will be used by the service to log on. You can learn how to do that from this article.
    • If ELMA uses IIS web server: to solve this problem, you need to change the pool’s identity – choose LocalSystem or another account with administrative privileges. You can learn how to do that from this article.
  1. The underlying connection was closed: An expected error occurred on a receive: Unable to read data from the transport connection: An existing connection was closed by the remote host.: An existing connection was closed by the remote host:
  • Reason: ELMA Server is started with insufficient access privileges.
  • Solution:. You can fix this error in a similar way as described in the above paragraph 1.
  1. UnauthorizedAccessException: Access to the path ‘С:\ELMA3-Express\UserConfig\configuration.packages’ is denied.
  • Solution:. Delete the packages file from the UserConfig folder.
  1. Error while trying to create a backup copy of ELMA database.
  • Reason: Not enough disk space
  • Solution:. Increase or free up the disk space
  1. ELMA.Runtime.Db.DbStructureException: Error updating a database structure ---> System.Data.DataException: Failed to execute the query DROP INDEX UK_principal_name ON sysdiagrams ---> System.Data.SqlClient.SqlException: An explicit DROP INDEX is not allowed on index "sysdiagrams.UK_principal_name". It is being used for UNIQUE KEY constraint enforcement.
  • Reason:ELMA database contains system tables.
  • Solution: Go to SQL Management Studio, open your database and delete all tables from the System Tables folder.
  1. Cannot connect to a database because it has active connections:
  • Reason: In some cases (e.g. when you restore a database from backup copies), the database may have information about the current active connection that will not allow you to use it. Usually, it happens when you use a database from different time zones.
  • Solution: Open the database using the SQL manager and delete all items from the DB_ACTIVECONNECTIONS 
  1. ELMA.Runtime.Db.DbStructureException: Failed to update the database structure ---> NHibernate.TransactionException: Commit failed with SQL exception ---> FirebirdSql.Data.FirebirdClient.FbException: unsuccessful metadata update object INDEX is in use ---> FirebirdSql.Data.Common.IscException: unsuccessful metadata update:
  • Reason: An error occurred during conversion of the database (ELMA converts the database when you change the object model).
  • Solution: Restore the database from a backup copy.
  1. ELMA.Runtime.Exceptions.ConfigurationInitializeException: Error initializing ELMA configuration ---> System.InvalidOperationException: Failed to connect to the database ---> FirebirdSql.Data.FirebirdClient.FbException: Unable to complete network request to host "127.0.0.1". ---> FirebirdSql.Data.Common.IscException: Unable to complete network request to host "127.0.0.1":
  • The database connection string <add name="MainDB" connectionString="Data Source=127.0.0.1;Initial Catalog={CONFIGDIR}\elma3-express.fdb;User ID=sysdba;Password=masterkey;Port=3056;Dialect=3;ServerType=0"/> from the configuration.config file has invalid characters.
  • Check the connection string for typos. Note, that it is case sensitive. You can learn more about ELMA configuration files from this article.
  1. ELMA.Runtime.Exceptions.ConfigurationInitializeException: Error initializing ELMA configuration ---> System.InvalidOperationException: Failed to connect to the database ---> System.Data.SqlClient.SqlException: Cannot open database "ELMA" requested by the login. The login failed.
    Login failed for user "
    NT AUTHORITY\System":
  • Reason:No administrative privileges for the account, that will be used by ELMA Web Server service to log on to Cassini server
  • Solution: You can fix this error in a similar way as described in the above paragraph 1.
  1. MS SQL Server exception: Login failed for user ’NT AUTHORITY\System’.
  • Reason: Failed to open the explicitly specified database "ELMA". [Client: <local machine>]. Error: 18456, severity: 14, state: 38: ELMA passes the SQL Server authorization successfully, but there is no access to the database.
  • Solution: Go to MS SQL Management StudioSecurityLogins – Add sysadmin server role to the NT AUTHORITY\System login. You can learn how to do that from this article.