1

We have 2 docker containers, 1 each for identity server and another for an application. I am able to authorize the swagger page but when I execute an end-point in the swagger page, I see Internal Server 500 error.

Below is the response while using edge dev-tools: Status 500 while SetCsrfCookie //initiator abp.swagger.js

Request URL: https://mydomainname:8080/abp/Swashbuckle/SetCsrfCookie
Request Method: GET
Status Code: 500 
Remote Address: 10.0.0.3:8080
Referrer Policy: strict-origin-when-cross-origin

Status 500 while calling https://mydomainname:8080/api/entity-name/entityname //initiator swagger-ui-bundle.js:2


Following error from container:

[INF] Request starting HTTP/2 GET https://mydomainname:8080/abp/Swashbuckle/SetCsrfCookie - -
[ERR] Exception occurred while processing message.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'.

Now I tried the below things after following a couple of suggestions:

  1. Put both containers in same network in docker using --network.
  2. Give network alias using --network-alias.

The problem I understand is that the application container cannot resolve the internal domain to itself.

The SetCsrfCookie method is not found at mydomainname:8080. What I figure we need to do is to make sure the container is able to resolver mydomainname:8080 to itself, whose ip addr is 172.18.0.4.

I tried --add-host, --network-alias etc while running the container. Currently we're resolving request to VM 10.0.0.3 (that has the container) to mydomainname by using the hosts file in our machine.

The issue i figure is when the container in the vm trying to resolve mydomainname to itself. How can we solve this?

Thank you

Neo
  • 143
  • 12

1 Answers1

1

You should enable the ShowPII flag first to get an actual error message.

How this is done is answered here.

In my case the URL used to fetch the discovery document was wrong but it could be really anything. The actual error message will give you a glue.

ViRuSTriNiTy
  • 5,017
  • 2
  • 32
  • 58
  • 1
    For me it was an issue with the certificate being unavailable. I added the certificate inside the container and the error disappeared. Thanks for the help :) – Neo Mar 04 '22 at 14:16