If you experience the error message “Unable to contact API”, it means that the AdminUI backend cannot successfully communicate with the AdminUI API.
To troubleshoot this issue, we recommend working through the following steps.
To begin please make sure you have enabled logs for the API. To do so you can check the section on enabling logging.. These logs should contain an error detailing why the API could not be contacted.
Does the Swagger UI work?
You can verify that the API has been able to start-up by visiting the Swagger UI, available on the endpoint:
Swagger UI loads
The AdminUI API is running, but something is preventing the UI from contacting it. To find out why you will need to check the API logs.
Swagger UI does not load
The AdminUI API site has not been able to start-up. Typically when this happens you will see a web page with the following error:
HTTP Error 500.30 - ANCM In-Process Start Failure
Common issues include:
When the bootstrap process fails at any point it will rollback to its previous state before the bootstrap ran. This is indicated in the logs by the message "Bootstrap Failed - Rolling Back".
This usually happens when there is conflicting data in your database. If this is the case then you can check your logs for the error by going to your logs directory, if you haven't already enabled logs please see our enabling logging section.
If this is the case please email us with your logs at [email protected]
One known problem is with SQL Express and SQL logins. When installing SQLExpress for the first time, it defaults to use Windows Authentication. This means that you can’t log into any of the databases using SQL logins. To solve this problem, change this SQL Express setting to allow SQL logins.
Another problem can be with improperly escaped SQL Express connection strings e.g. using 'localhost\SQLExpress' instead of '.\SQLExpress' would result in the same error.
SqlException: A network-related or instance-specific error occurred while establishing a connection
If you receive this error, the API cannot connect to the database. It may be that the connection string is invalid or that the website is unable to resolve the server name.
SqlException: Login failed for user
Check that the user name is correct and that the user has the correct permissions.
If you receive this error, the API is not authorized to access the database. It may be that the user in the connection string is invalid or is not authorized to access the database.
SqlException: A connection was successfully established with the server, but then an error occurred during the login process
If you receive this error, the API is not authorized to access the database. In this case, it may be that the website user is trying to use SQL authentication (a username and password) but the database only supports Windows authentication.
To resolve this, we recommend enabling SQL authentication in your database. This is often required when using SQL Server Express from IIS.
SqlException Invalid object name 'AspNetClaimTypes'
This means that the API is trying to connect to a user (identity) database that does not use AdminUI’s database schema. AdminUI uses an extended version of the core ASP.NET Core Identity entity framework schema that provides strong typing for claim types and improved user and role searching. To resolve this, you will need to update the application currently in charge of user store migrations to use the AdminUI schema.
If none of these steps work or you are unsure how to fix the error in the logs, please contact us at [email protected], detailing the issue you see, including any error logs.