Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

[WIP] added some hints for the troubleshooting; fixed sleep instructions #119

Merged
merged 9 commits into from
Sep 8, 2018

Conversation

stukalin
Copy link
Contributor

The goal is to start a brand new installation of the server and make it work which is apparently not the case now. At the same time it'd be nice to document issues and possible solutions.

@@ -1,7 +1,11 @@
#!/usr/bin/env bash
# It will generally take about 40 seconds for elasticsearch and couchdb to be ready to receive connections
echo 'Scheduling setup scripts to run in 40 seconds...'
sleep 40 && /usr/src/app/conf/initcouch.sh 2>&1 && /usr/src/app/utils/elasticsearch.sh couchadmin test 2>&1 &
sleep 40
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, for instance, they try to postpone the script execution, but it doesn't work. Without && it works as expected and really stops the script from the execution. I believe that was the expected behavior. Opinions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your change is correct. Can we remove the part where it runs the scripts the second time? Is it possible they just included the second one because the first one always failed because it wasn't actually waiting the 40 seconds like it was supposed to?

@MatthewDorner
Copy link
Contributor

I'm observing two new issues that popped up recently involving the main "hospitalrun" container.

  1. The hospitalrun container errors in app.js right after it prints "Loading raml proxy..." and it either gets stuck there forever or just shuts down. You can see the error in your container output if you change "apiConfig.log(e)" to "console.log(e)" (maybe should be changed to that permanently?) but basically it thinks the RAML definition you're giving it is invalid. This has something to do with the osprey dependency raml-1-parser. I used npm-shrinkwrap to force raml-1-parser back to 1.1.44 (from 3 months ago) and I don't get the error anymore.

  2. We are getting an error similar to this Cannot read property 'emit' of null in _http_client.js nodejs/node#20690, as reported by another user of hospitalrun-server here Error in Hospital Run Docker Container #117. I stopped getting this error when I changed the Dockerfile (in hospitalrun-server root directory) to base the image off node:10.9.0-slim instead of node:boron-slim.

Not sure what the ultimate fix should be for these, but after these changes server is working for me.

Copy link
Contributor

@MatthewDorner MatthewDorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the part where it runs the setup scripts the second time in entrypoint.sh.

@MatthewDorner
Copy link
Contributor

MatthewDorner commented Sep 2, 2018

Also the http -> https redirect isn't working. After you access the site on https (manually by typing "https://") for the first time, your browser will remember and use https automatically in the future, but the initial redirect coming from nginx isn't working. It is just redirecting to "https://"

edit: nvm, I think it's something wrong with my test setup and the config is actually fine

Fix list formatting.
Fix screenshot to show SSL_TYPE.
Fix screenshot to show default "auto" SSL_TYPE.
Remove '-d' so users will see their log output by default.
Add troubleshooting note for SSL configuration issues.
@MatthewDorner MatthewDorner merged commit dd4c4b9 into master Sep 8, 2018
@donaldwasserman
Copy link
Contributor

@stukalin @MatthewDorner I just got this up and running remotely on a digital ocean box running Ubuntu 16.04.5 LTS. It's working fine: https://hrbeta.modestventures.com/

The only issue is that it's not auto-redirecting from http->https

@MatthewDorner
Copy link
Contributor

MatthewDorner commented Sep 8, 2018

The redirect thing is weird. It redirects fine on my VM but not on my 1and1 VPS. It's the line in the nginx configs where it says "rewrite ^(.*)$ https://$host$request_uri" and when it's not working, it's because somehow both $host and $request_uri are blank. And those are nginx system variables so I don't know how it's blank.

@ghost
Copy link

ghost commented Oct 15, 2019

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@ghost ghost added the released label Oct 15, 2019
@ghost
Copy link

ghost commented Oct 15, 2019

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@ghost
Copy link

ghost commented Oct 20, 2019

🎉 This PR is included in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants