I was last able to successfully work with the project in August this year. Unfortunately, I then hadn’t done any work with it since then. So there’s about a 2 month period where things somehow stopped working.
I just tried upgrading to v4 and then subsequently to v5. The issue still occurs for both versions. So it seems like the issue isn’t necessarily forest admin itself but some way in which the request to express is not completing or that request to the database is not completing. Is there some way for me to inspect requests being passed?
You’re welcome @carbon-matt
As I can see, it seems that the pending requests are ones calling your project.
Did you override the /serviceGroups or /serviceGroups/count routes?
If yes, you could investigate from here, to see if it is correctly reached or not.
Maybe a middleware is breaking?
@Guillaume_Cisco I’ve tried removing as much middleware as possible and the same issue occurs on the network requests. We also have other developers that seem to have no issue with our middleware configuration. We’ve compared configurations and can’t seem to find any discrepancies.
let sequelize = new Sequelize(process.env.DATABASE_URL, databaseOptions);
sequelize.authenticate()
.then(() => {
console.log('Connection has been established successfully.');
}).catch((error) => {
console.error('Unable to connect to the database:', error);
});
But I see none of these messages in my console output.
So it would seem like there’s some database connection issue but there is no record of why that’s the case. Again I’ve compared with other developers that this works for and our connection strings for DATABASE_URL are the same.
$ NODE_ENV=development nodemon ./bin/www --exec babel-node
[nodemon] 1.19.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `babel-node ./bin/www.js`
(node:42862) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
🌳 Open your admin UI: http://app.forestadmin.com 🌳
express deprecated res.send(status): Use res.sendStatus(status) instead node_modules/express-cors/index.js:95:45
OPTIONS /forest/sessions-google 200 3.227 ms - 2
POST /forest/sessions-google 200 1357.236 ms - 420
OPTIONS /forest/stats/patients 200 0.622 ms - 2
OPTIONS /forest/stats/users 200 0.481 ms - 2
OPTIONS /forest/choices?fields%5Bchoices%5D=createdAt%2Cid%2Clabel%2CsortIndex%2Cvalue&filterType=and&page%5Bnumber%5D=1&page%5Bsize%5D=15&searchExtended=0&sort=-id&timezone=America%2FDetroit 200 0.507 ms - 2
OPTIONS /forest/choices/count?fields%5Bchoices%5D=createdAt%2Cid%2Clabel%2CsortIndex%2Cvalue&filterType=and&searchExtended=0&timezone=America%2FDetroit 200 0.478 ms - 2
I do have cors configured in app.js and just tried editing it to allow *:
app.use(cors({
// allowedOrigins: ['*.forestadmin.com'], // regular policy
allowedOrigins: ['*'], // edited to test this
headers: ['Authorization', 'X-Requested-With', 'Content-Type']
}));
However I see the same results. I even tried commenting that block out completely. There is nothing in the logs and the network requests never complete:
[nodemon] restarting due to changes...
[nodemon] starting `babel-node ./bin/www.js`
(node:42928) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
🌳 Open your admin UI: http://app.forestadmin.com 🌳
OPTIONS /forest/choices?fields%5Bchoices%5D=createdAt%2Cid%2Clabel%2CsortIndex%2Cvalue&filterType=and&page%5Bnumber%5D=1&page%5Bsize%5D=15&searchExtended=0&sort=-id&timezone=America%2FDetroit 204 5.500 ms - 0
OPTIONS /forest/choices/count?fields%5Bchoices%5D=createdAt%2Cid%2Clabel%2CsortIndex%2Cvalue&filterType=and&searchExtended=0&timezone=America%2FDetroit 204 0.478 ms - 0
In fact I only see the cancelled GET when I navigate to another table:
GET /forest/choices?fields%5Bchoices%5D=createdAt%2Cid%2Clabel%2CsortIndex%2Cvalue&filterType=and&page%5Bnumber%5D=1&page%5Bsize%5D=15&searchExtended=0&sort=-id&timezone=America%2FDetroit - - ms - -
GET /forest/choices/count?fields%5Bchoices%5D=createdAt%2Cid%2Clabel%2CsortIndex%2Cvalue&filterType=and&searchExtended=0&timezone=America%2FDetroit - - ms - -
When you say firewall, where do you suspect it may be blocked? I’ve disabled my local adblocker for all of these screenshots and my router has no firewall configured besides the default SPI Firewall which I haven’t changed since this was previously working.
Hello @carbon-matt ! I’m jumping into this conversation to try to help you out with your problem.
From what I can see, you’re not starting your server in a “standard” way, would you mind sharing with us the content of your ./bin/www.js file ? I would like to be sure everything is set up correctly !