Open stl-steve-moore opened 3 years ago
TL;DR
Preferred Fix:
docker run -p 3000:4567 infernocommunity/fhir-validator-service:latest
config.yml
to external_resource_validator_url: http://localhost:3000
Alternate Fix:
config.yml
to resource_validator: internal
More details on what's happening here... This is a gap in the documentation for running the service locally that probably came about when we changed how validation works by default. Let me try and explain what's going on here:
Inferno's FHIR resource validation capability is configurable. It can either use its internal validation capabilities or delegate validation to an external service. Here is the relevant part of the config:
The easiest option here would be to set resource_validator
to "internal"
and then running inferno. The external validator can handle doing more comprehensive validation and has features that help with test generation - which is why it is currently the new default.
In order to use the external validator you'll need to run an external FHIR validator service. This is what the dockerized version of inferno does and what the current config is set to (note the named container validator_service
):
The validation server is available on DockerHub and can be run with: docker run -p 3000:4567 infernocommunity/fhir-validator-service:latest
. You'll need to update the config appropriately too: external_resource_validator_url: http://localhost:3000
. I choose port 3000, but it can be any of your choosing.
You could also provide your own validator service that conforms to this API, but I wouldn't recommend that to start 😉 .
Refer to the TL;DR up top for the recommended fix.
It would be helpful for the repo to have the default configuration work when running locally. If not that, then having an error message that could hint us in the direction of the fix would be OK. Or even just having it in the readme to change the setting when running locally.
I ran into this problem last week and a colleague who had run this before was able to help me work around it by setting it to internal validation mode.
This might be pilot error. I want to be able to run the code directly and not in Docker. My end goal is to add new test cases.
I cloned the code repo and ran the commands as documented bundle install bundle exec rake db:create db:schema:load bundle exec rackup
It complains about not being able to reach http:validator_service:4567 (see below for more complete dump)
I assumed that service was to run on my localhost host, so I updated by /etc/hosts file to map validator_service to 127.0.0.1. I still have the same error. I tried on both the master and develop branches and had the same issue.
Environment: macOS Catalina (10.15.7)
Steve Moore moore.stephen.m@wustl.edu
INFO | Inferno | Checking that validator is available at http://validator_service:4567 ERROR | Inferno | Unable to reach validator at http://validator_service:4567 INFO | Inferno | Checking that validator is available at http://validator_service:4567 ERROR | Inferno | Unable to reach validator at http://validator_service:4567 ^CTraceback (most recent call last): 47: from /usr/local/opt/ruby/bin/bundle:23:in
<main>' 46: from /usr/local/opt/ruby/bin/bundle:23:in
load' 45: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:34:in<top (required)>' 44: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in
with_friendly_errors' 43: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:46:inblock in <top (required)>' 42: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in
start' 41: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:instart' 40: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in
dispatch' 39: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:indispatch' 38: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command' 37: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' 36: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in
exec' 35: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:inrun' 34: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in
kernel_load' 33: from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:inload' 32: from /usr/local/lib/ruby/gems/2.7.0/bin/rackup:23:in
<top (required)>' 31: from /usr/local/lib/ruby/gems/2.7.0/bin/rackup:23:inload' 30: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/bin/rackup:5:in
<top (