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

FHIR Pacage Cache is case-sensitive #2682

Closed
me-d4l opened this issue May 27, 2021 · 1 comment
Closed

FHIR Pacage Cache is case-sensitive #2682

me-d4l opened this issue May 27, 2021 · 1 comment

Comments

@me-d4l
Copy link
Contributor

me-d4l commented May 27, 2021

Describe the bug

As discussed in org.hl7.fhir.core issues #475, the FHIR validator was until recently treating package IDs as case-sensitive, leading to problems when packages declared dependencies with another capitalization. The proposed solutions is to always treat the IDs as lowercase (ignore casing). However, when a package is added to the JpaPackageCache, a case-sensitive package ID check is performed, leading to the issue described in the linked issues. Specifically, the check is in the method JpaPackageCache#addPackageToCache

To Reproduce
Steps to reproduce the behavior:

  1. Set up a HAPI JPA server using the JPA starter project
  2. Configure the server to load dependencies on start-up (as discussed in this Zulip thread
  3. Configure the server to load the de.gecco#1.0.3 FHIR package on start-up (in application.yaml)
  4. Start the server

The error occurs when loading one of the dependencies - log output will this:

2021-05-26 16:52:02.919 [main] INFO  c.u.f.jpa.packages.JpaPackageCache [JpaPackageCache.java:195] Parsing package .tar.gz (28612 bytes) from http://packages.fhir.org/kbv.basis/1.1.3
2021-05-26 16:52:02.948 [main] ERROR o.a.c.c.C.[Tomcat].[localhost].[/] [DirectJDKLog.java:175] Servlet.init() for servlet [jpaRestfulServer] threw exception
ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: Package ID KBV.Basis doesn't match expected: kbv.basis
    at ca.uhn.fhir.jpa.packages.JpaPackageCache.addPackageToCache(JpaPackageCache.java:199)
    at ca.uhn.fhir.jpa.packages.JpaPackageCache.loadPackage(JpaPackageCache.java:398)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy213.loadPackage(Unknown Source)
    at ca.uhn.fhir.jpa.packages.PackageInstallerSvcImpl.fetchAndInstallDependencies(PackageInstallerSvcImpl.java:265)
    at ca.uhn.fhir.jpa.packages.PackageInstallerSvcImpl.fetchAndInstallDependencies(PackageInstallerSvcImpl.java:268)

Expected behavior
The package should load without issues, regardless of casing.

Environment (please complete the following information):

  • HAPI FHIR Versios: Latest build
  • OS: iOS
patrick-werner added a commit that referenced this issue May 29, 2021
Make package ID handling case-insensitive (#2682)
@patrick-werner
Copy link
Member

patrick-werner commented May 29, 2021

fixed by #2683

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants