When I run npm start and navigate to my Production, Test, and Development environments, I can see the data displaying properly. However, the Staging environment does not work and returns the page like the first image above.
Expected behavior
The Staging environment displays the data properly like the rest of the environments.
Failure Logs
I cannot see any errors on the console. The image below is a snapshot of my devtools.
Here is a snippet of the logs from our Amazon EC2 instance that is hosting the backend:
GET /forest/organizations/count?fields%5Borganizations%5D=name%2CorgType%2CparentId%2CisActive&fields%5BparentId%5D=name&timezone=America%2FNew_York 500 107 - 2041.375 ms
GET /forest/organizations?timezone=America%2FNew_York&fields%5Borganizations%5D=name%2CorgType%2CparentId%2CisActive&fields%5BparentId%5D=name&page%5Bnumber%5D=1&page%5Bsize%5D=15&sort=-id 500 107 - 2200.310 ms
GET / 200 10026 - 0.950 ms
GET / 200 10026 - 2.804 ms
GET / 200 10026 - 1.325 ms
GET / 200 10026 - 1.862 ms
GET / 200 10026 - 0.921 ms
GET / 200 10026 - 0.999 ms
[forest] 🌳🌳🌳 Unexpected error: Connection terminated unexpectedly
{
"name": "SequelizeConnectionError",
"parent": {},
"original": {},
"stack": "SequelizeConnectionError: Connection terminated unexpectedly\n at /root/portal/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:186:20\n at Connection.<anonymous> (/root/portal/node_modules/pg/lib/client.js:284:11)\n at Object.onceWrapper (node:events:641:28)\n at Connection.emit (node:events:527:28)\n at Socket.<anonymous> (/root/portal/node_modules/pg/lib/connection.js:62:10)\n at Socket.emit (node:events:527:28)\n at TCP.<anonymous> (node:net:715:12)"
}
[forest] 🌳🌳🌳 Unexpected error: Connection terminated unexpectedly
{
"name": "SequelizeConnectionError",
"parent": {},
"original": {},
"stack": "SequelizeConnectionError: Connection terminated unexpectedly\n at /root/portal/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:186:20\n at Connection.<anonymous> (/root/portal/node_modules/pg/lib/client.js:284:11)\n at Object.onceWrapper (node:events:641:28)\n at Connection.emit (node:events:527:28)\n at Socket.<anonymous> (/root/portal/node_modules/pg/lib/connection.js:62:10)\n at Socket.emit (node:events:527:28)\n at TCP.<anonymous> (node:net:715:12)"
}
GET /forest/organizations/count?fields%5Borganizations%5D=name%2CorgType%2CparentId%2CisActive&fields%5BparentId%5D=name&timezone=America%2FNew_York 500 107 - 39885.674 ms
GET /forest/organizations?timezone=America%2FNew_York&fields%5Borganizations%5D=name%2CorgType%2CparentId%2CisActive&fields%5BparentId%5D=name&page%5Bnumber%5D=1&page%5Bsize%5D=15&sort=-id 500 107 - 40043.846 ms
We’ve checked the security groups in AWS and the access to the postgres db is configured correctly. However there seems to be timeouts and recurring SequelizeConnectionErrors. Do you have any ideas of what could be going on?
Thanks,
Jenn
Staff Edit: Remove authentication req/res from logs