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.
Common issues include:
Does the error toast provide any useful information?
HTTP Error 500.30 - ANCM In-Process Start Failure: This means the API has not been able to start. A common issue is that there is a problem with the database connection string. Check that the user name is correct and that the user has the correct permissions. 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.
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 does not load
The AdminUI API site has not been able to start-up. To find out why you will need to check the API logs.
Swagger UI loads
The AdminUI API is running, but something is preventing the UI from contact it. To find out why you will need to check the API logs.
Check the logs
To enable logging in the API, check out our logging documentation. These logs should contain an error detailing why the API could not be contacted.
Common issues include:
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
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.