For some reason today, Openflow is throwing an error that is cannot connect to its MongoDB instance. This results in Openflow not fully starting and always giving a “Bad Gateway” error.
I’ll attach the logs from OpenFlow and MongoDB for review, but hoping you can help point me in the right direction. I have tried re-installing Docker and doing a fresh install of OpenRPA/OpenIAP using normal-up as well as restoring my computer to a previous backup where this was working. Hoping you can shed some light on what is happening.
Your MongoDB has lost its replica set config.
It’s not going to be easy for me to try and explain what to do over the forum, so I will not try. But here is the overall process you need to go through:
Make sure you backup your database before you try anything. If mongodump is not working, then gzip the /data folder and save it locally so you can recover the data in case something goes wrong. (You can execute commands inside the MongoDB Docker instance with docker exec and then use docker cp to copy the dump file out.)
Once you have saved your files, try fixing the replica set. Comment out the dbsetup service in Docker Compose and manually try removing and re-adding the replica set. You may need to remove and re-add --replSet rs0 from the mongodb service in your docker-compose file, while removing and rebuilding the replica set.
Once the replica set is up and running and no longer in read-only mode, make sure you schedule a job once in a while that calls db-backup.sh and ensure you backup the files in case something like this happens again.