API Server cannot establish connection to the database

Hi experts,

since few days I am experiencing issues with the API Server. It is apparently not able to establish connection to the database. It had previously worked seamlessly since the installation (about 1 year ago) and there were no intenational changes on the API itself. There were modifications in the dynamic module qer-app-portal upon the day, as the issue appeared. I wonder if there would be any correlation to the error...

When i call .../ApiServer/imx/ping in the browse, i get this response:

{"NoDbConnection":true,"HasPluginErrors":false,"IsWaitingToStartUpdate":false,"PluginsWithErrors":[]}

Logs on the server are saying this:

--- System.Exception: API could not be loaded. The API server will be running in connectionless mode. ---> System.Exception: Could not load API from provider: API from ScriptAssembly
at QBM.CompositionApi.ApiManager.DbMethodProvider.<GetBranchedMethodSetsAsync>d__12.MoveNext()
--- End of inner exception stack trace ---
 ERROR ( WebLog ) : An error occurred while processing the request: GET http://<host>/ApiServer/imx/entityschema System.Exception: An error occurred while processing the request: GET http://<host>/ApiServer/imx/entityschema ---> System.Exception: Error while building schema for imx/multilanguage/uicultures ---> System.NullReferenceException: Object reference not set to an instance of an object.
at VI.DB.Entities.SessionExtensions.MultiLanguage(ISession session)

>>>> I am using Version 8.2.1 <<<<<

I have already spent multiple hours on debugging. No results. 

I would really appreciate any suggestions or help.

Cheers

Toni

