I followed the steps building hr-server on VPS using docker-compose but it fails all the time.
here are the logs for each container:
# hospitalrun:
hospitalrun | > [email protected] start /usr/src/app hospitalrun | > node app.js hospitalrun | hospitalrun | Loading raml proxy - this may take a while... hospitalrun | Error getting configurations to update { Error: Name or password is incorrect. hospitalrun | at Request._callback (/usr/src/app/node_modules/nano/lib/nano.js:248:15) hospitalrun | at Request.self.callback (/usr/src/app/node_modules/nano/node_modules/request/request.js:186:22) hospitalrun | at emitTwo (events.js:106:13) hospitalrun | at Request.emit (events.js:191:7) hospitalrun | at Request.<anonymous> (/usr/src/app/node_modules/nano/node_modules/request/request.js:1163:10) hospitalrun | at emitOne (events.js:96:13) hospitalrun | at Request.emit (events.js:188:7) hospitalrun | at IncomingMessage.<anonymous> (/usr/src/app/node_modules/nano/node_modules/request/request.js:1085:12) hospitalrun | at IncomingMessage.g (events.js:292:16) hospitalrun | name: 'Error', hospitalrun | error: 'unauthorized', hospitalrun | reason: 'Name or password is incorrect.', hospitalrun | scope: 'couch', hospitalrun | statusCode: 401, hospitalrun | request: hospitalrun | { method: 'POST', hospitalrun | headers: hospitalrun | { 'content-type': 'application/json', hospitalrun | accept: 'application/json' }, hospitalrun | uri: 'http://XXXXXX:XXXXXX@couchdb:5984/config/_all_docs', hospitalrun | qs: { include_docs: true }, hospitalrun | body: '{"keys":["config_disable_offline_sync","config_use_google_auth","config_log_metrics","config_external_search","config_push_public_key"]}' }, hospitalrun | headers: hospitalrun | { date: 'Tue, 23 Jan 2018 15:14:23 GMT', hospitalrun | 'content-type': 'application/json', hospitalrun | 'cache-control': 'must-revalidate', hospitalrun | statusCode: 401, hospitalrun | uri: 'http://XXXXXX:XXXXXX@couchdb:5984/config/_all_docs' }, hospitalrun | errid: 'non_200', hospitalrun | description: 'couch returned 401' } hospitalrun | Error creating push database! { Error: Name or password is incorrect. hospitalrun | at Request._callback (/usr/src/app/node_modules/nano/lib/nano.js:248:15) hospitalrun | at Request.self.callback (/usr/src/app/node_modules/nano/node_modules/request/request.js:186:22) hospitalrun | at emitTwo (events.js:106:13) hospitalrun | at Request.emit (events.js:191:7) hospitalrun | at Request.<anonymous> (/usr/src/app/node_modules/nano/node_modules/request/request.js:1163:10) hospitalrun | at emitOne (events.js:96:13) hospitalrun | at Request.emit (events.js:188:7) hospitalrun | at IncomingMessage.<anonymous> (/usr/src/app/node_modules/nano/node_modules/request/request.js:1085:12) hospitalrun | at IncomingMessage.g (events.js:292:16) hospitalrun | name: 'Error', hospitalrun | error: 'unauthorized', hospitalrun | reason: 'Name or password is incorrect.', hospitalrun | scope: 'couch', hospitalrun | statusCode: 401, hospitalrun | request: hospitalrun | { method: 'PUT', hospitalrun | headers: hospitalrun | { 'content-type': 'application/json', hospitalrun | accept: 'application/json' }, hospitalrun | uri: 'http://XXXXXX:XXXXXX@couchdb:5984/pushinfo' }, hospitalrun | headers: hospitalrun | { date: 'Tue, 23 Jan 2018 15:14:23 GMT', hospitalrun | 'content-type': 'application/json', hospitalrun | 'cache-control': 'must-revalidate', hospitalrun | statusCode: 401, hospitalrun | uri: 'http://XXXXXX:XXXXXX@couchdb:5984/pushinfo' }, hospitalrun | errid: 'non_200', hospitalrun | description: 'couch returned 401' }
# couchdb
couchdb | Apache CouchDB 1.7.1 (LogLevel=info) is starting. couchdb | Apache CouchDB has started. Time to relax. couchdb | [info] [<0.32.0>] Apache CouchDB has started on http://0.0.0.0:5984/ couchdb | [info] [<0.109.0>] 172.18.0.5 - - GET /_users 401 couchdb | [info] [<0.108.0>] 172.18.0.5 - - GET /main 401 couchdb | [info] [<0.107.0>] 172.18.0.5 - - GET /pushinfo 401 couchdb | [info] [<0.106.0>] 172.18.0.5 - - POST /config/_all_docs?include_docs=true 401 couchdb | [info] [<0.110.0>] 172.18.0.5 - - PUT /pushinfo 401 couchdb | [info] [<0.121.0>] 172.18.0.5 - - PUT /_config/admins/couchadmin 200 couchdb | [info] [<0.120.0>] 172.18.0.5 - - PUT /_users/_security 200 couchdb | [error] [<0.192.0>] Could not open file /usr/local/var/lib/couchdb/config.couch: file already exists couchdb | [info] [<0.160.0>] 172.18.0.5 - - PUT /config 412 couchdb | [info] [<0.158.0>] 172.18.0.5 - - PUT /config/_security 200 couchdb | [info] [<0.157.0>] 172.18.0.5 - - PUT /config/_design/auth 409 couchdb | [error] [<0.206.0>] Could not open file /usr/local/var/lib/couchdb/main.couch: file already exists couchdb | [info] [<0.159.0>] 172.18.0.5 - - PUT /main 412 couchdb | [info] [<0.163.0>] 172.18.0.5 - - PUT /main/_security 200 couchdb | [info] [<0.186.0>] 172.18.0.5 - - PUT /main/_design/auth 409 couchdb | [info] [<0.190.0>] 172.18.0.5 - - PUT /_config/http/authentication_handlers 200 couchdb | [info] [<0.111.0>] 172.18.0.5 - - PUT /_config/couch_httpd_oauth/use_users_db 200 couchdb | [info] [<0.112.0>] 172.18.0.5 - - PUT /_users/org.couchdb.user:hradmin 409 couchdb | [info] [<0.113.0>] 172.18.0.5 - - PUT /main/fhir_audit 409 couchdb | [info] [<0.114.0>] 172.18.0.4 - - GET /main/_changes?feed=continuous&include_docs=true&since=3&heartbeat=1000 200
# elasticsearch
elasticsearch | [2018-01-23T15:10:20,004][INFO ][o.e.n.Node ] [] initializing ... elasticsearch | [2018-01-23T15:10:20,069][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] elasticsearch | org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to created node environment elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:58) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | Caused by: java.lang.IllegalStateException: Failed to created node environment elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | ... 6 more elasticsearch | Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes elasticsearch | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?] elasticsearch | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?] elasticsearch | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?] elasticsearch | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?] elasticsearch | at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_121] elasticsearch | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_121] elasticsearch | at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_121] elasticsearch | at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:221) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:262) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | ... 6 more elasticsearch | [2018-01-23T15:14:18,423][INFO ][o.e.n.Node ] [] initializing ... elasticsearch | [2018-01-23T15:14:18,581][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] elasticsearch | org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to created node environment elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:58) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | Caused by: java.lang.IllegalStateException: Failed to created node environment elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:265) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | ... 6 more elasticsearch | Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes elasticsearch | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?] elasticsearch | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?] elasticsearch | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?] elasticsearch | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?] elasticsearch | at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_121] elasticsearch | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_121] elasticsearch | at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_121] elasticsearch | at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:221) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:262) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.node.Node.<init>(Node.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] elasticsearch | ... 6 more elasticsearch exited with code 1
# nginx
nginx_1 | Bootstrapping dependencies for Debian-based OSes... nginx_1 | Hit http://security.debian.org jessie/updates InRelease nginx_1 | Hit http://nginx.org jessie InRelease nginx_1 | Ign http://deb.debian.org jessie InRelease nginx_1 | Get:1 http://security.debian.org jessie/updates/main amd64 Packages [607 kB] nginx_1 | Hit http://deb.debian.org jessie-updates InRelease nginx_1 | Hit http://deb.debian.org jessie Release.gpg nginx_1 | Get:2 http://nginx.org jessie/nginx amd64 Packages [38.6 kB] nginx_1 | Hit http://deb.debian.org jessie Release nginx_1 | Get:3 http://deb.debian.org jessie-updates/main amd64 Packages [23.1 kB] nginx_1 | Get:4 http://deb.debian.org jessie/main amd64 Packages [9064 kB] nginx_1 | Fetched 9733 kB in 26s (372 kB/s) nginx_1 | Reading package lists... nginx_1 | Reading package lists... nginx_1 | Building dependency tree... nginx_1 | Reading state information... nginx_1 | augeas-lenses is already the newest version. nginx_1 | libaugeas0 is already the newest version. nginx_1 | ca-certificates is already the newest version. nginx_1 | gcc is already the newest version. nginx_1 | libffi-dev is already the newest version. nginx_1 | libssl-dev is already the newest version. nginx_1 | openssl is already the newest version. nginx_1 | openssl set to manually installed. nginx_1 | python is already the newest version. nginx_1 | python-dev is already the newest version. nginx_1 | python-virtualenv is already the newest version. nginx_1 | virtualenv is already the newest version. nginx_1 | 0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded. nginx_1 | Upgrading certbot-auto 0.12.0 to 0.21.0... nginx_1 | Replacing certbot-auto... nginx_1 | Creating virtual environment... nginx_1 | Installing Python packages... nginx_1 | Installation succeeded. nginx_1 | Saving debug log to /var/log/letsencrypt/letsencrypt.log nginx_1 | Plugins selected: Authenticator standalone, Installer None nginx_1 | Obtaining a new certificate nginx_1 | Performing the following challenges: nginx_1 | http-01 challenge for rek.devagnos.cloud nginx_1 | Cleaning up challenges nginx_1 | Problem binding to port 80: Could not bind to IPv4 or IPv6. nginx_1 | Saving debug log to /var/log/letsencrypt/letsencrypt.log nginx_1 | Plugins selected: Authenticator standalone, Installer None nginx_1 | Obtaining a new certificate nginx_1 | Performing the following challenges: nginx_1 | http-01 challenge for rek.devagnos.cloud nginx_1 | Cleaning up challenges nginx_1 | Problem binding to port 80: Could not bind to IPv4 or IPv6.
# logstash
logstash | [2018-01-23T15:18:21,752][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x70a2aa4 URL:http://elastic:xxxxxx@elasticsearch:9200/>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"} logstash | [2018-01-23T15:18:21,752][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x3a19e6f5 URL:http://elastic:xxxxxx@elasticsearch:9200/>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"} logstash | [2018-01-23T15:18:24,644][WARN ][logstash.outputs.elasticsearch] UNEXPECTED POOL ERROR {:e=>#<LogStash::Outputs::ElasticSearch::HttpClient::Pool::NoConnectionAvailableError: No Available connections>} logstash | [2018-01-23T15:18:24,650][ERROR][logstash.outputs.elasticsearch] Attempted to send a bulk request to elasticsearch, but no there are no living connections in the connection pool. Perhaps Elasticsearch is unreachable or down? {:error_message=>"No Available connections", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::NoConnectionAvailableError", :will_retry_in_seconds=>64} logstash | [2018-01-23T15:18:26,746][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@elasticsearch:9200/, :path=>"/"} logstash | [2018-01-23T15:18:26,757][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@elasticsearch:9200/, :path=>"/"} logstash | [2018-01-23T15:18:26,758][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://elastic:xxxxxx@elasticsearch:9200/, :path=>"/"} logstash | [2018-01-23T15:18:26,825][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x46987b25 URL:http://elastic:xxxxxx@elasticsearch:9200/>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"} logstash | [2018-01-23T15:18:26,836][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x6ecfff3a URL:http://elastic:xxxxxx@elasticsearch:9200/_xpack/monitoring/?system_id=logstash&system_api_version=2&interval=1s>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"} logstash | [2018-01-23T15:18:26,832][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>#<URI::HTTP:0x1127968d URL:http://elastic:xxxxxx@elasticsearch:9200/>, :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elastic:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch: Name or service not known"}
docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------
couchdb tini -- /docker-entrypoint ... Up 0.0.0.0:5985->5984/tcp
elasticsearch /bin/bash bin/es-docker Exit 1
hospitalrun /bin/sh -c ./entrypoint.sh Up 3000/tcp
logstash /usr/local/bin/docker-entr ... Up 5044/tcp, 9600/tcp
server_nginx_1 /bin/sh -c /etc/nginx/entr ... Up 0.0.0.0:443->443/tcp, 0.0.0.0:8055->80/tcp```