Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem loading Loinc_2.72 #511

Closed
FJGL opened this issue May 4, 2023 · 15 comments
Closed

Problem loading Loinc_2.72 #511

FJGL opened this issue May 4, 2023 · 15 comments
Assignees
Labels

Comments

@FJGL
Copy link

FJGL commented May 4, 2023

Hi.
We are in the process of testing this new feature of 8.1.0 of loading LOINC files using the hapi-fhir-cli
https://github.com/IHTSDO/snowstorm/blob/master/docs/using-the-fhir-api.md#loinc
The first import works, except for a few valuesets not found, but after that succesful upload, it fails on every next try to reload the same file with an elasticsearch exception:

SNOWSTORM: 8.1.0
ELASTICSEARCH: 7.17.10 (clean installation, same with 7.17.8)

FIRST UPLOAD

.\hapi-fhir-cli upload-terminology -d Loinc_2.72.zip -v r4 -t http://localhost:8888/snowstorm/fhir -u http://loinc.org
------------------------------------------------------------
?  HAPI FHIR 6.4.4 - Command Line Tool
------------------------------------------------------------
Process ID                      : 20352@ELITEDESK
Max configured JVM memory (Xmx) : 7.9GB
Detected Java version           : 16
------------------------------------------------------------
2023-05-04 12:13:14.16 [main] INFO  c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
2023-05-04 12:13:15.36 [main] INFO  c.u.f.c.UploadTerminologyCommand Reading C:\software\snowstorm\hapi-fhir-6.4.4-cli\Loinc_2.72.zip
2023-05-04 12:13:15.37 [main] INFO  c.u.f.c.UploadTerminologyCommand Adding ZIP file: Loinc_2.72.zip
2023-05-04 12:13:15.69 [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.
2023-05-04 12:13:15.78 [main] INFO  c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2023-05-04 12:43:40.28 [main] INFO  c.u.f.c.UploadTerminologyCommand Upload complete!
2023-05-04 12:43:40.31 [Thread-0] INFO  ca.uhn.fhir.cli.App HAPI FHIR is shutting down...

SECOND UPLOAD

.\hapi-fhir-cli upload-terminology -d Loinc_2.72.zip -v r4 -t http://localhost:8888/snowstorm/fhir -u http://loinc.org
------------------------------------------------------------
?  HAPI FHIR 6.4.4 - Command Line Tool
------------------------------------------------------------
Process ID                      : 1664@ELITEDESK
Max configured JVM memory (Xmx) : 7.9GB
Detected Java version           : 16
------------------------------------------------------------
2023-05-04 12:46:25.74 [main] INFO  c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
2023-05-04 12:46:26.89 [main] INFO  c.u.f.c.UploadTerminologyCommand Reading C:\software\snowstorm\hapi-fhir-6.4.4-cli\Loinc_2.72.zip
2023-05-04 12:46:26.89 [main] INFO  c.u.f.c.UploadTerminologyCommand Adding ZIP file: Loinc_2.72.zip
2023-05-04 12:46:27.22 [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.
2023-05-04 12:46:27.34 [main] INFO  c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2023-05-04 13:12:06.46 [main] ERROR c.u.f.c.UploadTerminologyCommand Received the following response:
{
  "resourceType": "OperationOutcome",
  "issue": [ {
    "severity": "error",
    "code": "processing",
    "diagnostics": "Failed to call access method: org.springframework.data.elasticsearch.UncategorizedElasticsearchException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]"
  } ]
}
2023-05-04 13:12:06.46 [main] ERROR ca.uhn.fhir.cli.App Error during execution:
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: HTTP 500 : Failed to call access method: org.springframework.data.elasticsearch.UncategorizedElasticsearchException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:310)
        at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:370)
        at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:541)
        at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1320)
        at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:230)
        at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:134)
        at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:266)
        at ca.uhn.fhir.cli.App.main(App.java:43)
2023-05-04 13:12:06.47 [Thread-0] INFO  ca.uhn.fhir.cli.App HAPI FHIR is shutting down...

The exception at client side all shards failed is a bit misleading, because the real error in the snowstorm spring.log seems that is supressed failed to create query: maxClauseCount is set to 1024:

