Cannot Login using medic account

Hi @Marcelo_De_Guzman

and for the staging is the @test-flourish.caremin.com, and the problem is the Invalid JSON Body.,

My guess here is that either API or CouchDb are down. You should check your container status to see what is going on.

the production is the @flourish.caremin.com, and the problem is the ECONNREFUSED

My guess here is that nginx is down. Again, please check your containers for logs and errors.

How to check those?

we are really having a hard time on this, maybe more than 4 hrs that we are checking what is the problem.

It depends on your setup.
Can you run docker ps ?

This is the staging

and this is on the production,

This is for the staging (@test-flourish.caremin.com)

Package ‘horticulturalist’:
Service ‘horticulturalist’:
Status: Failure
Up: 6 seconds, Restarts: 55
Attributes: watched, expected
Service PID: None, Supervisor PID: 344

Package ‘medic-api’:
Service ‘medic-api’:
Status: Failure
Up: 5 seconds, Restarts: 45
Attributes: watched, expected
Service PID: None, Supervisor PID: 387

Package ‘medic-core’:
Service ‘couchdb’:
Status: Failure
Up: 4 seconds, Restarts: 62
Attributes: watched, expected
Service PID: None, Supervisor PID: 427
Service ‘nginx’:
Status: Up
Up: 334 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 517, Supervisor PID: 486
Service ‘openssh’:
Status: Up
Up: 334 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 567, Supervisor PID: 553

Package ‘medic-couch2pg’:
Service ‘medic-couch2pg’:
Status: Failure
Up: 1 seconds, Restarts: 128
Attributes: watched, expected
Service PID: None, Supervisor PID: 591

Package ‘medic-rdbms’:
Service ‘postgresql’:
Status: Failure
Up: 1 seconds, Restarts: 162
Attributes: watched, expected
Service PID: None, Supervisor PID: 639

Package ‘medic-sentinel’:
Service ‘medic-sentinel’:
Status: Up
Up: 328 seconds, Restarts: 1
Attributes: watched, running, expected
Service PID: 1007, Supervisor PID: 685

Package ‘system-services’:
Service ‘cron’:
Status: Up
Up: 334 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 747, Supervisor PID: 731
Service ‘syslog’:
Status: Up
Up: 334 seconds, Restarts: 0
Attributes: watched, running, expected
Service PID: 775, Supervisor PID: 762

@diana , here is the supervisor-inspect on the @test-flourish.caremin.com,

What do you recommend on this to fix ?

Hi @Marcelo_De_Guzman

It seems that you’re running CHT v3.
To restart services there are a handful of commands that you can use from within the medic-os container: GitHub - medic/medic-os: A space-efficient Linux-based operating system, designed specifically to run Medic's mHealth platform. This is the build system and source code; Docker images will be available on Medic's website.

To inspect logs, there are some guides about how to obtain medic-os app logs here: AWS Hosting in CHT 3.x | Community Health Toolkit

Thanks, will check this one,

For the production (flourish.caremin.com),
we have an error for this.

What is your recommendation on this one?
For this one, it was somehow unaccessible anymore and the couchdb password is now incorrect.
What should I do about this one?
Is there a process to get the password from couchdb?

Is this also can show where the couchdb password is ?

@diana ,

I found an forum that shows the location of the passwords, and I tried every username and password, but the only one that doesn’t log in was the medic,

do you know why?

@Marcelo_De_Guzman
It would be a pretty serious security issue if couchdb passwords were retrievable or stored in plain text.

I don’t believe there is. If you have physical access to the instance, you can edit the config file manually. You can find some instructions here: 1.5. Security — Apache CouchDB® 3.3 Documentation

This will overwrite your user’s password!

1 Like

@diana,

What if somehow we update our password, what are the files that we need to check and update?

I have this list to check, can you add if I forgot something,

  • couch2pg.env
  • medic-conf’s (compilation codes)
  • docker-compose.yml

Thanks for helping us.

@joykimmel FYI

The files to update should be clear from the CouchDb documentation: 3.1. Introduction To Configuring — Apache CouchDB® 3.3 Documentation

If you can’t find the files in /etc, you can also look for them in /opt/couchdb.

To be extra clear, look for these files in the medic-os container.

1 Like

Hi @binod ,

We are having a problem in the medic (CHAMP) right now.
As of this moment, the medic username is not able to logged in anymore in the app. And this one is like a default account right,? So, from the login, to the backend which is the syncing of couch2pg.env and the medic-conf compilation codes using username and password is also affected.

Can you help me to fix this, it is now day 4 that this is broken.

Thank you very much.

@binod ,

As of now, we have 3 problems.

  1. The data is not syncing automatically from couchdb to AWS, so that, when in dbeaver it is not also updated unless, it needs to go to the terminal and login using ssh account, then go to cd /srv/cht-couch2pg and run “docker-compose --env-file couch2pg.env -d”

  2. The default medic account is not working anymore when it needs to log in. So, the implication is also for the number 1, which is it needs the credentials of medic account to use for syncing, but as of now it is not working, so, it cannot do the syncing of data.

  3. We have an staging website to test first the app and then once the update was approved it should be push to the production. But, right now, when we access the staging website it shows 404 Not Found nginx/1.13.6

by the way, thanks @diana for giving suggestions on fixing it. But, I am not yet good at fixing things this so much more complicated that is why I need more support from the medic team.

Please help us to fix this issue.

Thanks and God Bless.

cc. @joykimmel

Hi @mrjones,

I saw your post in the forum and I think I have the same issue as well, but maybe far more worst.
As a introduction, we have a production web app that when I log in as medic from the administrator, it was somehow cannot be log in, which is really confusing because I didn’t do anything to update or change the password. It was somehow logged me out of the app intentionally and then once I tried to log in, the app doesn’t want to accept the medic credentials.

this is the solution you gave to someone for recover couchdb_admin_password

can you help me? I am really struggling about this one.

What is the harm when I will gonna update the medic admin password?
What are the files that I need to update when I updated the medic admin password?

Thank you very much for the help.

Hi @Marcelo_De_Guzman

Did you try to login into your medic-os container to check if you can find the CouchDb configuration files?

On the other hand, couch2pg doesn’t need an admin account to sync, so you can configure it to use any other online user account, if you have one available.
That said, you should definitely change your CouchDb admin account password, you will need that to update upload configuration.

Hi @Marcelo_De_Guzman !

I saw your comment about changing the password for the medic user. The best path forward is to follow Diana’s advice about updating the password. My forum post you cited has great step by step instructions on how to do this.

Please give these a steps a try one at a time and report back if you get stuck on a specific step.

2 Likes

Hi @diana and @mrjones ,

Thanks for the advice,

It was already resolve for the problem which is the medic administrator password, @binod teach me on how to do it using this forum RECOVER COUCHDB Password.

And the remaining problems are :

  1. The data is not syncing automatically from couchdb to AWS, so that, when in dbeaver it is not also updated unless, it needs to go to the terminal and login using ssh account, then go to cd /srv/cht-couch2pg and run “docker-compose --env-file couch2pg.env -d”

  2. We have an staging website to test first the app and then once the update was approved it should be push to the production. But, right now, when we access the staging website it shows 404 Not Found nginx/1.13.6

I think it might be a good idea to spin up these remaining two issues into their own topics so that they can be documented and tackled separately. I have created new topics for each of the two issues: