Cannot reach your data

@GuillaumeGautreau Sent in DM. Same HTTP requests and results I was seeing before the re-deploy.

As you can see in the details you shared with me, your server responds with a error 503: service unavailable.

This kind of error typically comes from nginx on any reverse proxy that might be in front of your server. I guess that it is not correctly configured to correctly redirect the traffic to your liana.

Before being able to login on your forest server, you will need to be able to open a browser on its public address. If you get a welcome page, then everything is correctly configured.

In your case, you should get a 503 error sent by your reverse proxy named Cowboy

@GuillaumeGautreau We’re getting that error because of the router timeout I described. The requests are making it to the server as I can actually see the node server logging them. Additionally, the / and /forest return fine.

Authentication also works fine, so I’m not sure it’s a failure of traffic making it to our Liana…

Hello @txtjournals,

Have you tried to open a browser tab on its public adress just to see if you if your reverse proxy responds correctly to it ?

Both of the requests you send to us fails with the same error/ response. :face_with_monocle:

@anon16419211 - yes, I’ve opened at https://MYAPP.herokuapp.com and it works fine. Both fail with the same error because they’re both timeout errors. If it’s a proxy issue, why would the authentication requests and / and /forest requests work fine, but not the requests for data?

Hi @txtjournals,

We saw that your dev is ok when working with your production database, nice.
This issue looks very hidden, we are not able to track it easily :frowning:

Another idea is to give a try to set return fake data inside your prod application. This is in order to return fake records instead of querying the database.

It may give us interesting info. If you created your app with lumber generate, you will find informations here to do so. (Modifying your routes folder to manually return fake data)

Regards

@Sliman_Medini

So returning test data works! Thoughts as to next steps of debugging?

Also, the explicit code described here works on local, but not in prod. So maybe a DB issue after all? Still no errors, though…

Hi @txtjournals

I just read this very long thread… Maybe the longest in Forest Admin history :sweat_smile:

I also came to the conclusion the issue comes from the database connection in production.
Or another error close to that.

To validate this idea, we could look for explicit logs in production.

Another, maybe faster, investigation idea would be to try you production database URL connection in your Forest Admin development environment (using DATABASE_URL environment variable in development). It could reveal a clear error with explicit logs. Can you try this? and let us know if you can access the data from your Admin panel in the development environment.

Hi @arnaud,

Yes, I had tried this and it works fine. Just did it again for good measure. Removed the following from development: DATABASE_SCHEMA and DATABASE_SSL=false. Added DATABASE_SSL=true, DATABASE_URL, and NODE_ENV=production to match production. Production data loads fine via local instance.

What’s the best way to debug log in production? I’ve been trying placing statements directly in /routes, but still am not reporting errors. It gets into the routes, but hangs up on data requests (e.g., recordsGetter.getAll()).

Ok,

Let’s go back to the Heroku H12 errors then.
I am trying to find what could generate such errors on your admin backend. Here are a few links for ideas:

Do you know which NodeJS version you use on your local machine and on your production server?
It could be the origin of the issue according to the last link.

There is a known issue with node.js 14.0.0 and above which requires pg package version 8.0.3 or higher in order to connect correctly to a postgres database and not timeout. Unless you are explicitly specifying a package dependency for the pg package,

1 Like

Thanks, @arnaud, that was it! Specifically, the 3rd link. The heroku image had been upgraded to node 14 and the pg dependency was too old. Upgrade to v8.6.0 and everything is great.

Thanks so much everyone for bearing with me on this!

3 Likes