Just adding some happy path notes here in case it’s helpful.
On my docker based single node, indeed this call works as expected:
curl -X PUT -H "Content-Type: text/plain" https://medic:password@192-168-68-23.local-ip.medicmobile.org:10446/api/v1/credentials/mykey2 -d "secret"
I can artificially reproduce the 404
error by deleting the medic-vault
database in fauxton. Tailing the API and HAProxy logs in two terminals with docker logs -f 4_11_404_test-haproxy-1
and docker logs -f 4_11_404_test-api-1
and doing my curl
command with the database having been deleted, I see these logs in the API container:
2025-03-25T20:46:43.707 DEBUG: Checking for a configured outgoing message service
2025-03-25T20:46:45.208 REQ: e50adc31-ea9f-4381-b897-9d69139c1329 192.168.68.23 medic PUT /api/v1/credentials/mykey2 HTTP/1.0
2025-03-25T20:46:45.225 RES: e50adc31-ea9f-4381-b897-9d69139c1329 192.168.68.23 medic PUT /api/v1/credentials/mykey2 HTTP/1.0 404 - 16.266 ms
And these logs in the HAProxy container:
<150>Mar 25 20:46:45 haproxy[12]: 172.30.0.6,couchdb,200,1,0,0,GET,/_session,-,medic,'-',323,1,148,'curl/8.12.1'
<150>Mar 25 20:46:45 haproxy[12]: 172.30.0.6,couchdb,200,1,0,0,GET,/_session,-,medic,'-',323,1,148,'curl/8.12.1'
<150>Mar 25 20:46:45 haproxy[12]: 172.30.0.6,couchdb,200,1,0,0,GET,/_node/_local/_config/couch_httpd_auth/secret,-,medic,'-',257,1,35,'-'
<150>Mar 25 20:46:45 haproxy[12]: 172.30.0.6,couchdb,404,1,0,0,GET,/medic-vault/credential:mykey2,-,medic,'-',294,1,58,'-'
<150>Mar 25 20:46:45 haproxy[12]: 172.30.0.6,couchdb,404,1,1,0,PUT,/medic-vault/credential:mykey2,-,medic,'{"_id":"credential:mykey2","password":"***"}',294,1,58,'-'
I note that restarting all the containers causes the medic-vault
database to get recreated.
Again - all in docker compose single couch node testing.