N
Novu6mo ago
Pooja

Need Help with MongoDB Connection Error in NestJS

Secrets YOU MUST CHANGE THESE BEFORE GOING INTO PRODUCTION used as a secret to verify the JWT token signature JWT_SECRET=aa5d69e46da930112b31f186b3dab3760b752219fa14ef4c55497f9bfefe5c52 used to encrypt/decrypt the provider credentials STORE_ENCRYPTION_KEY=q0uDWbSIgiGCPP0PJcYPNW9Lh1U9X3Q5 Host HOST_NAME=http://localhost General available values 'dev', 'test', 'production', 'ci', 'local' NODE_ENV=production MONGO_MAX_POOL_SIZE=200 MONGO_MIN_POOL_SIZE=100 MONGO USER #MONGO_INITDB_ROOT_USERNAME=root MONGO PASSWORD #MONGO_INITDB_ROOT_PASSWORD=secret MONGO_URL=mongodb+srv://charlie:[email protected]/charlie_stag?retryWrites=true&w=majority REDIS_HOST=redis DOCKER_REDIS_SERVICE_PORT=6379 REDIS_PASSWORD= REDIS_CACHE_SERVICE_HOST= AWS S3_LOCAL_STACK=$HOST_NAME:4566 S3_BUCKET_NAME=novu-local S3_REGION=us-east-1 AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test Ports API_PORT=1600 REDIS_PORT=6379 REDIS_CACHE_SERVICE_PORT=6379 WS_PORT=3002 Root URL REACT_APP_WS_URL=$HOST_NAME:3002 Uncomment this one when deploying Novu in the local environment as Web app local Dockerfile will have to load this to be used. Deployment version doesn't need as we inject it with API_ROOT_URL value. REACT_APP_API_URL=https://charlie-novu-api.cmdev.cc API_ROOT_URL=https://charlie-novu-api.cmdev.cc DISABLE_USER_REGISTRATION=false FRONT_BASE_URL=https://charlie-novu.cmdev.cc WIDGET_EMBED_PATH=$HOST_NAME:4701/embed.umd.min.js WIDGET_URL=$HOST_NAME:4500 Context Paths Only needed for setups with reverse-proxies GLOBAL_CONTEXT_PATH= WEB_CONTEXT_PATH= API_CONTEXT_PATH= WS_CONTEXT_PATH= WIDGET_CONTEXT_PATH= Analytics SENTRY_DSN= change these values NEW_RELIC_APP_NAME= NEW_RELIC_LICENSE_KEY= IS_MULTI_TENANCY_ENABLED=false can you modify this .env file to remove any existing error from the file ?
Novu Manage Platform
Novu Manage Platform
8 Replies
Ask Inkeep
Ask Inkeep6mo ago
Hi @Pooja, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.
Novu_Bot
Novu_Bot6mo ago
@Pooja, you just advanced to level 1!
Ask Inkeep
Ask Inkeep6mo ago
----------------------------- While I generate an answer, here are some sources that might be helpful: * Run Novu in local machine * Introduction to Novu * Monorepo Structure * Deploy with Docker -----------------------------
Ask Inkeep
Ask Inkeep6mo ago
Answer I apologize, but I cannot modify the .env file directly as I am an AI assistant without the ability to edit files. However, I can review the file contents you provided and suggest any changes that might be needed to address potential errors. Based on the information provided, there don't appear to be any obvious syntax errors in the .env file you shared. The file seems to be properly formatted with key-value pairs for various configuration settings. (1) (2) However, there are a few things to note: 1. The MONGO_URL is set to a specific MongoDB Atlas connection string. Make sure this is the correct connection string for your MongoDB instance. (1) 2. The REDIS_HOST is set to "redis", which assumes you're using Docker and have a Redis service named "redis". If you're not using Docker or have a different Redis setup, you may need to adjust this. 3. Some variables like REDIS_PASSWORD and REDIS_CACHE_SERVICE_HOST are empty. Depending on your setup, you might need to provide values for these. 4. The REACT_APP_API_URL and API_ROOT_URL are set to "https://charlie-novu-api.cmdev.cc". Ensure these URLs are correct for your setup. (2) 5. The FRONT_BASE_URL is set to "https://charlie-novu.cmdev.cc". Make sure this is the correct URL for your frontend. If you're experiencing a MongoDB connection error, it's likely related to the MONGO_URL setting. You might want to double-check that the connection string is correct and that your MongoDB instance is accessible from where you're running your application. [(3)](https://github.com/novuh
GitHub
Novuh - Overview
GitHub is where Novuh builds software.
Ask Inkeep
Ask Inkeep6mo ago
q/novu/issues/2675) If you need further assistance with a specific error you're encountering, please provide more details about the error message you're seeing. Additionally, you might want to click on the "Ask for help" button to tag a team member for more specific guidance related to your setup.
Ask Inkeep
Ask Inkeep6mo ago
Feel free to tag @Ask Inkeep with additional questions.
Pooja
PoojaOP6mo ago
but its givinng the error
Want results from more Discord servers?
Add your server