Closed yasirmturk closed 1 year ago
Thank you for submitting this issue! Can you specify:
.env
(feel free to omit sensitive information here like the password)create-medusa-app
and git clone the repo, both are almost same ?sslmode=require
Anyway, I just slept over it and today it start working on local; without any changes literally :D but it is still not working on server. This is my .env file
NODE_ENV=development
DATABASE_TYPE=postgres
DATABASE_URL=postgres://yasirmturk:<password>@ep-odd-breeze-80644673.eu-central-1.aws.neon.tech/neondb?sslmode=require
Sorry this may be a silly question, but did you make sure that your server is using the correct environment variables (similar to local)? Because I'm not sure what the difference should be for it to not work there 😅
Also can you ensure that you're using the same Medusa versions and everything both locally and your server?
That is actually a very good question. Cpanel provides its own interface to configure env variables just like heroku, i have provided same values there and also in .env file..
and the app seems to be initialized fine, for example it does not complain about the JWT or Cookie secret.. Just unable to connect to the db server. Another fishy thing is that for 1 hit the whole app runs 3 times as I can see in the error logs attached here
I am also checking with the server guys but there should not be any restriction regarding outgoing connections... Is there any way to access the raw logs? can I enable debug logs or something to dig deep into the problem?
The JWT and Cookie secrets aren't an indication since a temporary value can be used if not provided in development, and it seems like you're using the medusa develop
command, otherwise the logs output would be different. I would start with ensuring that the environment variables are actually loaded.
You can specify a log file by setting the LOG_FILE
environment variable, but it's currently only supported through environment variables 😅
So, I specified LOG_FILE=log.txt
and this is what I get in the file
{"level":"info","message":"Using fake Redis","timestamp":"2023-08-31 08:35:37"}
{"level":"warn","message":"Local Event Bus installed. This is not recommended for production.","timestamp":"2023-08-31 08:35:37"}
{"level":"info","message":"Using fake Redis","timestamp":"2023-08-31 08:35:40"}
{"level":"warn","message":"Local Event Bus installed. This is not recommended for production.","timestamp":"2023-08-31 08:35:40"}
{"level":"info","message":"Using fake Redis","timestamp":"2023-08-31 08:35:43"}
{"level":"warn","message":"Local Event Bus installed. This is not recommended for production.","timestamp":"2023-08-31 08:35:43"}
That's not really an error. It just means that you should be using a production redis module and ensure you've setup redis configuraitons.
So, the port is blocked on the nodejs app for cpanel, the issue has been resolved, thank you for you help but you might want to add it to you documentation.
Sure, thanks for pointing it out!
@yasirmturk would you mind helping me deploy using cpanel. Im also using it and im struggling to set it up, especially the postgresql portion.
- I used
create-medusa-app
and git clone the repo, both are almost same- First it complaint about ssl so I added
?sslmode=require
Anyway, I just slept over it and today it start working on local; without any changes literally :D but it is still not working on server. This is my .env file
NODE_ENV=development DATABASE_TYPE=postgres DATABASE_URL=postgres://yasirmturk:<password>@ep-odd-breeze-80644673.eu-central-1.aws.neon.tech/neondb?sslmode=require
This helped me , Thanks!
Hi there if you are using the --db url option make sure that the db url is incased in "" or else it will fail
Preliminary Checks
Issue Summary
Unable to connect to a remote db, localhost works but none of these work, i have tried
How can this issue be resolved?
1. 2. 3. ...
Are you interested in working on this issue?