Stream: hapi
Topic: n00b question
Jose Costa Teixeira (May 20 2021 at 10:59):
Hi. I'm trying to run hapi on docker using this
docker run -p 8080:8080 -e hapi.fhir.default_encoding=json -v c:/temp/hapi:/configs -e "--spring.config.location=file:///configs/kl.yml" hapiproject/hapi:latest
but I get a
ERROR o.s.boot.SpringApplication [SpringApplication.java:858] Application run failed
java.lang.IllegalStateException: Attempted to load Config resource 'file [/configs/kl.yml]' via location 'file:///configs/kl.yml' but snakeyaml was not found on the classpath
Jose Costa Teixeira (May 20 2021 at 10:59):
Can someone advise on what I'm missing?
Jose Costa Teixeira (May 20 2021 at 11:00):
I'm on docker on win10. A colleague says it works on WSL
Julian Sass (May 20 2021 at 14:42):
I got the same error and parsed the application.yaml for errors. Seems like it's the indentation and an extra space in front of cors:
caused this. Removing the space got it running again for me.
cors:
allow_Credentials: true
Jens Villadsen (May 20 2021 at 15:28):
Please make an issue or PR
Jens Villadsen (May 20 2021 at 16:06):
Nevermind ... already fixed with https://github.com/hapifhir/hapi-fhir-jpaserver-starter/commit/28c91893757c75a7eb92d1d4973c86f49821a119
Jose Costa Teixeira (May 20 2021 at 22:46):
Thank you!
Jose Costa Teixeira (May 20 2021 at 22:47):
I really meant the noob part, though. since I am using a docker image I believe I am supposed to wait for this to be in the latest image, right? (I just downloaded the docker image again, the error seems to persist but I may be doing something wrong)
Richard Stanley (May 20 2021 at 22:49):
HAPI Docker images are not always predictably updated on Docker Hub. I would use tags (and generally one should use tagged images). Try hapiproject/hapi:v5.3.0
Jens Villadsen (May 21 2021 at 06:04):
The problem here was the supplied config - not the Docker image FYI
Sean McIlvenna (Jun 05 2021 at 22:03):
So... trying to use the docker v5.4.0 tag that was based on the 5.4.0 tag in GitHub of hapi-fhir-jpaserver-starter
. Running the docker image by itself with no custom config, I am getting the same error about snakeyaml. I checked out the 5.4.0 tag from github and fixed the indentation on the cors
element, rebuilt the image, and am still getting the same snakeyaml error. I have no idea how fixing the indentation on cors
fixed it for others...
Sean McIlvenna (Jun 05 2021 at 22:04):
Online posts seem to indicate that it is missing a dependency to snakeyaml, which makes sense to me given the error message being given. So, my next attempt is to add
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.28</version>
</dependency>
to the pom.xml
and re-build the image
Sean McIlvenna (Jun 05 2021 at 22:10):
That resolved the problem...
Sean McIlvenna (Jun 05 2021 at 22:10):
I could push the tag to docker hub... but I'm hesitant to push a docker tag that does not align with the github tag
Sean McIlvenna (Jun 05 2021 at 22:10):
@James Agnew any thoughts?
Sean McIlvenna (Jun 05 2021 at 22:11):
or @Jens Villadsen
Rob Hausam (Jun 05 2021 at 22:12):
I had to add the dependency to snakeyaml to make it work in my own fork.
Sean McIlvenna (Jun 05 2021 at 22:13):
I think maybe the better solution would be to update master
with a fix to the cors
tabbing and adding the snakeyaml dependency to pom.xml
, then re-tag 5.4.0 at the master HEAD in github, which would cause docker hub to re-build the v5.4.0 tag
Rob Hausam (Jun 05 2021 at 22:14):
Yeah, that might make sense.
Rob Hausam (Jun 05 2021 at 22:15):
Or does that need to be 5.4.1?
Sean McIlvenna (Jun 05 2021 at 22:50):
yah... not really sure
Sean McIlvenna (Jun 05 2021 at 22:51):
will leave that up to @James Agnew and or @Jens Villadsen
I have created a PR for the dependency and explained what my intention is here: https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/248
Just want them to agree/approve.
Jens Villadsen (Jun 06 2021 at 08:11):
@Sean McIlvenna snakeyaml was added with https://github.com/hapifhir/hapi-fhir-jpaserver-starter/commit/787a1b8d0f872e08c6e21c3aa139cc547564db5a (16 days ago) so it is already there
Jens Villadsen (Jun 06 2021 at 08:24):
I've answered your PR on github
Sean McIlvenna (Jun 06 2021 at 15:57):
So, what should we do about the 5.4.0 tag then @Jens Villadsen ? seems like 5.4.0 is broken/invalid
Sean McIlvenna (Jun 06 2021 at 15:57):
nm... reading the github PR comments. the answers are there
Sean McIlvenna (Jun 06 2021 at 15:59):
with one exception...
Sean McIlvenna (Jun 06 2021 at 16:00):
@Jens Villadsen , you say "feel free to publish a new docker image". those docker images are based on github tags. do you want me to delete and re-create the tag? or do you want me to create a new 5.4.1 tag?
Jens Villadsen (Jun 06 2021 at 16:01):
Wouldn't a new tag be the most proper thing to do?
Jens Villadsen (Jun 06 2021 at 16:02):
I mean that is the easiest thing to explain
Sean McIlvenna (Jun 07 2021 at 00:03):
Agreed. Done
Sean McIlvenna (Jun 07 2021 at 06:05):
Ok. There is now a 5.4.1 image on docker hub that includes these changes/fixes
Last updated: Apr 12 2022 at 19:14 UTC