Failed to load apps. Please reload. When signing in

Getting “Failed to load apps. Please reload” after logging in with the admin credentials in a local docker environment.

.ENV:

SQUIDEX_PROTOCOL=http
SQUIDEX_FORCE_HTTPS=False
SQUIDEX_DOMAIN=localhost
SQUIDEX_PORT=5000
SQUIDEX_ADMINEMAIL=<myemail>
SQUIDEX_ADMINPASSWORD=H3j3mil123_
SQUIDEX_GITHUBCLIENT=
SQUIDEX_GITHUBSECRET=
SQUIDEX_GOOGLECLIENT=<myclient>
SQUIDEX_GOOGLESECRET=<mysecret>
SQUIDEX_MICROSOFTCLIENT=
SQUIDEX_MICROSOFTSECRET=

docker-compose:

version: '3'
services:
  nuxt:
    build: .
    ports:
      - '1337:1337'
    links:
      - mongo
      - squidex
  mongo:
    restart: unless-stopped
    image: mongo:latest
    volumes:
      - ./mongo-data:/data/db
  squidex:
    image: squidex/squidex:latest
    ports:
      - '5000:80'
    hostname: ${SQUIDEX_DOMAIN}
    environment:
      - URLS__BASEURL=${SQUIDEX_PROTOCOL}://${SQUIDEX_DOMAIN}:${SQUIDEX_PORT}/
      - URLS__ENFORCEHTTPS=${SQUIDEX_FORCE_HTTPS}
      - EVENTSTORE__MONGODB__CONFIGURATION=mongodb://mongo
      - STORE__MONGODB__CONFIGURATION=mongodb://mongo
      - IDENTITY__ADMINEMAIL=${SQUIDEX_ADMINEMAIL}
      - IDENTITY__ADMINPASSWORD=${SQUIDEX_ADMINPASSWORD}
      - IDENTITY__GOOGLECLIENT=${SQUIDEX_GOOGLECLIENT}
      - IDENTITY__GOOGLESECRET=${SQUIDEX_GOOGLESECRET}
      - IDENTITY__GITHUBCLIENT=${SQUIDEX_GITHUBCLIENT}
      - IDENTITY__GITHUBSECRET=${SQUIDEX_GITHUBSECRET}
      - IDENTITY__MICROSOFTCLIENT=${SQUIDEX_MICROSOFTCLIENT}
      - IDENTITY__MICROSOFTSECRET=${SQUIDEX_MICROSOFTSECRET}
      - LETSENCRYPT_HOST=${SQUIDEX_DOMAIN}:${SQUIDEX_PORT}
      - LETSENCRYPT_EMAIL=${SQUIDEX_ADMINEMAIL}
      - VIRTUAL_HOST=${SQUIDEX_DOMAIN}:${SQUIDEX_PORT}
    depends_on:
      - mongo
    volumes:
      - ./squidex-assets:/app/Assets
    links:
      - mongo
    restart: unless-stopped

Error log:

