I have some problem to deploy in heroku too, in my case is the connection to the database postgress.
For some reason the /config/env/production/database.js is not override the default DB configuration on /config/database.js.
2022-02-24T09:26:18.595111+00:00 app[web.1]: > zebra-travel-dash-2@0.1.0 start
2022-02-24T09:26:18.595112+00:00 app[web.1]: > strapi start
2022-02-24T09:26:18.595112+00:00 app[web.1]:
2022-02-24T09:26:19.104950+00:00 app[web.1]: configs:
2022-02-24T09:26:19.105201+00:00 app[web.1]: ec2-44-192-245-97.compute-1.amazonaws.com
2022-02-24T09:26:19.105217+00:00 app[web.1]: 5432
2022-02-24T09:26:19.105230+00:00 app[web.1]: de9be72grm24uv
2022-02-24T09:26:19.105243+00:00 app[web.1]: jwtxauabyfyofd
2022-02-24T09:26:19.105258+00:00 app[web.1]: d7a9dec462b728e0301814c45bc63588791098114af9f5be11910ade490c490b
2022-02-24T09:26:19.105269+00:00 app[web.1]: config end:
2022-02-24T09:26:19.930717+00:00 app[web.1]: [2022-02-24T09:26:19.930Z] debug ⛔️ Server wasn't able to start properly.
2022-02-24T09:26:19.931134+00:00 app[web.1]: [2022-02-24T09:26:19.931Z] error Error: connect ECONNREFUSED 127.0.0.1:3306
2022-02-24T09:26:19.931135+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
2022-02-24T09:26:19.931136+00:00 app[web.1]: --------------------
2022-02-24T09:26:19.931137+00:00 app[web.1]: at Protocol._enqueue (/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
2022-02-24T09:26:19.931137+00:00 app[web.1]: at Protocol.handshake (/app/node_modules/mysql/lib/protocol/Protocol.js:51:23)
2022-02-24T09:26:19.931138+00:00 app[web.1]: at Connection.connect (/app/node_modules/mysql/lib/Connection.js:116:18)
2022-02-24T09:26:19.931139+00:00 app[web.1]: at /app/node_modules/knex/lib/dialects/mysql/index.js:68:18
and i follow all steps on the documentation,
/config/env/production/database.js
const parse = require("pg-connection-string").parse;
const { user, password, port, host, database } = parse(
process.env.DATABASE_URL
);
console.log("configs:");
console.log(host);
console.log(port);
console.log(database);
console.log(user);
console.log(password);
console.log("config end:");
module.exports = ({ env }) => ({
connection: {
client: "postgres",
connection: {
host,
port,
database,
user,
password,
ssl: {
rejectUnauthorized: false,
},
},
debug: true,
},
});