Error Status 502 with MongoDB Query

I am having an issue with only one of several MongoDB queries I have in my app. The query used to fail only occasionally, but succeed after an additional attempt or two. Now it looks to be failing more frequently.

It is not an issue with the resource itself, credentials, or IP address ranges. Multiple other queries to the same DB but other collections, work fine. It is only this specific collection. I have been unable to find a reason for this.

Appreciate any insight anyone can give me.

image

Hello @Sam_S!

Super weird bug, good job trouble shooting that the issue isn't coming from the resource itself, credentials, or IP address ranges.

Not sure why all the other queries work fine but not this query to this one specific collection :melting_face: is there anything unique about the collection that makes it different from the others?

A 502 error is 'bad gateway' so I wonder why the Retool server would be getting that error message back as a response from the serve :thinking:r hosting your MongoDB instance.

Are you able to check/share the mongo logs to see what the request looks like coming in and if it is being received or if it might be getting blocked by some kind of proxy?

Not really sure how I can reproduce this bug without mirroring your Mongo instance and creating a collection the same/similar to see if I can also get this bug.

Maybe some other users have encountered this/fixed this with their Mongo queries :pray: only other option I can think of would be deleting and recreating the query(maybe the same for the collection or migrating the data to another collection)

Hi @Jack_T,

Thanks for getting back to me! I don't think deleting the query and recreating it would help as I experience the same issue when I create a brand-new app and recreate the query.

Does Retool not have any backend logs you can check? Can you tell me exactly what I should be looking for in the MongoDB logs and where? I wasn't able to find anything useful.

Thanks!

Sam