R
Railway14mo ago
Hys

MongoDB failing to write

I'm getting the error Connection accepted pthread_create failed ERROR(4850900): pthread_create failed Thread creation failed Unable to schedule a new loop for the session workflow while trying to write to a mongodb its weird because my other pre docker database works just fine
No description
49 Replies
Percy
Percy14mo ago
Project ID: 476d009b-e9c3-4f51-bc61-79795b33b4b6
Hys
HysOP14mo ago
476d009b-e9c3-4f51-bc61-79795b33b4b6
Brody
Brody14mo ago
pre docker?
Hys
HysOP14mo ago
yea the other kind of database that doesn't have a volume attached
Hys
HysOP14mo ago
No description
Brody
Brody14mo ago
a database plugin
Hys
HysOP14mo ago
yes uwu
Brody
Brody14mo ago
okay and those logs are coming from a mongodb service?
Hys
HysOP14mo ago
Yes
Hys
HysOP14mo ago
No description
Brody
Brody14mo ago
do the metrics look out of the ordinary?
Hys
HysOP14mo ago
not really
No description
Hys
HysOP14mo ago
the plugin does consume a little bit less
No description
Brody
Brody14mo ago
have you looked into this error? it's not like railway is doing anything special, it's just a docker image that's being ran
Hys
HysOP14mo ago
Well, yes, found its a lack of resources i don't know how many resources are being allocated to the deploy since i have pro it shouldn't be limited up to 32gb
Brody
Brody14mo ago
well yes but this would be mongo not allocating itself enough resources is there a flag or env var you can use to tell how many cpus it should use? maybe it has a low default
Hys
HysOP14mo ago
Nope, its deployed as is
Brody
Brody14mo ago
right, but you are free to modify as you see fit, a database as a service is a whole lot more versatile compared to the old plugins look into this?
Hys
HysOP14mo ago
well chatgpt says i do have to increase the limits but in order to do so i have to run a docker command docker run --ulimit nofile=65536:65536 --ulimit nproc=65536:65536 and docker run -m 4g ...
ThallesComH
ThallesComH14mo ago
yes, usually thread creation is limited by Docker unfortunately you can't change without Railway team even a restart doesn't fix it?
Brody
Brody14mo ago
they won't do it, it is not the correct solution
Hys
HysOP14mo ago
a restart does fix it but it fails after a while the previous plugin does not have this issue
ThallesComH
ThallesComH14mo ago
yes, was going to say that
Brody
Brody14mo ago
the previous plugin used an old mongo image, you can always go back to the image that it used
ThallesComH
ThallesComH14mo ago
how many clients are connected? maybe it's reaching the limit
Hys
HysOP14mo ago
Only two a NodeJS whatsapp bot and myself thru mongo compass
ThallesComH
ThallesComH14mo ago
weird mongodb compass has a perfomance tab, try to monitor through that
Brody
Brody14mo ago
without using a hallucinating ai, have you just tried to Google this error?
ThallesComH
ThallesComH14mo ago
as i said, too many threads
No description
ThallesComH
ThallesComH14mo ago
linux has a limit of open files which it allows if it reaches that limit you can't create additional threads had that problem when installing software on bare metal and as suggested by chatgpt, you've to increase ulimit
Hys
HysOP14mo ago
Yes, all the results are from GO and other unrelated projects
Brody
Brody14mo ago
your Google foo is lacking
ThallesComH
ThallesComH14mo ago
see if there's anything in performance tab. out of ideas here.
Hys
HysOP14mo ago
No description
Hys
HysOP14mo ago
xd the thing is, this doesnt happen with the older plugin
Brody
Brody14mo ago
^
ThallesComH
ThallesComH14mo ago
i don't know the exact version of the old mongo image, but the postgres image uses a timescale version of 2021. try a image in that range 2021-2022
Hys
HysOP14mo ago
i'll pay you for join the team and fix it what do you think :p
Brody
Brody14mo ago
current mongo version in use is 7.0.2
Hys
HysOP14mo ago
No description
Brody
Brody14mo ago
give me some example code that can trigger that error and I'll see what I can do
Hys
HysOP14mo ago
amazing
Brody
Brody14mo ago
shhhhhhh
ThallesComH
ThallesComH14mo ago
nobody saw that shhhhh
Brody
Brody14mo ago
as you should
ThallesComH
ThallesComH14mo ago
my use case makes sense at least, i only need a specific person to a specific project
Hys
HysOP14mo ago
well same Redeployed the DB, just in case, right now it didn't throw the error we'll see later
Brody
Brody14mo ago
the offer is here if you want, not much I can jump into without a way to reliability reproduce this
Want results from more Discord servers?
Add your server