Issues with local install

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 running docker-compose up related to rsyslog and ttyname
  • 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 was up

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 ~ % 

Docker Desktop

1 Like

This is an awesomely detailed write up of your problem - thank you @michael!!

Unfortunately, we have not had success running the medic-os container in Docker on the Apple M1 CPUs. I believe the hope is that when we move to CHT Core 4.0.0, which will have discrete containers for each service, that we’ll be closer to working on the M1.

Until then,I believe @Elvis and @yuv both have M1s and may have some tips on running dev instaces? They can confirm, but I believe they’re both running the more involved developer set up vs your local setup.

Looking a bit at the issue, I believe the primary one is visible in your last screenshot with the note:

Images may have poor performance, or fail, if run via emulation

This is because of Docker container being from a amd64 image vs a native ARM one. There does seem to be some tricks we might be able to do support this maybe? Not having an M1 to test with myself, I can’t test any work-arounds.

Finally, as you noted noted that your call to supervisor-inspect showed that most services were up for ~1200 seconds and had zero restarts:

Up: 1216 seconds, Restarts: 0

But while the API service is up, it had been up for only 7 seconds and had dozens of restarts:

Up: 7 seconds, Restarts: 129

I don’t think it’s really up :frowning:

Hi I am curious if any solution has been found. I am also getting 404 error in M1 MacBook Pro.

Was any solution found for this issue for version 3. I am facing the same issue on the same operating system: M1 MacBook Air

Hi @sookwalinga,

If you could upgrade to CHT version 4, could you please try CHT Docker Helper for CHT 4? Please note that Docker Helper for CHT 3 does not work on M1s/Apple Silicon.
cc @mrjones @Esther_Moturi @michael

1 Like

Hey @sookwalinga , you can also explore horti if you want to work on version 3 with M1. Here are the requirements you’d need.

Hi. Is there a solution for those who have an Apple Silicon macbook m1. I really have to install the environment on my local.

Thanks

Hi @babs93 ,

Welcome to the CHT Forum! It’s great to have you here.

Have you tried installing CHT in your Macbook following our documentation? Please feel free to reach out if you are getting any errors.

Thanks @Esther_Moturi though the requirements page linked is broken, nonetheless for our version 3.x updates, we just had to work with a linux machine, all other options to get it work with M1 couldn’t yield.

Thanks @niraj, we had some few updates we had to roll out on v3.17 which is in production, ultimately we just had to implement those with a linux OS. v4.x works fine with M1s, so we are working on the upgrade.

1 Like

@sookwalinga - thanks for the call we had earlier in the week! Based on our conversation, I wanted to follow up with a possible work around for running CHT Core 3.x on M1/Apple Silicon with the Docker Helper.

I think there’s three options:

  1. Run an Ubuntu VM on macOS. Then run CHT Core in the Ubuntu VM
  2. Rent a cheap Ubuntu VPS like Digital Ocean or Linode for <$10/mo
  3. Use GitHub Codespaces - see proof of concept repo for running CHT Core + CHT Conf

I think the easiest options would be #2 or #3. However, for an entirely free options, only #1 works as UMT is open source. While it took a good long while (very very long!) to set up, I was able to get CHT 3.x running on a M1 Mac Mini. Here’s the steps that I followed:


  1. Logged into an M1 Mac Mini. I tested on 8GB RAM, 256GB Disk running macOS Montery 12.0.1

  2. Download Ubuntu Server 22.04 install image (ubuntu-22.04.2-live-server-amd64.iso)

  3. Install UTM for macOS

  4. Launch UTM and choose “Create a New Virtual Machine”

  5. Choose “Emulate” on the next screen. This is key as it will let us run x86 VMs

  6. Choose “Linux” on the “Operating System” screen

  7. On the “Linux” screen, select the .iso from step 2 and click “Continue”:

  8. On the “Hardware” page, choose 6GB RAM, 6 Cores and choose “Continue”

  9. On “Storage” and “Shared Directory” pages, accept defaults and click “Continue”.

  10. On the “Summary” page choose "Save

  11. Right click on the VM you just created and choose “Edit”:

  12. On the “System” tab, check “Force Multicore” and click “Save”

  13. Click the large “Play” icon in the middle of the screen.

  14. Install Ubuntu Server accepting all defaults except when prompted for additional software, check “Docker”.

  15. After the server is installed, rebooted and up and running, login in using the UMT terminal window and switch to the root user and git clone CHT core

  16. Run the CHT Docker Helper for 3.x.
    ---- Note The first run may take a very long time - 10s of minutes and possibly longer. Be patient! ----

  17. If needed, install the local-ip.co certificate with the the add-local-ip-certs-to-docker.sh script - I found an issue with these not installing that I hope to fix soon!

2 Likes

Great insights from this @mrjones. Thanks a lot. Already tried out the template by @jkuester and it is awesome :clap:t5:. Let me try out option #1.

@sookwalinga mentioned that 4.x works fine with M1s - would think that would be the same case with M2 but can’t seem to have it working on M2. I opened an issue here requesting for multi-platform support (to include native support on apple silicon as well).

Could I be missing something with 4.x on my end?

1 Like

Update: using the CHT Docker Helper for 4.x works! Only that the provided endpoint https://192-168-1-173.local-ip.medicmobile.org:10443 fails due to possibly a DNS issue. Had to run it with localhost on the same port: https://localhost:10443.




@kawerewagaba - We recently found a DNS related bug and fixed it. Can you try the https://192-168-1-173.local-ip.medicmobile.org:10443 URL again to see if it works now?