....
2023-05-04 13:12:06.440  INFO 12416 --- [http-nio-8888-exec-5] c.u.fhir.jpa.term.LoadedFileDescriptors  : Deleting temporary files: XXXXX
...
2023-05-04 13:12:06.447 ERROR 12416 --- [http-nio-8888-exec-5] c.u.f.r.s.i.ExceptionHandlingInterceptor : Failure during REST processing
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method: org.springframework.data.elasticsearch.UncategorizedElasticsearchException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]
	at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:272)
	at ca.uhn.fhir.rest.server.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:332)
	at ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.doInvokeServer(BaseResourceReturningMethodBinding.java:326)
	at ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:434)
	at ca.uhn.fhir.rest.server.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:307)
	at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:1152)
	at ca.uhn.fhir.rest.server.RestfulServer.doPost(RestfulServer.java:423)
	at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1861)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.servlet.resource.ResourceUrlEncodingFilter.doFilter(ResourceUrlEncodingFilter.java:67)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at io.kaicode.rest.util.branchpathrewrite.BranchPathUriRewriteFilter.doFilter(BranchPathUriRewriteFilter.java:55)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:102)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: java.lang.reflect.InvocationTargetException: null
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:264)
	... 85 common frames omitted
Caused by: org.springframework.data.elasticsearch.UncategorizedElasticsearchException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]
	at org.springframework.data.elasticsearch.core.ElasticsearchExceptionTranslator.translateExceptionIfPossible(ElasticsearchExceptionTranslator.java:66)
	at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.translateException(ElasticsearchRestTemplate.java:367)
	at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:350)
	at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.search(ElasticsearchRestTemplate.java:261)
	at org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate.search(AbstractElasticsearchTemplate.java:446)
	at org.snomed.snowstorm.fhir.services.FHIRConceptService.findConcepts(FHIRConceptService.java:187)
	at org.snomed.snowstorm.fhir.services.FHIRValueSetService.expand(FHIRValueSetService.java:322)
	at org.snomed.snowstorm.fhir.services.FHIRValueSetService.createOrUpdateValueset(FHIRValueSetService.java:133)
	at org.snomed.snowstorm.fhir.services.FHIRValueSetService.saveAllValueSetsOfCodeSystemVersion(FHIRValueSetService.java:123)
	at org.snomed.snowstorm.fhir.services.FHIRTermCodeSystemStorage.storeNewCodeSystemVersion(FHIRTermCodeSystemStorage.java:73)
	at ca.uhn.fhir.jpa.term.TermLoaderSvcImpl.storeCodeSystem(TermLoaderSvcImpl.java:831)
	at ca.uhn.fhir.jpa.term.TermLoaderSvcImpl.processLoincFiles(TermLoaderSvcImpl.java:739)
	at ca.uhn.fhir.jpa.term.TermLoaderSvcImpl.loadLoinc(TermLoaderSvcImpl.java:284)
	at ca.uhn.fhir.jpa.provider.TerminologyUploaderProvider.uploadSnapshot(TerminologyUploaderProvider.java:141)
	at org.snomed.snowstorm.fhir.services.FHIRCodeSystemProvider.uploadExternalCodeSystem(FHIRCodeSystemProvider.java:387)
	... 90 common frames omitted
Caused by: org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]
	at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:187)
	at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1907)
	at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1884)
	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1641)
	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1598)
	at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1568)
	at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:1084)
	at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.lambda$search$10(ElasticsearchRestTemplate.java:261)
	at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:348)
	... 102 common frames omitted
	Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://192.168.0.26:9200], URI [/snomedct.fhir-concept/_search?typed_keys=true&max_concurrent_shard_requests=5&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&search_type=dfs_query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true], status line [HTTP/1.1 400 Bad Request]
Warnings: [[ignore_throttled] parameter is deprecated because frozen indices have been deprecated. Consider cold or frozen tiers in place of frozen indices.]

{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: maxClauseCount is set to 1024","index_uuid":"_GFHOzjCR-GZsqOvY_RbxQ","index":"snomedct.fhir-concept"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"snomedct.fhir-concept","node":"uwtWw0Z0Rwy0q1C2OwyAAw","reason":{"type":"query_shard_exception","reason":"failed to create query: maxClauseCount is set to 1024","index_uuid":"_GFHOzjCR-GZsqOvY_RbxQ","index":"snomedct.fhir-concept","caused_by":{"type":"too_many_clauses","reason":"maxClauseCount is set to 1024"}}}]},"status":400}
		at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:318)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:262)
		at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1628)
		... 107 common frames omitted
@kaicode kaicode self-assigned this May 10, 2023
@kaicode kaicode added the bug label May 10, 2023
@kaicode
Copy link
Member

kaicode commented May 10, 2023

Thank you for reporting this bug.

The errors in the first upload are caused by Snowstorm attempting to expand value sets as they are imported in an attempt to validate them. This does not always work well because some value sets refer to other nested value sets that are not yet imported. I intend to remove this validation so that the first import completes cleanly.

It looks like the error in the second upload may also be caused by an issue with that validation. I will look into this.

@FJGL
Copy link
Author

FJGL commented May 18, 2023

