NGINX 502 error with MongoDB and Mongo Express
See original GitHub issueI created MongoDB and Mongo Express instances from the one click options. I thought it worked at first, but now I get the NGINX 502 error whenever I try to view a database.
Here is what I’ve done, checked or not done:
- Confirmed both apps are running. I am able to bring up the ME screen and see the three default databases. However, when I click on “view”, I get the 502 error.
docker volume ls
shows both persistent volumes.- The log for Mongo shows, if I understand it, authentication against the admin database:
{"t":{"$date":"2021-01-16T01:00:51.147+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"10.0.1.11:54460","connectionId":22,"connectionCount":3}}
{"t":{"$date":"2021-01-16T01:00:51.253+00:00"},"s":"I", "c":"ACCESS", "id":20250, "ctx":"conn22","msg":"Successful authentication","attr":{"mechanism":"SCRAM-SHA-1","principalName":"root","authenticationDatabase":"admin","client":"10.0.1.11:54460"}}
{"t":{"$date":"2021-01-16T01:00:51.261+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn22","msg":"Connection ended","attr":{"remote":"10.0.1.11:54460","connectionId":22,"connectionCount":2}}
{"t":{"$date":"2021-01-16T01:00:51.262+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn20","msg":"Connection ended","attr":{"remote":"10.0.1.11:53852","connectionId":20,"connectionCount":1}}
{"t":{"$date":"2021-01-16T01:00:51.263+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn21","msg":"Connection ended","attr":{"remote":"10.0.1.11:53854","connectionId":21,"connectionCount":0}}
- The ME log shows connection:
Waiting for srv-captain--mongodb:27017...
Welcome to mongo-express
------------------------
Mongo Express server listening at http://0.0.0.0:8081
Server is open to allow connections from anyone (0.0.0.0)
Database connected
Admin Database connected
- Restarted the host VPS.
- I haven’t changed any of the App Config settings for either service except to add (as a troubleshooting step) HTTPS for ME. However, I am not forcing it.
- Read the docs on this issue
- Searched both caprover and this repo for matching issues or additional suggestions.
ufw disable
- Created a new database (successfully) but still get the error if I try to view it. And I’m confused by the namespace???
{"t":{"$date":"2021-01-16T01:31:05.925+00:00"},"s":"I", "c":"STORAGE", "id":20320, "ctx":"conn35","msg":"createCollection","attr":{"namespace":"Test.delete_me","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"54452b55-f01d-400a-8121-a681d28cb589"}},"options":{}}}
{"t":{"$date":"2021-01-16T01:31:05.932+00:00"},"s":"I", "c":"INDEX", "id":20345, "ctx":"conn35","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"Test.delete_me","index":"_id_","commitTimestamp":{"$timestamp":{"t":0,"i":0}}}}
I apologize if I’ve missed something, but I would appreciate some additional steps I can take.
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Intermittent 502 bad gateway error(using nginx,nodejs ...
The 502 bad gateway error means that nginx asked the nodejs server for some information, and the nodejs server answered and then "promptly...
Read more >Nginx gives 502 Bad Gateway when proxying to nodejs app ...
I am trying to proxy the nginx to nodejs running on 4000, but it does not reach the backend. and the nginx gives...
Read more >Node.js 502 Bad Gateway Issues and How To Resolve Them
In December of 2018, many Node.js users noticed that their applications randomly returned an HTTP status code 502 “Bad Gateway” error.
Read more >[Solved]-Docker Compose with Angular, Express.js and Nginx
Coding example for the question Docker Compose with Angular, Express.js and Nginx - 502 response-mongodb.
Read more >MEAN Stack with Pre-configured Mongo Express and Webmin ...
Intuz MEAN Stack is a pre-configured, ready to run image on Amazon EC2 and has Nginx, MongoDB, Mongo Express, NodeJS, ExpressJS, Webmin, AngularJS, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Perfect. That works. Thank you.
Good catch on the ME bug. I didn’t even think that might be it since I wasn’t having troubles my own recently set up ME (within the past few days).
Have a good night, and I do appreciate your quick response.
Looks like it may have been fixed in
mongo-express:0.54
image. Do this:mongo-express:0.54