Parents
  • Hi Toni,

    Is there any error message in the logs before that? I've seen this one as a follow-up problem when the service connection to the database cannot be set up.

  • Hi Hanno,

    thanks for the answer!

    The service connection looks indeed suspicious. This is what appears in the log file after restarting the IIS Server:

    2024-01-24 13:44:00.7849 INFO ( WebLog ) : Ending API server process, goodbye.
    2024-01-24 13:44:30.7875 INFO ( WebLog ) : Ending API server process, goodbye.
    2024-01-24 13:44:30.8031 INFO ( WebLog ) : The application is shutting down, reason: HostingEnvironment
    2024-01-24 13:45:47.0691 INFO ( WebLog ) : Creating performance counters in category One Identity Manager API Server, instance _LM_W3SVC_1_ROOT_ApiServer
    2024-01-24 13:45:47.4910 INFO ( WebLog ) : Could not create performance counters: Access to the registry key 'Global' is denied.
    2024-01-24 13:45:47.4910 INFO ( WebLog ) : Updating performance counter values
    2024-01-24 13:45:47.4910 INFO ( WebLog ) : Performance counters initialized in category One Identity Manager API Server, instance _LM_W3SVC_1_ROOT_ApiServer
    2024-01-24 13:45:47.6004 INFO ( WebLog ) : Starting plugin: QBM.CompositionApi.PlugIns.ServiceUnavailablePlugIn
    2024-01-24 13:45:47.7412 INFO ( WebLog ) : Starting plugin: QBM.CompositionApi.PlugIns.UpdateCheckPlugIn
    2024-01-24 13:45:47.7412 INFO ( WebLog ) : Application set-up start
    2024-01-24 13:45:47.7412 INFO ( WebLog ) : Account: IIS APPPOOL\ApiServer_POOL
    2024-01-24 13:45:47.7412 INFO ( WebLog ) : Culture: en-US
    2024-01-24 13:45:47.8347 INFO ( WebLog ) : Loaded assemblies:
    ...
    2024-01-24 13:45:47.8347 INFO ( WebLog ) : Application set-up end
    2024-01-24 13:45:47.8505 INFO ( WebLog ) : Loading assembly: System.Security, Version=4.0.0.0, Culture=neutral
    2024-01-24 13:45:47.9597 INFO ( WebLog ) : Loading assembly: System.Transactions, Version=4.0.0.0, Culture=neutral
    2024-01-24 13:45:49.0847 INFO ( ObjectLog ) : User WebAppService_<GUID> (Dialog user: WebAppService_<GUID>, X fields: WebAppService_<GUID>) authenticated.
    2024-01-24 13:45:49.1159 INFO ( WebLog ) : New service connection requested
    2024-01-24 13:45:49.1472 INFO ( WebLog ) : Updater status on application start: NoUpdatesAvailable
    2024-01-24 13:45:49.1472 INFO ( WebLog ) : Starting plugin: QBM.CompositionApi.PlugIns.ReportConfigurationPlugIn
    ...
    024-01-24 13:45:50.0846 INFO ( WebLog ) : FileLoader: Loading stream from "C:\inetpub\wwwroot\ApiServer\bin\imxweb\Html_uci.zip"
    2024-01-24 13:45:50.1315 INFO ( WebLog ) : Decompressing plugin uci to C:\inetpub\wwwroot\ApiServer\App_Data\WebCache\html_zldpdjo1.qe4
    2024-01-24 13:45:50.1472 INFO ( WebLog ) : Starting plugin: QBM.CompositionApi.ApiManager.RouteActivatorPlugIn
    2024-01-24 13:45:50.1472 INFO ( WebLog ) : Loading assembly: System.Net.Http, Version=4.0.0.0, Culture=neutral
    2024-01-24 13:45:50.1629 INFO ( WebLog ) : Loading assembly: SMDiagnostics, Version=4.0.0.0, Culture=neutral
    2024-01-24 13:45:50.4130 INFO ( ObjectLog ) : User WebAppService_<GUID> (Dialog user: WebAppService_<GUID>, X fields: WebAppService_<GUID>) authenticated.
    2024-01-24 13:45:50.4130 INFO ( WebLog ) : New service connection requested
    2024-01-24 13:45:50.4597 INFO (VI.DB.Meta ) : Loaded configuration from database for 'http://<host>/ApiServer/'
    2024-01-24 13:45:50.4753 INFO (VI.DB.Meta ) : Loaded configuration from database for 'http://<host>/ApiServer/'
    2024-01-24 13:45:50.5534 WARN ( WebLog ) : System.Exception: API could not be loaded. The API server will be running in connectionless mode. ---> System.Exception: Could not load API from provider: API from ScriptAssembly
    at QBM.CompositionApi.ApiManager.DbMethodProvider.<GetBranchedMethodSetsAsync>d__12.MoveNext()
    --- End of inner exception stack trace --- System.Exception: API could not be loaded. The API server will be running in connectionless mode. ---> System.Exception: Could not load API from provider: API from ScriptAssembly
    at QBM.CompositionApi.ApiManager.DbMethodProvider.<GetBranchedMethodSetsAsync>d__12.MoveNext()
    --- End of inner exception stack trace ---
    2024-01-24 13:45:50.7096 INFO ( WebLog ) : API Server state is now: Running

    The Service user WebAppService_<GUID> is active and without changes since the installation, as I can see in the DialogUser table. I masked the guid in this post.

    I can also ping the DB Server from the Web Server.

    Do you have any further suggestions? 

    There is always an emergency exit: reinstall the API Server. But I would really like to understand what is this error about and avoid installing it again... 

    Thank you for your time. 

    Regards

    Toni