Hi.
Can you give us a timeframe of the version of Snowstorm that fixes this Loinc import?
No strings attached of course, It's just to plan the priorities of our development.

Thanks in advance.

@kaicode
Copy link
Member

kaicode commented May 18, 2023

This will not be fixed quickly. I estimate the end of July.

@kaicode
Copy link
Member

kaicode commented Jul 17, 2023

The tech team, who are in charge of the Snowstorm release schedule, plan to make a public release at the start of August and another at the end of September.
I raised a PR for this issue about a month ago but unfortunately it did not make the August release candidate that's just gone into testing. It should make it into the August release.

@FJGL how pressing are your timelines for this fix? Creating a fix release in the SnowstormX project could be a short term workaround.

@FJGL
Copy link
Author

FJGL commented Jul 25, 2023 via email

@FJGL
Copy link
Author

FJGL commented Sep 11, 2023

Hi.
Just to confirm that this bug is fixed in the public release at the end of September (any scheduled date?).

Thanks.

@kaicode
Copy link
Member

kaicode commented Sep 11, 2023

A Snowstorm version 9.0.0 release candidate has been created in the release-candidate branch including the LOINC package loading fixes. The release candidate will go through the usual testing and is scheduled to be deployed to our production environments on the 27th September. This release has breaking changes because it requires JDK 17 (Snowstorm previously required JDK 11).

You have the option of testing the release candidate directly by checking out the release-candidate branch and building the project. The fastest way is to build offline without tests: mvn -o clean package -Dmaven.test.skip=true.

@FJGL
Copy link
Author

FJGL commented Sep 21, 2023

We have built the release candidate 9.0.0 and it now successfully loads the Loinc_2.72 distribution without errors in the log the first or subsequent times, but it does not load the last version of LOINC 2.76.

2023-09-21 08:08:33.25 [main] ERROR c.u.f.c.UploadTerminologyCommand Received the following response:
{
"resourceType": "OperationOutcome",
"issue": [ {
"severity": "error",
"code": "processing",
"diagnostics": "HAPI-0862: Could not find the following mandatory files in input: [AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv]"
} ]
}
2023-09-21 08:08:33.26 [main] ERROR ca.uhn.fhir.cli.App Error during execution:
ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException: HTTP 422 : HAPI-0862: Could not find the following mandatory files in input: [AccessoryFiles/MultiAxialHierarchy/MultiAxialHierarchy.csv]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:310)
at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:370)
at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:541)
at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1320)
at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:230)
at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:134)
at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:266)
at ca.uhn.fhir.cli.App.main(App.java:43)
2023-09-21 08:08:33.26 [Thread-0] INFO ca.uhn.fhir.cli.App HAPI FHIR is shutting down...

We assume it's because of the comment in using-the-fhir-api.md: "N.B. The new filename since Loinc 2.73 doesn't work yet."

Any idea when versions of Loinc later than 2.72 can be used?

TIA

@FJGL
Copy link
Author

FJGL commented Sep 28, 2023

The release candidate will go through the usual testing and is scheduled to be deployed to our production environments on the 27th September.

Any news about the deployment?. Has everything gone well or will be necessary a bugfix 9.0.1 ?

Just to have an estimate of the release date of the Release Candidate.

Regards.

@kaicode
Copy link
Member

kaicode commented Nov 3, 2023

I have just published SnowstormX 9.0.1 with the fix for loading LOINC 2.73 and above.
https://github.com/IHTSDO/snowstorm-x/releases/tag/9.0.1

Please let us know if this works for you and we will get this change into a future Snowstorm release.

@FJGL
Copy link
Author

FJGL commented Nov 5, 2023

Hello.

Yes, it works! and we are very interested in having that change included in the next Snowstorm release.
( It would be nice to have an approximate date :) )

We have loaded Loinc versions 2.74 and 2.76 in a clean Elasticsearch installation without problems.

Just for the sake of completeness if we load version 2.72 there is an exception:

ERROR c.u.f.c.UploadTerminologyCommand Received the following response:
{
"resourceType": "OperationOutcome",
"issue": [ {
"severity": "error",
"code": "processing",
"diagnostics": "HAPI-0862: Could not find the following mandatory files in input: [AccessoryFiles/ComponentHierarchyBySystem/ComponentHierarchyBySystem.csv]"
} ]
}
Error during execution:
ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException: HTTP 422 : HAPI-0862: Could not find the following mandatory files in input: [AccessoryFiles/ComponentHierarchyBySystem/ComponentHierarchyBySystem.csv]
....

We understand that it is no longer compatible with Loinc versions < 2.73.

EDIT: But...

We have detected a problem because we need to perform the upload remotely and it fails with an exception related to the maximum size of a JSON request.

