R
Railway13mo 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
Percy13mo ago
Project ID: 476d009b-e9c3-4f51-bc61-79795b33b4b6
Hys
Hys13mo ago
476d009b-e9c3-4f51-bc61-79795b33b4b6
Brody
Brody13mo ago
pre docker?
Hys
Hys13mo ago
yea the other kind of database that doesn't have a volume attached
Hys
Hys13mo ago
No description
Brody
Brody13mo ago
a database plugin
Hys
Hys13mo ago
yes uwu
Brody
Brody13mo ago
okay and those logs are coming from a mongodb service?
Hys
Hys13mo ago
Yes
Hys
Hys13mo ago
No description
Brody
Brody13mo ago
do the metrics look out of the ordinary?
Hys
Hys13mo ago
not really
No description
Hys
Hys13mo ago
the plugin does consume a little bit less
No description
Brody
Brody13mo 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
Hys13mo 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
Brody13mo 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
Hys13mo ago
Nope, its deployed as is
Brody
Brody13mo 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
Hys13mo 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
ThallesComH13mo 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
Brody13mo ago
they won't do it, it is not the correct solution
Hys
Hys13mo ago
a restart does fix it but it fails after a while the previous plugin does not have this issue
ThallesComH
ThallesComH13mo ago
yes, was going to say that
Brody
Brody13mo ago
the previous plugin used an old mongo image, you can always go back to the image that it used
ThallesComH
ThallesComH13mo ago
how many clients are connected? maybe it's reaching the limit
Hys
Hys13mo ago
Only two a NodeJS whatsapp bot and myself thru mongo compass
ThallesComH
ThallesComH13mo ago
weird mongodb compass has a perfomance tab, try to monitor through that
Brody
Brody13mo ago
without using a hallucinating ai, have you just tried to Google this error?
ThallesComH
ThallesComH13mo ago
as i said, too many threads
No description
ThallesComH
ThallesComH13mo 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
Hys13mo ago
Yes, all the results are from GO and other unrelated projects
Brody
Brody13mo ago
your Google foo is lacking
ThallesComH
ThallesComH13mo ago
see if there's anything in performance tab. out of ideas here.
Hys
Hys13mo ago
No description
Hys
Hys13mo ago
xd the thing is, this doesnt happen with the older plugin
Brody
Brody13mo ago
^
ThallesComH
ThallesComH13mo 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
Hys13mo ago
i'll pay you for join the team and fix it what do you think :p
Brody
Brody13mo ago
current mongo version in use is 7.0.2
Hys
Hys13mo ago
No description
Brody
Brody13mo ago
give me some example code that can trigger that error and I'll see what I can do
Hys
Hys13mo ago
amazing
Brody
Brody13mo ago
shhhhhhh
ThallesComH
ThallesComH13mo ago
nobody saw that shhhhh
Brody
Brody13mo ago
as you should
ThallesComH
ThallesComH13mo ago
my use case makes sense at least, i only need a specific person to a specific project
Hys
Hys13mo ago
well same Redeployed the DB, just in case, right now it didn't throw the error we'll see later
Brody
Brody13mo 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