I’ve been trying to install the CHT locally on an M1 MacBook Air using the CHT Local Environment Setup instructions and am getting a 404 when trying to navigate to https://localhost.
I’ve tried to follow all the debugging instructions in this post, though there was no clear resolution in that post. The outputs to everything I tried are below.
A few things I noticed:
- There were a few
error
/failed
lines right at the start of runningdocker-compose up
related torsyslog
andttyname
- When executing
docker exec -it medic-os head -n70 /srv/storage/medic-api/logs/medic-api.log
, I noticed this error that seemed significant:[2022-05-25 04:27:06] 2022-05-25 04:27:06 ERROR: Fatal error initialising medic-api
thought the/boot/supervisor-inspect
command said it wasup
Anything else I should try?
Software Versions
michaelkohn@Michaels-MacBook-Air cht % npm -v
8.5.5
michaelkohn@Michaels-MacBook-Air cht % node -v
v16.15.0
michaelkohn@Michaels-MacBook-Air cht % sudo docker-compose --version
Password:
Docker Compose version v2.5.1
michaelkohn@Michaels-MacBook-Air cht % sudo docker --version
Docker version 20.10.14, build a224086
docker-compose up
michaelkohn@Michaels-MacBook-Air cht % docker-compose up
[+] Running 2/0
⠿ Container haproxy Created 0.0s
⠿ Container medic-os Created 0.0s
Attaching to haproxy, medic-os
haproxy | Starting enhanced syslogd: rsyslogdrsyslogd: pidfile '/var/run/rsyslogd.pid' and pid 32 already exist.
haproxy | If you want to run multiple instances of rsyslog, you need to specify
haproxy | different pid files for them (-i option).
haproxy | rsyslogd: run failed with error -3000 (see rsyslog.h or try http://www.rsyslog.com/e/3000 to learn what that number means)
haproxy | already started.
medic-os | mesg: ttyname failed: Inappropriate ioctl for device
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: 172.19.0.3,502,GET,/medic/_changes?feed=longpoll&heartbeat=10000&since=52-g1AAAAFTeJzLYWBg4MhgTmEQTM4vTc5ISXIwNDLXMwBCwxygFFMiQ5L8____sxLZ8ChKUgCSSfZgdSz41DmA1MWD1THiU5cAUldP0N48FiDJ0ACkgErnZyXi8whE7QKI2v1ZiUwE1R6AqL2flchKUO0DiFqge0WyAHR-XsI&limit=25,api,medic-api,'-',204,-1,-,'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: 172.19.0.3,502,GET,/medic-sentinel/_changes?feed=longpoll&heartbeat=10000&since=1-g1AAAAFTeJzLYWBg4MhgTmEQTM4vTc5ISXIwNDLXMwBCwxygFFMiQ5L8____sxIZ8ChKUgCSSfaE1TmA1MUTVpcAUldPUF0eC5BkaABSQKXziVG7AKJ2f1YiI0G1ByBq7xNj7gOIWpB7swBe3F6P&limit=25,-,medic-api,'-',204,-1,-,'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: Stopping frontend http-in in 0 ms.
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: Stopping frontend http-in2 in 0 ms.
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: Stopping backend couch-backend in 0 ms.
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: Stopping backend couch-backend2 in 0 ms.
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: Proxy http-in stopped (FE: 901 conns, BE: 0 conns).
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: Proxy http-in2 stopped (FE: 8 conns, BE: 0 conns).
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: Proxy couch-backend stopped (FE: 0 conns, BE: 901 conns).
haproxy | May 25 04:28:06 3a2cc7896987 haproxy[60]: Proxy couch-backend2 stopped (FE: 0 conns, BE: 8 conns).
haproxy | tail: inotify cannot be used, reverting to polling: Function not implemented
haproxy | # Setting `log` here with the address of 127.0.0.1 will have the effect
haproxy | # of haproxy sending the udp log messages to its own rsyslog instance
haproxy | # (which sits at `127.0.0.1`) at the `local0` facility including all
haproxy | # logs that have a priority greater or equal to the specified log level
haproxy | # log 127.0.0.1 local0 warning
haproxy | global
haproxy | maxconn 4096
haproxy | lua-load /usr/local/etc/haproxy/parse_basic.lua
haproxy | lua-load /usr/local/etc/haproxy/parse_cookie.lua
haproxy | lua-load /usr/local/etc/haproxy/replace_password.lua
haproxy | log /dev/log len 65535 local2 info
haproxy |
haproxy | defaults
haproxy | mode http
haproxy | log global
haproxy | option dontlognull
haproxy | option http-ignore-probes
haproxy | timeout client 150000
haproxy | timeout server 3600000
haproxy | timeout connect 15000
haproxy | stats enable
haproxy | stats refresh 30s
haproxy | stats auth admin:password
haproxy | stats uri /haproxy?stats
haproxy |
haproxy | frontend http-in
haproxy | bind *:5984
haproxy | acl has_user req.hdr(x-medic-user) -m found
haproxy | acl has_cookie req.hdr(cookie) -m found
haproxy | acl has_basic_auth req.hdr(authorization) -m found
haproxy | declare capture request len 400000
haproxy | http-request set-header x-medic-user %[lua.parseBasic] if has_basic_auth
haproxy | http-request set-header x-medic-user %[lua.parseCookie] if !has_basic_auth !has_user has_cookie
haproxy | http-request capture req.body id 0 # capture.req.hdr(0)
haproxy | http-request capture req.hdr(x-medic-service) len 200 # capture.req.hdr(1)
haproxy | http-request capture req.hdr(x-medic-user) len 200 # capture.req.hdr(2)
haproxy | http-request capture req.hdr(user-agent) len 600 # capture.req.hdr(3)
haproxy | capture response header Content-Length len 10 # capture.res.hdr(0)
haproxy | log-format "%ci,%ST,%[capture.req.method],%[capture.req.uri],%[capture.req.hdr(1)],%[capture.req.hdr(2)],'%[capture.req.hdr(0),lua.replacePassword]',%B,%Tr,%[capture.res.hdr(0)],'%[capture.req.hdr(3)]'"
haproxy | default_backend couch-backend
haproxy |
haproxy | frontend http-in2
haproxy | bind *:5986
haproxy | default_backend couch-backend2
haproxy |
haproxy | backend couch-backend
haproxy | balance roundrobin
haproxy | server couchdb1 medic-os:5985
haproxy |
haproxy | backend couch-backend2
haproxy | balance roundrobin
haproxy | server couchdb1 medic-os:5987
haproxy | [alert] 144/134426 (1) : parseBasic loaded
haproxy | [alert] 144/134426 (1) : parseCookie loaded
haproxy | [alert] 144/134426 (1) : replacePassword loaded
haproxy | [ALERT] 144/134426 (1) : sendmsg logger #1 failed: No such file or directory (errno=2)
medic-os | [2022/05/25 13:44:26] Info: Setting up software...
medic-os | [2022/05/25 13:44:26] Info: Running setup task 'horticulturalist/sudoers'
medic-os | [2022/05/25 13:44:26] Info: Running setup task 'horticulturalist/users'
medic-os | [2022/05/25 13:44:27] Info: Setting up software (14% complete)...
medic-os | [2022/05/25 13:44:27] Info: Running setup task 'medic-api/link-logs'
medic-os | [2022/05/25 13:44:27] Info: Running setup task 'medic-api/logrotate'
medic-os | [2022/05/25 13:44:27] Info: Running setup task 'medic-api/users'
medic-os | [2022/05/25 13:44:27] Info: Setting up software (28% complete)...
medic-os | [2022/05/25 13:44:27] Info: Running setup task 'medic-core/ldconfig'
medic-os | [2022/05/25 13:44:27] Info: Running setup task 'medic-core/link-logs'
medic-os | [2022/05/25 13:44:28] Info: Running setup task 'medic-core/logrotate'
medic-os | [2022/05/25 13:44:28] Info: Running setup task 'medic-core/nginx'
medic-os | [2022/05/25 13:44:28] Info: Running setup task 'medic-core/nginx-ssl'
medic-os | [2022/05/25 13:44:28] Info: Running setup task 'medic-core/profile'
medic-os | [2022/05/25 13:44:28] Info: Running setup task 'medic-core/ssh-authorized-keys'
medic-os | [2022/05/25 13:44:28] Info: Running setup task 'medic-core/ssh-keygen'
medic-os | [2022/05/25 13:44:28] Info: Running setup task 'medic-core/usb-modeswitch'
medic-os | [2022/05/25 13:44:29] Info: Setting up software (42% complete)...
medic-os | [2022/05/25 13:44:29] Info: Running setup task 'medic-couch2pg/link-logs'
medic-os | [2022/05/25 13:44:29] Info: Running setup task 'medic-couch2pg/logrotate'
medic-os | [2022/05/25 13:44:29] Info: Setting up software (57% complete)...
medic-os | [2022/05/25 13:44:29] Info: Running setup task 'medic-rdbms/ldconfig'
medic-os | [2022/05/25 13:44:29] Info: Running setup task 'medic-rdbms/link-logs'
medic-os | [2022/05/25 13:44:30] Info: Running setup task 'medic-rdbms/reconfigure'
medic-os | [2022/05/25 13:44:30] Info: Setting up software (71% complete)...
medic-os | [2022/05/25 13:44:30] Info: Running setup task 'medic-sentinel/link-logs'
medic-os | [2022/05/25 13:44:31] Info: Running setup task 'medic-sentinel/logrotate'
medic-os | [2022/05/25 13:44:31] Info: Running setup task 'medic-sentinel/users'
medic-os | [2022/05/25 13:44:31] Info: Setting up software (85% complete)...
medic-os | [2022/05/25 13:44:31] Info: Running setup task 'system-services/home-directories'
medic-os | [2022/05/25 13:44:31] Info: Running setup task 'system-services/link-logs'
medic-os | [2022/05/25 13:44:31] Info: Running setup task 'system-services/logrotate'
medic-os | [2022/05/25 13:44:31] Info: Setting up software (100% complete)...
medic-os | [2022/05/25 13:44:31] Info: Starting services...
medic-os | [2022/05/25 13:44:32] Info: Service 'horticulturalist/horticulturalist' started successfully
medic-os | [2022/05/25 13:44:32] Info: Horticulturalist has already bootstrapped
medic-os | [2022/05/25 13:44:32] Info: Service 'medic-api/medic-api' started successfully
medic-os | [2022/05/25 13:44:32] Info: Service 'medic-core/couchdb' started successfully
medic-os | [2022/05/25 13:44:33] Info: CouchDB is already configured
medic-os | [2022/05/25 13:44:33] Info: Service 'medic-core/nginx' started successfully
medic-os | [2022/05/25 13:44:33] Info: Service 'medic-core/openssh' started successfully
medic-os | [2022/05/25 13:44:34] Info: Service 'medic-couch2pg/medic-couch2pg' started successfully
medic-os | [2022/05/25 13:44:34] Info: Service 'medic-rdbms/postgresql' started successfully
medic-os | [2022/05/25 13:44:35] Info: Service 'medic-sentinel/medic-sentinel' started successfully
medic-os | [2022/05/25 13:44:36] Info: Service 'system-services/cron' started successfully
medic-os | [2022/05/25 13:44:36] Info: Service 'system-services/syslog' started successfully
medic-os | [2022/05/25 13:44:36] Info: Synchronizing disks...
medic-os | [2022/05/25 13:44:46] Info: System started successfully
medic-os | [2022/05/25 13:44:46] Info: Starting log streaming
docker ps -a
michaelkohn@Michaels-MacBook-Air ~ % docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e1c7a030fde0 medicmobile/medic-os:cht-3.9.0-rc.2 "/bin/bash -l /boot/…" 9 hours ago Up 4 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp medic-os
3a2cc7896987 medicmobile/haproxy:rc-1.17 "/entrypoint.sh -f /…" 9 hours ago Up 4 minutes haproxy
1397f392c44e hello-world "/hello" 10 hours ago Exited (0) 10 hours ago
curl -I http://localhost
michaelkohn@Michaels-MacBook-Air cht % curl -I http://localhost
HTTP/1.1 301 Moved Permanently
Server: nginx/1.13.6
Date: Wed, 25 May 2022 13:56:46 GMT
Content-Type: text/html
Content-Length: 185
Connection: keep-alive
Location: https://localhost/
michaelkohn@Michaels-MacBook-Air cht % curl -kI https://localhost/
HTTP/1.1 404 Not Found
Server: nginx/1.13.6
Date: Wed, 25 May 2022 13:56:53 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive
Vary: Accept-Encoding
curl -k https://admin:pass@localhost/api/v1/monitoring
michaelkohn@Michaels-MacBook-Air cht % curl -k https://admin:pass@localhost/api/v1/monitoring
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.13.6</center>
</body>
</html>
michaelkohn@Michaels-MacBook-Air cht % docker exec -it e1c7a030fde0 sh
sh-4.3# curl -k https://admin:pass@localhost/api/v1/monitoring
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.13.6</center>
</body>
</html>
sh-4.3#
docker exec -it medic-os /boot/supervisor-inspect
michaelkohn@Michaels-MacBook-Air ~ % docker exec -it medic-os /boot/supervisor-inspect
Package 'horticulturalist':
Service 'horticulturalist':
Status: Up
Up: 1215 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 1018, Supervisor PID: 979
Package 'medic-api':
Service 'medic-api':
Status: Up
Up: 7 seconds, Restarts: 129
Attributes: watched, running, expected
Service PID: 30657, Supervisor PID: 1104
Package 'medic-core':
Service 'couchdb':
Status: Up
Up: 1216 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 1284, Supervisor PID: 1241
Service 'nginx':
Status: Up
Up: 1216 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 1411, Supervisor PID: 1373
Service 'openssh':
Status: Up
Up: 1217 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 1561, Supervisor PID: 1518
Package 'medic-couch2pg':
Service 'medic-couch2pg':
Status: Failure
Up: 4 seconds, Restarts: 286
Attributes: watched, expected
Service PID: None, Supervisor PID: 1641
Package 'medic-rdbms':
Service 'postgresql':
Status: Up
Up: 1218 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 1816, Supervisor PID: 1757
Package 'medic-sentinel':
Service 'medic-sentinel':
Status: Up
Up: 1217 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 1949, Supervisor PID: 1904
Package 'system-services':
Service 'cron':
Status: Up
Up: 1217 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 2075, Supervisor PID: 2028
Service 'syslog':
Status: Up
Up: 1218 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 2174, Supervisor PID: 2134
michaelkohn@Michaels-MacBook-Air ~ %
docker exec -it medic-os head -n70 /srv/storage/medic-api/logs/medic-api.log
michaelkohn@Michaels-MacBook-Air ~ % docker exec -it medic-os head -n70 /srv/storage/medic-api/logs/medic-api.log
[2022-05-25 04:26:59] Node Environment Options: '--max_old_space_size=8192'
[2022-05-25 04:26:59] Node Version: 8.11.4 in production mode
[2022-05-25 04:26:59] COUCH_URL http://medic-api:a63351283c5b70d4@haproxy:5984/medic
[2022-05-25 04:26:59] COUCH_NODE_NAME couchdb@127.0.0.1
[2022-05-25 04:27:00] CouchDB Version: 2.3.1
[2022-05-25 04:27:02] 2022-05-25 04:27:02 INFO: Extracting ddoc…
[2022-05-25 04:27:02] 2022-05-25 04:27:02 INFO: Updating docs: _design/sentinel
[2022-05-25 04:27:02] 2022-05-25 04:27:02 INFO: Updating docs: _design/users-meta
[2022-05-25 04:27:04] 2022-05-25 04:27:04 INFO: Updating docs: _design/medic-client
[2022-05-25 04:27:04] 2022-05-25 04:27:04 INFO: Updating service worker meta doc
[2022-05-25 04:27:04] 2022-05-25 04:27:04 INFO: DDoc extraction completed successfully
[2022-05-25 04:27:04] 2022-05-25 04:27:04 INFO: Extracting resources…
[2022-05-25 04:27:04] 2022-05-25 04:27:04 INFO: Extracting resources completed successfully
[2022-05-25 04:27:04] 2022-05-25 04:27:04 INFO: Extracting initial documents…
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Updating settings with new defaults
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Extracting initial documents completed successfully
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Loading configuration…
[2022-05-25 04:27:05] 2022-05-25 04:27:05 ERROR: Error loading translations - starting up anyway: { error: 'not_found',
[2022-05-25 04:27:05] reason: 'missing',
[2022-05-25 04:27:05] status: 404,
[2022-05-25 04:27:05] name: 'not_found',
[2022-05-25 04:27:05] message: 'missing' }
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Not updating settings - the existing settings are already up to date
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "update_clinics"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "self_report"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "registration"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "accept_patient_reports"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "accept_case_reports"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "generate_shortcode_on_contacts"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Loading transition "generate_patient_id_on_people"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Skipping asynchronous transition "generate_patient_id_on_people"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "default_responses"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "update_sent_by"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "update_sent_forms"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Loading transition "death_reporting"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "conditional_alerts"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "multi_report_alerts"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "update_notifications"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "update_scheduled_reports"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "resolve_pending"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "muting"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 WARN: Disabled transition "mark_for_outbound"
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Configuration loaded successfully
[2022-05-25 04:27:05] 2022-05-25 04:27:05 INFO: Merging translations…
[2022-05-25 04:27:06] 2022-05-25 04:27:06 ERROR: Fatal error initialising medic-api
[2022-05-25 04:27:06] 2022-05-25 04:27:06 ERROR: { error: 'not_found',
[2022-05-25 04:27:06] reason: 'missing',
[2022-05-25 04:27:06] status: 404,
[2022-05-25 04:27:06] name: 'not_found',
[2022-05-25 04:27:06] message: 'missing' }
[2022-05-25 04:27:10] Node Environment Options: '--max_old_space_size=8192'
[2022-05-25 04:27:10] Node Version: 8.11.4 in production mode
[2022-05-25 04:27:10] COUCH_URL http://medic-api:a63351283c5b70d4@haproxy:5984/medic
[2022-05-25 04:27:10] COUCH_NODE_NAME couchdb@127.0.0.1
[2022-05-25 04:27:10] CouchDB Version: 2.3.1
[2022-05-25 04:27:12] 2022-05-25 04:27:12 INFO: Extracting ddoc…
[2022-05-25 04:27:14] 2022-05-25 04:27:14 INFO: Updating docs: _design/medic-client
[2022-05-25 04:27:14] 2022-05-25 04:27:14 INFO: DDoc extraction completed successfully
[2022-05-25 04:27:14] 2022-05-25 04:27:14 INFO: Extracting resources…
[2022-05-25 04:27:14] 2022-05-25 04:27:14 INFO: Extracting resources completed successfully
[2022-05-25 04:27:14] 2022-05-25 04:27:14 INFO: Extracting initial documents…
[2022-05-25 04:27:14] 2022-05-25 04:27:14 INFO: Extracting initial documents completed successfully
[2022-05-25 04:27:14] 2022-05-25 04:27:14 INFO: Loading configuration…
[2022-05-25 04:27:14] 2022-05-25 04:27:14 ERROR: Error loading translations - starting up anyway: { error: 'not_found',
[2022-05-25 04:27:14] reason: 'missing',
[2022-05-25 04:27:14] status: 404,
[2022-05-25 04:27:14] name: 'not_found',
[2022-05-25 04:27:14] message: 'missing' }
[2022-05-25 04:27:14] 2022-05-25 04:27:14 INFO: Not updating settings - the existing settings are already up to date
[2022-05-25 04:27:14] 2022-05-25 04:27:14 WARN: Disabled transition "update_clinics"
michaelkohn@Michaels-MacBook-Air ~ %
sudo lsof -iTCP -sTCP:LISTEN -n -P | grep
michaelkohn@Michaels-MacBook-Air ~ % sudo lsof -iTCP -sTCP:LISTEN -n -P | grep ':<port>'
michaelkohn@Michaels-MacBook-Air ~ %