Stream: pascal
Topic: Running locally
Josh Mandel (Oct 23 2021 at 15:59):
When I run locally (mapping port 8080 on localhost into my docker container's port 80) I get a nice web page at http://localhost:8080/r4, but when I enter http://localhost:8080/r4/ValueSet I get a page showing:
302 Moved Temporarily
I don't see a Location header saying where it has moved to.
Jose Costa Teixeira (Oct 23 2021 at 16:18):
Just confirming I have the same issue, also on other endpoints
Jose Costa Teixeira (Oct 23 2021 at 17:20):
@Josh Mandel after creating the volume and container, I can run the application without downloading everythign again. However, when I need to change something (e.g. change the port, or use slightly different command line options, I don't know how to reuse the downloads. Can you help me?
Jose Costa Teixeira (Oct 23 2021 at 17:21):
Functionally, the other thing I'd like to be able to create my own config file in my host and then point to it. I don't know docker enough to do that
Josh Mandel (Oct 23 2021 at 17:59):
To be clear I'm not downloading eveirything again. The vocabularies are stable. It is the connections to packages.fhir.org that get repeated each time.
Grahame Grieve (Oct 23 2021 at 18:00):
are you sure that you get a 302 without a location header? the server isn't capable of issuing one without the other
Grahame Grieve (Oct 23 2021 at 18:00):
as for packages, the relevant documentation is:
Grahame Grieve (Oct 23 2021 at 18:01):
https://confluence.hl7.org/display/FHIR/FHIR+Package+Cache
Grahame Grieve (Oct 23 2021 at 18:01):
what you are seeing is a straight implementation of that
Grahame Grieve (Oct 23 2021 at 18:12):
looking at the code, I'm pretty sure that you're getting redirected to http://localhost:80/r4/ValueSet/
Jose Costa Teixeira (Oct 23 2021 at 20:17):
I'm using another port (960), but the result is the same:
image.png
Jose Costa Teixeira (Oct 23 2021 at 20:24):
(don't know if this helps)
Grahame Grieve (Oct 23 2021 at 20:25):
what happens if you request http://localhost:960/r4/ValueSet/
Jose Costa Teixeira (Oct 23 2021 at 20:27):
http://localhost:960/r4/ValueSet/ does the same as http://localhost:960/r4/ValueSet (if that is the question)
Jose Costa Teixeira (Oct 23 2021 at 20:28):
Grahame Grieve (Oct 23 2021 at 20:34):
well, I don't have a clue what's going on here. I can't imagine where the 302 is coming from, or why it would happen without a location header - I simply can't see how either are possible in the code
Grahame Grieve (Oct 23 2021 at 20:36):
can you see the console output from the server, or find the server log file?
Jose Costa Teixeira (Oct 23 2021 at 20:47):
(deleted)
Jose Costa Teixeira (Oct 23 2021 at 20:49):
i think it's in /tmp
Jose Costa Teixeira (Oct 23 2021 at 20:49):
It doesn't say much
Jose Costa Teixeira (Oct 23 2021 at 20:50):
19:21:15 00:08:57 HTTP Caching is On
19:21:15 00:08:57 Start thread Server Maintenance Thread
19:21:21 00:09:03 started (543secs)
20:14:44 6-1 15ms 0MB #1 1:0 200 p R4: ??
20:14:45 6-2 0ms 0MB #1 1:0 404 p XX: Not Found
20:14:45 6-3 1ms 0MB #1 1:0 302 p R4: ??
20:14:45 6-4 0ms 0MB #1 1:0 200 p WS: Static File /assets/ico/favicon.png
20:14:51 6-5 1ms 0MB #1 1:0 302 p R4: ??
20:14:54 6-6 1ms 0MB #1 1:0 302 p R4: ??
20:14:56 6-7 0ms 0MB #1 1:0 302 p R4: ??
20:15:03 6-8 1ms 0MB #1 1:0 302 p R4: ??
20:26:45 6-9 0ms 0MB #1 1:0 302 p R4: ??
20:26:56 6-10 1ms 0MB #1 1:0 302 p R4: ??
20:27:05 6-11 0ms 0MB #1 1:0 302 p R4: ??
20:27:11 6-12 0ms 0MB #1 1:0 302 p R4: ??
20:27:21 6-13 1ms 0MB #1 1:0 302 p R4: ??
20:27:53 6-14 1ms 0MB #1 1:0 302 p R4: ??
20:49:38 6-15 0ms 0MB #1 1:0 302 p R4: ??
20:49:43 6-16 0ms 0MB #1 1:0 302 p R4: ??
Grahame Grieve (Oct 23 2021 at 21:08):
no. there's nothing to go on there
Grahame Grieve (Oct 23 2021 at 21:11):
what's your config file?
Jose Costa Teixeira (Oct 23 2021 at 21:25):
the one online -https://storage.googleapis.com/tx-fhir-org/config.json
Grahame Grieve (Oct 23 2021 at 21:30):
none of this makes any sense. Neither the log nor the http response are possible
Grahame Grieve (Oct 23 2021 at 21:30):
you can't debug this?
Jose Costa Teixeira (Oct 23 2021 at 21:47):
no, I don't have a linux machine where i could try the ide, sorry
Jose Costa Teixeira (Oct 23 2021 at 21:47):
my linux box is just the docker container
Jose Costa Teixeira (Oct 23 2021 at 21:47):
Seems i really should get me a linux box, right?
Grahame Grieve (Oct 23 2021 at 21:55):
well, it works fine under linux. whatever you're seeing is something to do with docker or running under docker
Josh Mandel (Oct 23 2021 at 22:28):
If it helps you can try running "docker exec" to get a shell prompt running inside the same container as the server, just to try issuing some web requests from there and eliminate any variables
Jose Costa Teixeira (Oct 23 2021 at 22:31):
I'm re-downloading after re-building
Jose Costa Teixeira (Oct 23 2021 at 23:51):
Still same thing. versin is 1.9.396, which I presume is latest (because I think everything got rebuilt after I pulled from github)
Grahame Grieve (Oct 24 2021 at 01:02):
the log must be at least a little different
Jose Costa Teixeira (Oct 24 2021 at 07:54):
log now has the IP address
23:49:05 2-3 0ms 0MB #1 1:0 302 p 172.17.0.1 R4: ??
23:49:09 2-4 0ms 0MB #1 1:0 302 p 172.17.0.1 R4: ??
Jose Costa Teixeira (Oct 24 2021 at 07:54):
Meanwhile I'm going to use port 80 inside and outside docker, just to see if the port mapping may be causing any issue
Jose Costa Teixeira (Oct 24 2021 at 07:56):
I don't know how to further check this or what to look for. I'll see if I can get some proper linux machine
Josh Mandel (Oct 24 2021 at 13:34):
Even inside the docker container directly executing wget:
wget http://localhost:80/r4/ValueSet -O -
^[[5~--2021-10-24 13:33:43-- http://localhost/r4/ValueSet
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: unspecified
ERROR: Redirection (302) without location.
Jose Costa Teixeira (Oct 24 2021 at 19:32):
Do you know how to change the port from 80 to something else? I think it was in the fhirserver.ini , now i don't know if it's in the command line or ini or config.json
Jose Costa Teixeira (Oct 24 2021 at 19:32):
(just to run a test not on port 80 - shouldn't make a difference, but...)
Josh Mandel (Oct 24 2021 at 19:35):
You should be able to set the PORT
environment variable with -e PORT=1234
which causes an ini file to be created on startup via https://github.com/HealthIntersections/fhirserver/blob/master/Dockerfile#L35
Grahame Grieve (Oct 24 2021 at 19:44):
web.ini is documented here: https://confluence.hl7.org/display/FHIR/Running+your+own+copy+of+tx.fhir.org
Grahame Grieve (Oct 24 2021 at 20:07):
when I issue the query http://locallhost:962/r4 this is the response the server returns:
Grahame Grieve (Oct 24 2021 at 20:08):
HTTP/1.1 302 Moved Temporarily
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 54
Date: Sun, 24 Oct 2021 20:07:33 GMT
X-Request-Id: 28-7
Server: Health Intersections FHIR Server
Location: /r4/
<HTML><BODY><B>302 Moved Temporarily</B></BODY></HTML>
Grahame Grieve (Oct 24 2021 at 20:08):
to be clear: the server totally cannot return a 302 without a location header
Grahame Grieve (Oct 24 2021 at 20:09):
and the log will show:
Grahame Grieve (Oct 24 2021 at 20:09):
07:08:45 28-8 0ms 5454MB #1 1:0 302 p 127.0.0.1 R4: --> redirect to /r4/
Grahame Grieve (Oct 24 2021 at 20:17):
and when I issue a search on http://local.fhir.org:965/r4/ValueSet I get:
HTTP/1.1 200 OK
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Content-Length: 16404
Cache-control: public, max-age=600
Date: Sun, 24 Oct 2021 20:16:50 GMT
X-Request-Id: 29-4
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Location, Location
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE
X-GDPR-Disclosure: All access to this server is logged as AuditEvent Resources, and these store your ip address (and logged in user, if one exists). Also, your IP address is logged with Google Analytics for building geomaps of server usage. Your continued use of the API constitutes agreement to these terms. See [link] for erasure requests
Server: Health Intersections FHIR Server
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...
Although it depends on the accept: header exactly what comes back
Josh Mandel (Oct 24 2021 at 23:22):
I am connecting directly to the server and it is returning a response to my query... With a redirect status and no location header. I'm sure when we finally understand this, the explanation will fit all these clues :-)
Grahame Grieve (Oct 24 2021 at 23:23):
and what's in the log?
Grahame Grieve (Oct 24 2021 at 23:23):
the log should give me a clue as to where in the code to look, but the code is always this:
Grahame Grieve (Oct 24 2021 at 23:23):
response.Redirect(request.Document+'/');
Grahame Grieve (Oct 24 2021 at 23:25):
which points to:
ResponseNo := 302;
Location := AURL;
Josh Mandel (Oct 24 2021 at 23:25):
Good -- I will follow up with this information tonight
Josh Mandel (Oct 25 2021 at 02:12):
When I do this wget inside the docker container:
# wget --server-response http://localhost:80/r4/ValueSet
--2021-10-25 02:12:10-- http://localhost/r4/ValueSet
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 302 Moved Temporarily
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 54
Cache-control: no-cache, no-store, must-revalidate
Date: Mon, 25 Oct 2021 02:12:10 GMT
X-Request-Id: 4-4
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Location, Location
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE
Server: Health Intersections FHIR Server
Set-Cookie: fhir-session-idx=implicit-2099600; Path=/; Domain=localhost; Max-Age=3561; Expires=Mon, 25-Oct-2021 03:11:31 GMT
Location: unspecified
ERROR: Redirection (302) without location.
... I get this in the server stdout:
02:12:10 4-4 0ms 0MB #1 1:0 302 p 127.0.0.1 R4: ??
Josh Mandel (Oct 25 2021 at 02:13):
There is no Location
header in the http response.
Grahame Grieve (Oct 25 2021 at 05:21):
well, the problem was a compiler initialised variable that behaved differently on linux to windows
Jose Costa Teixeira (Oct 25 2021 at 10:46):
I confirm that it's working now
Jose Costa Teixeira (Oct 25 2021 at 14:21):
I see that gitbut is building the docker image. How can I get it ? what is the docker command line? if I do docker run grahamegrieve/fhirserver
it doesn't find it (unless I build it locally). Is this image in a container repository?
Josh Mandel (Oct 25 2021 at 15:26):
the CI build isn't currently pushing a built image anywhere, so you need to build locally.
Josh Mandel (Oct 25 2021 at 15:27):
We plan to add "push to container registry" to the deployment process at least for tagged release
Jose Costa Teixeira (Oct 25 2021 at 15:40):
(I hadn't seen your reply. Thanks @Josh Mandel )
Jose Costa Teixeira (Oct 25 2021 at 19:42):
I ran the windows build script, I get this in the toolkit2:
image.png
Grahame Grieve (Oct 25 2021 at 19:43):
on windows?
Jose Costa Teixeira (Oct 25 2021 at 19:43):
then this
Jose Costa Teixeira (Oct 25 2021 at 19:43):
Grahame Grieve (Oct 25 2021 at 19:43):
do you have the SSL dlls in your exec/64?
Jose Costa Teixeira (Oct 25 2021 at 19:43):
and the icons are gone.
Jose Costa Teixeira (Oct 25 2021 at 19:43):
Jose Costa Teixeira (Oct 25 2021 at 19:44):
Grahame Grieve said:
do you have the SSL dlls in your exec/64?
Yes, on windows. the dlls are not there
Jose Costa Teixeira (Oct 25 2021 at 19:44):
they are in exec\pack\w64
Grahame Grieve (Oct 25 2021 at 19:45):
the script doesn't do this and it should: copy files in exec\pack and exec\pack\w64 into exec\64
Jose Costa Teixeira (Oct 25 2021 at 19:47):
did that, still same issue
Jose Costa Teixeira (Oct 25 2021 at 19:48):
Grahame Grieve (Oct 25 2021 at 19:49):
but you didn't copy the ssl dlls...
Jose Costa Teixeira (Oct 25 2021 at 19:49):
no wait
Jose Costa Teixeira (Oct 25 2021 at 19:50):
Yes, sorry, whong DLLs
Jose Costa Teixeira (Oct 25 2021 at 19:50):
those are in build/tools
Jose Costa Teixeira (Oct 25 2021 at 19:51):
libeay32 and ssleay32.dll, right?
Jose Costa Teixeira (Oct 25 2021 at 19:52):
not right. libcrypto-1_1-x64 and libssl-1_1-x64 work.
Grahame Grieve (Oct 25 2021 at 19:58):
yes the lib* ones in exec/pack/w64
Jose Costa Teixeira (Oct 25 2021 at 20:00):
there's nothing in the scripts about those. Where do we get them from?
Jose Costa Teixeira (Oct 25 2021 at 20:01):
i mean, they are not in exec/pack/w64
Grahame Grieve (Oct 25 2021 at 20:02):
oh.
Grahame Grieve (Oct 25 2021 at 20:03):
added
Jose Costa Teixeira (Oct 25 2021 at 20:12):
I'm testing the updated bat script
Jose Costa Teixeira (Oct 25 2021 at 20:14):
what about the icons?
Jose Costa Teixeira (Oct 25 2021 at 20:14):
any idea how I can get them to show?
Grahame Grieve (Oct 25 2021 at 20:20):
I have no idea why they aren't showing. Are you still getting errors at start up?
Jose Costa Teixeira (Oct 25 2021 at 20:23):
let me see how it is after the full build
Jose Costa Teixeira (Oct 25 2021 at 20:26):
btw, can i remove the pauses in the windows-all script?
call windows-toolchain.bat %tmp%
pause
call windows-libraries.bat %tmp%
pause
call windows-fhirserver.bat %tmp%
pause
Grahame Grieve (Oct 25 2021 at 20:39):
yes
Grahame Grieve (Oct 25 2021 at 20:39):
they were there for me to check that the current directory was correct
Jose Costa Teixeira (Oct 26 2021 at 07:56):
Which one of these exec\64 do we want to use?
Jose Costa Teixeira (Oct 26 2021 at 07:56):
Jose Costa Teixeira (Oct 26 2021 at 07:57):
the script seems to be creating the files onto exec\64
Jose Costa Teixeira (Oct 26 2021 at 07:59):
i took the bit for copying the dlls from the .sh scripts and those are pointing to exec\64, but those scripts are running from the build folder, so they would try to find the files relative to that (where they don't exist)
Jose Costa Teixeira (Oct 26 2021 at 07:59):
I just ask to make sure that I can correct the bat files
Grahame Grieve (Oct 26 2021 at 10:34):
there's not supposed to be any files under /build
Grahame Grieve (Oct 26 2021 at 10:34):
the bat files assume they are being run from the /build directory, and they pay attention to directories already
Jose Costa Teixeira (Oct 26 2021 at 10:49):
Ok I added the missing ..\
Jose Costa Teixeira (Oct 26 2021 at 14:43):
https://github.com/HealthIntersections/fhirserver/tree/windows-build-scripts
Last updated: Apr 12 2022 at 19:14 UTC