Reply
  • Hi Hanno,

    thanks for the answer!

    The service connection looks indeed suspicious. This is what appears in the log file after restarting the IIS Server:

    2024-01-24 13:44:00.7849 INFO ( WebLog ) : Ending API server process, goodbye.
    2024-01-24 13:44:30.7875 INFO ( WebLog ) : Ending API server process, goodbye.
    2024-01-24 13:44:30.8031 INFO ( WebLog ) : The application is shutting down, reason: HostingEnvironment
    2024-01-24 13:45:47.0691 INFO ( WebLog ) : Creating performance counters in category One Identity Manager API Server, instance _LM_W3SVC_1_ROOT_ApiServer
    2024-01-24 13:45:47.4910 INFO ( WebLog ) : Could not create performance counters: Access to the registry key 'Global' is denied.
    2024-01-24 13:45:47.4910 INFO ( WebLog ) : Updating performance counter values
    2024-01-24 13:45:47.4910 INFO ( WebLog ) : Performance counters initialized in category One Identity Manager API Server, instance _LM_W3SVC_1_ROOT_ApiServer
    2024-01-24 13:45:47.6004 INFO ( WebLog ) : Starting plugin: QBM.CompositionApi.PlugIns.ServiceUnavailablePlugIn
    2024-01-24 13:45:47.7412 INFO ( WebLog ) : Starting plugin: QBM.CompositionApi.PlugIns.UpdateCheckPlugIn
    2024-01-24 13:45:47.7412 INFO ( WebLog ) : Application set-up start
    2024-01-24 13:45:47.7412 INFO ( WebLog ) : Account: IIS APPPOOL\ApiServer_POOL
    2024-01-24 13:45:47.7412 INFO ( WebLog ) : Culture: en-US
    2024-01-24 13:45:47.8347 INFO ( WebLog ) : Loaded assemblies:
    ...
    2024-01-24 13:45:47.8347 INFO ( WebLog ) : Application set-up end
    2024-01-24 13:45:47.8505 INFO ( WebLog ) : Loading assembly: System.Security, Version=4.0.0.0, Culture=neutral
    2024-01-24 13:45:47.9597 INFO ( WebLog ) : Loading assembly: System.Transactions, Version=4.0.0.0, Culture=neutral
    2024-01-24 13:45:49.0847 INFO ( ObjectLog ) : User WebAppService_<GUID> (Dialog user: WebAppService_<GUID>, X fields: WebAppService_<GUID>) authenticated.
    2024-01-24 13:45:49.1159 INFO ( WebLog ) : New service connection requested
    2024-01-24 13:45:49.1472 INFO ( WebLog ) : Updater status on application start: NoUpdatesAvailable
    2024-01-24 13:45:49.1472 INFO ( WebLog ) : Starting plugin: QBM.CompositionApi.PlugIns.ReportConfigurationPlugIn
    ...
    024-01-24 13:45:50.0846 INFO ( WebLog ) : FileLoader: Loading stream from "C:\inetpub\wwwroot\ApiServer\bin\imxweb\Html_uci.zip"
    2024-01-24 13:45:50.1315 INFO ( WebLog ) : Decompressing plugin uci to C:\inetpub\wwwroot\ApiServer\App_Data\WebCache\html_zldpdjo1.qe4
    2024-01-24 13:45:50.1472 INFO ( WebLog ) : Starting plugin: QBM.CompositionApi.ApiManager.RouteActivatorPlugIn
    2024-01-24 13:45:50.1472 INFO ( WebLog ) : Loading assembly: System.Net.Http, Version=4.0.0.0, Culture=neutral
    2024-01-24 13:45:50.1629 INFO ( WebLog ) : Loading assembly: SMDiagnostics, Version=4.0.0.0, Culture=neutral
    2024-01-24 13:45:50.4130 INFO ( ObjectLog ) : User WebAppService_<GUID> (Dialog user: WebAppService_<GUID>, X fields: WebAppService_<GUID>) authenticated.
    2024-01-24 13:45:50.4130 INFO ( WebLog ) : New service connection requested
    2024-01-24 13:45:50.4597 INFO (VI.DB.Meta ) : Loaded configuration from database for 'http://<host>/ApiServer/'
    2024-01-24 13:45:50.4753 INFO (VI.DB.Meta ) : Loaded configuration from database for 'http://<host>/ApiServer/'
    2024-01-24 13:45:50.5534 WARN ( WebLog ) : System.Exception: API could not be loaded. The API server will be running in connectionless mode. ---> System.Exception: Could not load API from provider: API from ScriptAssembly
    at QBM.CompositionApi.ApiManager.DbMethodProvider.<GetBranchedMethodSetsAsync>d__12.MoveNext()
    --- End of inner exception stack trace --- System.Exception: API could not be loaded. The API server will be running in connectionless mode. ---> System.Exception: Could not load API from provider: API from ScriptAssembly
    at QBM.CompositionApi.ApiManager.DbMethodProvider.<GetBranchedMethodSetsAsync>d__12.MoveNext()
    --- End of inner exception stack trace ---
    2024-01-24 13:45:50.7096 INFO ( WebLog ) : API Server state is now: Running

    The Service user WebAppService_<GUID> is active and without changes since the installation, as I can see in the DialogUser table. I masked the guid in this post.

    I can also ping the DB Server from the Web Server.

    Do you have any further suggestions? 

    There is always an emergency exit: reinstall the API Server. But I would really like to understand what is this error about and avoid installing it again... 

    Thank you for your time. 

    Regards

    Toni

Children
No Data