hapifhir / hapi-fhir-jpaserver-starter

Apache License 2.0
375 stars 1.01k forks source link

Error when uploading terminology in HAPI FHIR R4 server using hapi-fhir-cli tool #193

Open azizul90 opened 3 years ago

azizul90 commented 3 years ago

Im recently has successfully set up a FHIR server deployed using docker image (hapiproject/hapi:latest). When Im trying to upload LOINC terminology into the server, I`m encounter the following error ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: HTTP 400 : Unknown file: hapi-fhir-cli9140861092969243052.zip.

Below are complete log produced by hapi-fhir-cli tool.

[root@svr fhir-dataset]# ./hapi-fhir-cli upload-terminology -d loinc_2.69_PartFile_5.1.zip -d loinc_2.69_AnswerFile_2.69.zip -d loinc_2.69_MultiAxialHierarchy.zip -v r4 -t https://{domain-name}} -u http://loinc.org
------------------------------------------------------------
🔥  HAPI FHIR 5.2.0 - Command Line Tool
------------------------------------------------------------
Process ID                      : 30286@{server-hostname}
Max configured JVM memory (Xmx) : 6.9GB
Detected Java version           : 1.8.0_275
------------------------------------------------------------
2020-12-22 18:16:43.587 [main] INFO  c.u.f.c.UploadTerminologyCommand Adding ZIP file: loinc_2.69_PartFile_5.1.zip
2020-12-22 18:16:43.812 [main] INFO  c.u.f.c.UploadTerminologyCommand File size is greater than 10 MB - Going to use a local file reference instead of a direct HTTP transfer. Note that this will only work when executing this command on the same server as the FHIR server itself.
2020-12-22 18:16:43.831 [main] INFO  c.u.f.c.UploadTerminologyCommand Adding ZIP file: loinc_2.69_AnswerFile_2.69.zip
2020-12-22 18:16:43.844 [main] INFO  c.u.f.c.UploadTerminologyCommand Adding ZIP file: loinc_2.69_MultiAxialHierarchy.zip
2020-12-22 18:16:43.875 [main] INFO  c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2020-12-22 18:16:45.535 [main] ERROR c.u.f.c.UploadTerminologyCommand Received the following response:
{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Unknown file: hapi-fhir-cli9140861092969243052.zip</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [ {
    "severity": "error",
    "code": "processing",
    "diagnostics": "Unknown file: hapi-fhir-cli9140861092969243052.zip"
  } ]
}
2020-12-22 18:16:45.537 [main] ERROR ca.uhn.fhir.cli.App Error during execution:
ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: HTTP 400 : Unknown file: hapi-fhir-cli9140861092969243052.zip
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:302)
        at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:351)
        at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:540)
        at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1314)
        at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:204)
        at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:113)
        at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:268)
        at ca.uhn.fhir.cli.App.main(App.java:43)
2020-12-22 18:16:45.538 [Thread-0] INFO  ca.uhn.fhir.cli.App HAPI FHIR is shutting down...
citizenrich commented 3 years ago

I can reproduce this with SNOMED-CT on macOS with hapi-fhir-cli 5.2.0

Edit: Also confirmed with Ubuntu 20.04.

azizul90 commented 3 years ago

I can reproduce this with SNOMED-CT on macOS with hapi-fhir-cli 5.2.0

Edit: Also confirmed with Ubuntu 20.04.

I haven`t test with SNOMED-CT but I able to upload terminology with LOINC version 2.68 but not for version 2.69. Not sure if the current hapi-fhir-cli tool does not support latest version of LOINC.

MacL3an commented 2 years ago

I just ran into the same issue. Has anyone worked around it? Tried both LOINC and Snomed. It seems to work fine starting the server using the CLI, but not when starting it using this project.

joeflack4 commented 2 years ago

This issue is also mirrored here, where I provide much more detail, including the cause in my case, being Docker issues. More info: https://github.com/hapifhir/hapi-fhir/issues/3276

Another related issue: https://github.com/hapifhir/hapi-fhir-jpaserver-starter/issues/322

Related; this is also about LOINC, but a different error: https://github.com/hapifhir/hapi-fhir/issues/1629

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 730 days with no activity. Remove stale label or comment or this will be closed in 5 days.

joeflack4 commented 4 months ago

Read down from here: https://github.com/hapifhir/hapi-fhir/issues/3276#issuecomment-1249965048 In this other thread, the problem is described as seeming to have to do with a fixed file size limit, and someone suggests how to override that limit to fix the issue.

So I guess the issue is fixable, but at the very least, there should be a better error message for when this happens.