Answer the question
In order to leave comments, you need to log in
How to fix error when deploying Strapi to Heroku?
Good afternoon!
Error when connecting to Mongo Atlas DB on Heroku
2020-01-14T06:45:45.473Z] debug ⛔ Server wasn't able to start properly.
2020-01-14T06:45:45.474867+00:00 app[web.1]: [2020-01-14T06:45:45.474Z] error Error connecting to the Mongo database. Server selection timed out after 30000 ms
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "mongoose",
"settings": {
"host": "${process.env.DATABASE_HOST || '127.0.0.1'}",
"port": "${process.env.DATABASE_PORT || 27017}",
"database": "${process.env.DATABASE_NAME || 'strapi'}",
"username": "${process.env.DATABASE_USERNAME || ''}",
"password": "${process.env.DATABASE_PASSWORD || ''}"
},
"options": {}
}
}
}
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "mongoose",
"settings": {
"uri": "${process.env.DATABASE_URI}",
"database": "${process.env.DATABASE_NAME}"
},
"options": {
"ssl": true
}
}
}
}
Answer the question
In order to leave comments, you need to log in
What command of start checked locally? heroku local
?
Does it show the heroku config
correct variable values DATABASE_
?
Accordingly, not localhost...
This fix helped me:
https://github.com/strapi/strapi/pull/6027/commits...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question