squidex_1  | {
squidex_1  |   "logLevel": "Error",
squidex_1  |   "message": "Exception occurred while processing message.",
squidex_1  |   "eventId": {
squidex_1  |     "id": 3
squidex_1  |   },
squidex_1  |   "exception": {
squidex_1  |     "type": "System.InvalidOperationException",
squidex_1  |     "message": "IDX20803: Unable to obtain configuration from: '[PII is hidden]'.",
squidex_1  |     "stackTrace": "   at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)\n   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()"
squidex_1  |   },
squidex_1  |   "app": {
squidex_1  |     "name": "Squidex",
squidex_1  |     "version": "3.3.0.0",
squidex_1  |     "sessionId": "a8759411-eac7-4356-9cb0-fe8fe82fd2de"
squidex_1  |   },
squidex_1  |   "web": {
squidex_1  |     "requestId": "850bfc38-269a-404b-9c4d-f1e53000763e",
squidex_1  |     "requestPath": "/apps",
squidex_1  |     "requestMethod": "GET",
squidex_1  |     "routeValues": {
squidex_1  |       "area": "Api",
squidex_1  |       "action": "GetApps",
squidex_1  |       "controller": "Apps"
squidex_1  |     }
squidex_1  |   },
squidex_1  |   "timestamp": "2019-09-27T09:15:35Z",
squidex_1  |   "category": "Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler"
squidex_1  | }
squidex_1  | 
squidex_1  | {
squidex_1  |   "logLevel": "Information",
squidex_1  |   "filters": {
squidex_1  |     "costs": 0.0
squidex_1  |   },
squidex_1  |   "elapsedRequestMs": 139,
squidex_1  |   "app": {
squidex_1  |     "name": "Squidex",
squidex_1  |     "version": "3.3.0.0",
squidex_1  |     "sessionId": "a8759411-eac7-4356-9cb0-fe8fe82fd2de"
squidex_1  |   },
squidex_1  |   "web": {
squidex_1  |     "requestId": "850bfc38-269a-404b-9c4d-f1e53000763e",
squidex_1  |     "requestPath": "/api/apps",
squidex_1  |     "requestMethod": "GET"
squidex_1  |   },
squidex_1  |   "timestamp": "2019-09-27T09:15:35Z"
squidex_1  | }
squidex_1  | 
squidex_1  | {
squidex_1  |   "logLevel": "Error",
squidex_1  |   "message": "Connection id \"0HLQ35CPDSGQ4\", Request id \"0HLQ35CPDSGQ4:00000006\": An unhandled exception was thrown by the application.",
squidex_1  |   "eventId": {
squidex_1  |     "id": 13,
squidex_1  |     "name": "ApplicationError"
squidex_1  |   },
squidex_1  |   "connectionId": "0HLQ35CPDSGQ4",
squidex_1  |   "traceIdentifier": "0HLQ35CPDSGQ4:00000006",
squidex_1  |   "exception": {
squidex_1  |     "type": "System.InvalidOperationException",
squidex_1  |     "message": "IDX20803: Unable to obtain configuration from: '[PII is hidden]'.",
squidex_1  |     "stackTrace": "   at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)\n   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()\n   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()\n   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()\n   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)\n   at IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler.HandleAuthenticateAsync()\n   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()\n   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)\n   at Microsoft.AspNetCore.Authorization.Policy.PolicyEvaluator.AuthenticateAsync(AuthorizationPolicy policy, HttpContext context)\n   at Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter.OnAuthorizationAsync(AuthorizationFilterContext context)\n   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()\n   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)\n   at NSwag.AspNetCore.Middlewares.OpenApiDocumentMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)\n   at Squidex.Web.Pipeline.EnforceHttpsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /src/src/Squidex.Web/Pipeline/EnforceHttpsMiddleware.cs:line 28\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at Squidex.Web.Pipeline.LocalCacheMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /src/src/Squidex.Web/Pipeline/LocalCacheMiddleware.cs:line 30\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at Squidex.Web.Pipeline.RequestLogPerformanceMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /src/src/Squidex.Web/Pipeline/RequestLogPerformanceMiddleware.cs:line 33\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)"
squidex_1  |   },
squidex_1  |   "app": {
squidex_1  |     "name": "Squidex",
squidex_1  |     "version": "3.3.0.0",
squidex_1  |     "sessionId": "a8759411-eac7-4356-9cb0-fe8fe82fd2de"
squidex_1  |   },
squidex_1  |   "web": {
squidex_1  |     "requestId": "850bfc38-269a-404b-9c4d-f1e53000763e",
squidex_1  |     "requestPath": "/api/apps",
squidex_1  |     "requestMethod": "GET"
squidex_1  |   },
squidex_1  |   "timestamp": "2019-09-27T09:15:35Z",
squidex_1  |   "category": "Microsoft.AspNetCore.Server.Kestrel"
squidex_1  | }```

Can you enable this flag: https://github.com/Squidex/squidex/blob/master/src/Squidex/appsettings.json#L417

As environment variable IDENTITY__SHOWPII==True…then send me the full logs as file.

Thank you for your response

https://pastebin.com/fpiMNqyZ

Are you sure that you want to host squidex on localhost:5000?

This is a known problem. Because Squidex hosts the identity-server for openid-connect and the API inside the same application, Squidex has to make a call to itself. The API calls the identity-server on http://localhost:5000/identity-server/.well-known/openid-configuration to request the information and then another endpoint to validate the token. But from docker perspective localhost is the container and not the host machine and there is no service waiting listening on port 5000 inside the container.

So you have three options:

  1. Test Squidex on a real VM, e.g. https://www.vultr.com/products/cloud-compute/ and use a public host for SQUIDEX_DOMAIN`
  2. Use port 80
  3. Create an entry in your local host file, e.g. squidex.local 127.0.0.1 (not sure if it works)

Hi, thank you for the fast reply changing the port solved the issue!