500 Internal Server Error in logs. Blank screen

I am getting a 500 internal error returned from the FHIR server.
It appears to connect, but failing to find the user.
In the setup instructions I don’t see how to create users in the FHIR server

This is a snap deployed Nextcloud instance, so I don’t have as much freedom to modify it as it being loaded bare metal.
I tried to apply the “pretty URL’s” but failed due to the snap setup.

Here is my logs. I have remove some sensitive data:
[ehr] Error: GuzzleHttp\Exception\ServerException: Server error: GET http://SERVER:9080/fhir-server/api/v4/Patient?identifier=.........&_include=Patient:link&_id=............. resulted in a 500 Internal Server Error response:
{“resourceType”:“OperationOutcome”,“id”:"…",“issue”:[{“severity”:“fatal”,"c (truncated…)
at <>

  1. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 65
    GuzzleHttp\Exception\RequestException::create(GuzzleHttp\Psr7\Request {}, “*** sensitive parameter replaced ***”)
  2. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 203
    GuzzleHttp\Middleware::GuzzleHttp{closure}("*** sensitive parameters replaced ***")
  3. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 156
    GuzzleHttp\Promise\Promise::callHandler(1, “*** sensitive parameter replaced ***”, [GuzzleHttp\Prom … l])
  4. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 47
    GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}("*** sensitive parameters replaced ***")
  5. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 246
    GuzzleHttp\Promise\TaskQueue->run(true)
  6. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 223
    GuzzleHttp\Promise\Promise->invokeWaitFn()
  7. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 267
    GuzzleHttp\Promise\Promise->waitIfPending()
  8. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 225
    GuzzleHttp\Promise\Promise->invokeWaitList()
  9. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/promises/src/Promise.php line 62
    GuzzleHttp\Promise\Promise->waitIfPending()
  10. /snap/nextcloud/26119/htdocs/3rdparty/guzzlehttp/guzzle/src/Client.php line 183
    GuzzleHttp\Promise\Promise->wait()
  11. /snap/nextcloud/26119/htdocs/lib/private/Http/Client/Client.php line 233
    GuzzleHttp\Client->request(“get”, “http://fhir.nie … 1”, {verify: "/var/s … e})
  12. /var/snap/nextcloud/26119/nextcloud/extra-apps/ehr/lib/Service/FhirService.php line 145
    OC\Http\Client\Client->get(“http://fhir.nie … 1”, {auth: ["fhiruse … }})
  13. /var/snap/nextcloud/26119/nextcloud/extra-apps/ehr/lib/Service/FhirService.php line 240
    OCA\EHR\Service\FhirService->fetch(“GET”, “Patient”, “identifier=QNie … 1”)
  14. /var/snap/nextcloud/26119/nextcloud/extra-apps/ehr/lib/Controller/FhirController.php line 111
    OCA\EHR\Service\FhirService->search(“Patient”, “identifier=…&_include=Patient:link”)
  15. /snap/nextcloud/26119/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 169
    OCA\EHR\Controller\FhirController->search(“Patient”)
  16. /snap/nextcloud/26119/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OCA\EHR\Controll … }}, “search”)
  17. /snap/nextcloud/26119/htdocs/lib/private/AppFramework/App.php line 152
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\EHR\Controll … }}, “search”)
  18. /snap/nextcloud/26119/htdocs/lib/private/Route/Router.php line 309
    OC\AppFramework\App::main(“OCA\EHR\Controller\FhirController”, “search”, OC\AppFramework\ … {}, {type: “Patient” … "})
  19. /snap/nextcloud/26119/htdocs/lib/base.php line 1008
    OC\Route\Router->match("/apps/ehr/fhir/Patient")
  20. /snap/nextcloud/26119/htdocs/index.php line 37
    OC::handleRequest()

GET /index.php/apps/ehr/fhir/Patient?identifier=…&_include=Patient:link
from 192.168.1.1 by … at 2021-02-25T22:27:10+00:00

Hi niesz,

I don’t see any problem in the request url. Could you please send the entire response? I cannot see the OperationOutcome details in those logs since it was truncated. I am sure that will describe the problem. You can also see it in the FHIR server logs.

Aysel,

I am not sure where to find this info. Sorry I am green on this.
Is this what you are looking for?

I think there is a problem with the FHIR server. Looks like it could not initialize schemas properly. Could you try to kill your FHIR server and re-install it as instructed here?

In Step 3, wait until the database initialization is completed. You can check the progress with docker logs -t -f DOCKER_CONTAINER_ID. Also, make sure that you set INITIALIZE_DB environment variable to false in the docker compose file after initialization not to initialize database schemas again in a case that the server restarts.

I have rebuilt the FHIR server. To help me see what happens as it starts I removed the -d from the starting instructions. I do get a lot of warnings about .jar. Here is an example:


And it appears to start OK.
Now I receive a 401 error:

The INIT is set to false after the DB rebuild completed.

I am also trying to connect with http, and not https, as I was unable to get https to work. This might be my issue now, but don’t know how to edit the NGINX as pointed out in the Reverse Proxy, as this files does not exist.
This setup on the same network, and not externally accessible by the internet yet

That is probably something with your fhir username/password configuration in Kailona. Could you re-enter your fhir credentials in Kailona Admin settings? You can also test it with CURL locally to confirm that your username/password works.

You would not need SSL or reverse proxy if it is not open to internet since Kailona does not access it directly, but your nextcloud server should be able to access it.

Testing locally using curl with the fhiruser:
image

I did try changing the username, and password on the nextcloud server and got:

I also tried changing to the IP address instead of DNS name on the nextcloud server and got a host violates local access rules:
image
This doesn’t come up when i use the DNS name.

So I changed username, URL, and password back and got the same 401 error. Odd I don’t see anything on the FHIR server any longer when I get the 401 error.

Not sure if I said this before I am running nextcloud version: 20.0.7

In order to use IP address instead of domain, you should add the following parameter into nextcloud config.php file:

'allow_local_remote_servers' => true,

I see “fhirusers” instead of “fhiruser” for user ID in the server logs. Do you have any typo in username?

I just noticed that is nextcloud snap installation, right? If so, we have a known issue in that environment. See this issue: Blank screen without pretty urls · Issue #59 · Kailona/ehr · GitHub

Pretty URLs should be enabled as a quick workaround, but i think you can’t do that in snap environment yet: Remove index.php from urls · Issue #412 · nextcloud/nextcloud-snap · GitHub

We will work on that issue to support the nextcloud installations without pretty urls in Kailona soon. Any contribution would be appreciated as well.

Yes this was a typo to test if authentication would fail as well.
Yes I am using snap.:frowning:

Please let me know what I can do to contribute

Thank you greatly for your help on this.

This is now fixed in NEXTCLOUD 20.0.8 and Kailona version 0.1.5.
THANK YOU

1 Like