.\hapi-fhir-cli upload-terminology -s 1GB -d Loinc_2.76.zip -v r4 -t http://192.168.0.26:8888/snowstorm/fhir -u http://loinc.org
...

c.u.f.c.UploadTerminologyCommand Adding ZIP file: Loinc_2.76.zip
c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...

ERROR c.u.f.c.UploadTerminologyCommand Received the following response:
{
"resourceType": "OperationOutcome",
"issue": [ {
"severity": "error",
"code": "processing",
"diagnostics": "HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1861: Failed to parse JSON encoded FHIR content: String length (20046491) exceeds the maximum length (20000000)"
} ]
}

ERROR ca.uhn.fhir.cli.App Error during execution:
ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: HTTP 400 : HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1861: Failed to parse JSON encoded FHIR content: String length (20046491) exceeds the maximum length (20000000)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:310)
at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:370)
at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:541)
at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1320)
at ca.uhn.fhir.cli.UploadTerminologyCommand.invokeOperation(UploadTerminologyCommand.java:230)
at ca.uhn.fhir.cli.UploadTerminologyCommand.run(UploadTerminologyCommand.java:134)
at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:266)
at ca.uhn.fhir.cli.App.main(App.java:43)

@kaicode
Copy link
Member

kaicode commented Dec 18, 2023

@FJGL what version of the hapi-fhir-cli tool you are using?
I am using version 6.4.4 and it seems to upload without an issue. It looks like 6.10.0 is the latest on the homebrew package manager. Perhaps I would need to upgrade in order to reproduce the issue you are seeing?

This is my output:

$ hapi-fhir-cli upload-terminology -d Loinc_2.76.zip -v r4 -t http://localhost:8080/fhir -u http://loinc.org
------------------------------------------------------------
🔥  HAPI FHIR 6.4.4 - Command Line Tool
------------------------------------------------------------
Process ID                      : 68419@Kais-MacBook-Pro.local
Max configured JVM memory (Xmx) : 4.0GB
Detected Java version           : 19.0.2
------------------------------------------------------------
2023-12-18 17:52:03.79 [main] INFO  c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
2023-12-18 17:52:04.33 [main] INFO  c.u.f.c.UploadTerminologyCommand Reading /Users/kai/Downloads/Loinc_2.76.zip
2023-12-18 17:52:04.33 [main] INFO  c.u.f.c.UploadTerminologyCommand Adding ZIP file: Loinc_2.76.zip
2023-12-18 17:52:04.45 [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.
2023-12-18 17:52:04.51 [main] INFO  c.u.f.c.UploadTerminologyCommand Beginning upload - This may take a while...
2023-12-18 17:59:48.37 [main] INFO  c.u.f.c.UploadTerminologyCommand Upload complete!
2023-12-18 17:59:48.42 [Thread-0] INFO  ca.uhn.fhir.cli.App HAPI FHIR is shutting down...

@FJGL
Copy link
Author

FJGL commented Dec 21, 2023

@kaicode The version is just that:

  ------------------------------------------------------------
  ?  HAPI FHIR 6.4.4 - Command Line Tool
  ------------------------------------------------------------

"We have detected a problem because we need to perform the upload remotely and it fails with an exception related to the maximum size of a JSON request."

To reproduce the issue yo must try with a "remote" file:

.\hapi-fhir-cli upload-terminology -s 1GB -d Loinc_2.76.zip -v r4 -t http://192.168.0.26:8888/snowstorm/fhir -u http://loinc.org/

instead of a local reference:

hapi-fhir-cli upload-terminology -d Loinc_2.76.zip -v r4 -t http://localhost:8080/fhir -u http://loinc.org
(" 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.")

We have investigated the issue amd it seems that is a problem with the HAPI-FHIR version 6.6.2 included with snowstorm-x that is resolved with the 6.8.5 release or later,

hapifhir/hapi-fhir#5204

We have tested it successfully by rebuilding Snowstorm-X 9.0.1 with the HAPI-FHIR dependencies updated to 6.8.5. However, we are unsure of the impact of this on the rest of the FHIR functionality.

@kaicode
Copy link
Member

kaicode commented Jan 2, 2024

@FJGL thank you for debugging this and finding a fix that should work.
The upcoming Snowstorm version 10 uses HAPI version 6.9.6 or later. It sounds like this will resolve the upload issue.
@CoderMChu please could you let us know when Snowstorm 10 will be published as a public release?

@kaicode
Copy link
Member

kaicode commented Mar 28, 2024

This is fixed in Snowstorm version 10.2.1, released today:
https://github.com/IHTSDO/snowstorm/releases/tag/10.2.1

@kaicode kaicode closed this as completed Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants