R
Railwayadrian

Operation `model.find()` buffering timed out after 10000ms

Hello all. I tried posting about this in a group for nodejs but as they could not find any issue with my js code. That in combination with the error messages I am getting lead me to believe that my issue has something to do with my MongoDB database provided via Railway. The issue is this. Whenever I load a page in my railway site that requires a mongoose/MongoDB model, the page fails to load, instead leaving me with this error message:
Operation model.find() buffering timed out after 10000ms
Pages that do not call mongoose models load fine, so this seems to be a database access issue. The MongoDB database also keeps on crashing. (though the error is there even before the database crashes). When I look at the database logs it contains roughly 100 lines of this error message:
/bin/bash: line 1: docker-entrypoint.sh: command not found
I'm not sure what the docker-entrypoint is so I'm not sure how I should address this. I've double checked and the variable for my MongoDB connection string is correct. Does anyone know what the issue is, and/or how to address the error message that the database is logging?
Solution:
go into the mongo service and find the latest deployment that says mongo on it and use that deployment's 3-dot menu to redeploy
Percy
Percy•16d ago
Project ID: abeecb1e-76d2-4680-a353-53c6614e1ff9
adrian
adrian•16d ago
abeecb1e-76d2-4680-a353-53c6614e1ff9
Brody
Brody•16d ago
what is the current deployment status of mongo?
adrian
adrian•16d ago
Its currently crashed
No description
Brody
Brody•16d ago
can you send the build logs of the mongo service please - https://bookmarklets.up.railway.app/log-downloader/
adrian
adrian•16d ago
sure. here you go. thanks for your help
Brody
Brody•16d ago
whats the source of the mongo service? (check its settings)
adrian
adrian•16d ago
Im not sure if I understand the question. Do you need the connection string?
Brody
Brody•16d ago
check its settings then you will be able to answer the question 🙂
adrian
adrian•16d ago
ah i see, my bad. the source is mongo
No description
Brody
Brody•16d ago
can you send a full screenshot of your project canvas
adrian
adrian•16d ago
is this what you are looking for?
No description
Brody
Brody•16d ago
looks like you may have ran railway up while linked to the mongo service instead of the toothpaste service
Solution
Brody
Brody•16d ago
go into the mongo service and find the latest deployment that says mongo on it and use that deployment's 3-dot menu to redeploy
adrian
adrian•16d ago
Okay that seems to have fixed part of the issue, thank you. MongoDB does not seem to be crashing and the build logs are no longer producing any error messages. I am still getting the buffering timed out message. I will try to run my site locally with a separate mongo database to see if the issue is with the database or with my code
Brody
Brody•16d ago
okay let me know how that goes and then we will go from there
adrian
adrian•16d ago
huh, so i am getting this when i try to login. when i switch browsers both are unable to load past the login page. it looks like the website is currently up though. and i think it would be bigger news if mongodb servers were actually down. so im not sure
No description
Brody
Brody•16d ago
so you are using atlas when developing locally?
adrian
adrian•16d ago
looks like they are actually having issues https://status.mongodb.com/
MongoDB Cloud Status
Welcome to MongoDB Cloud's home for real-time and historical data on system performance.
Brody
Brody•16d ago
just trying to understand why you have mongo deployed on railway, yet are still using atlas?
adrian
adrian•16d ago
im trying to figure out if the problem is with railway or with mongodb. i was having issues with railway, so im switching to atlas, to see if that improves things
Brody
Brody•16d ago
well atlas is not happy right now, try using mongo on railway now that is not crashed
adrian
adrian•16d ago
okay, that is why i came here initially
Brody
Brody•16d ago
so let me know how connecting to railway hosted mongo goes
adrian
adrian•16d ago
its not going well. im getting an error saying
Operation toothpastes.findOne() buffering timed out after 10000ms
Brody
Brody•16d ago
can you show me your code that starts the mongo client?
adrian
adrian•16d ago
sure, here you go
const dotenv = require('dotenv');

var app = express();
dotenv.config();

const mongoose = require('mongoose');
mongoose.set("strictQuery", false);
const mongoDB = process.env.MONGO_URL;

main().catch((err) => console.log(err));
async function main() {
await mongoose.connect(mongoDB);
};
const dotenv = require('dotenv');

var app = express();
dotenv.config();

const mongoose = require('mongoose');
mongoose.set("strictQuery", false);
const mongoDB = process.env.MONGO_URL;

main().catch((err) => console.log(err));
async function main() {
await mongoose.connect(mongoDB);
};
Brody
Brody•16d ago
your toothpaste service, does it have a MONGO_URL service variable?
adrian
adrian•16d ago
it does I just checked, and it points to the railway database, so i dont think that is the issue
Brody
Brody•16d ago
is that buffering error the only error you get?
adrian
adrian•16d ago
ive managed to get it to work. thank you for your help
Brody
Brody•16d ago
oh that's great, what was the issue?
adrian
adrian•16d ago
im honestly not entirely sure it just started working again
Brody
Brody•16d ago
that's the worst kind of fixed
adrian
adrian•16d ago
hahaha yeah anyway thanks again for the help. a job like yours would require an extremely patient personality so kudos to you
Brody
Brody•16d ago
happy to help!
Want results from more Discord servers?
Add your server
More Posts
Deployments aren't doing nothingI am trying to deploy hedgedoc, and the deploy doesn't do nothing and it fails after a few minutes. Database deleted from v2 migrationI just went to check back on an old side project and i now see that my db is gone. I see that there Supabase Nixpacks ErrorWhen trying to deploy to prod using nixpacks with bun. It throws: ```bash Error: Error reading src/tRailway errorHi, I'm having trouble deploying on Railway. When I try to deploy, I get an error saying, 'Oh No! LClone DB service?Can I "clone" a db service in railway? I'm looking for the easiest way to take a snapshot of a db seTransferring servicesIs it possible to move services to another project? I know you can recreate them but that would deleUsage Reports not per monthI like to track expenses for each month, but railway doesn't seem to track monthly expenses like othPrisma migrate dev errorthe issue is like that; when i start project normally. it works and it connect database . there is nNextjs memory usage issueHie everyone i just deployed a basic nextjs 14 app and its averaging 1.8GB of memory usage.. is thiTrial reset (testing)Tried Railway for Laravel about a year ago and had no success, had to remain on Heroku for time beinAccess blockedHello, i have this problem railway.app has not completed the Google verification process. The app isCan't get www to work on railwayI'm trying to have it so that users can go to www.mypetnote.com and be redirected to my project whic503 error after adding TailwindCSS into my projectSo I recently decided to style my website with tailwindcss as vanilla CSS was becoming quite. tediouError using mailgun apilibrary: 'SSL routines', reason: 'wrong version number',Need help on the billingI had a problem with the payment that has already been arranged, will my services be automatically rData migration to another databaseHello. I want to migrate my data from a database in one of my accounts to the database in a new accoTransfer one service from one project to anotherHow i can transfer my service from one project to anotherHelp with GhostThe Ghost forum is dead so that's why I post here. I added a third tier and it does not show up on tCould not find a suitable TLS CA certificate bundleDeploying the fast api tepmplate with 3.11 and pdm https://github.com/railwayapp-templates/fastapi/tPush to GitHubI have a telegram bot that locally stores user ids. And every time a new user logs in, this file wit