# Cannot reach your data

**URL:** <https://community.forestadmin.com/t/cannot-reach-your-data/2193>\
**Category:** Help me!\
**Created:** [March 29, 2021, 5:58pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193 "2021-03-29T17:58:07Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 16, 2021, 3:25pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/21 "2021-04-16T15:25:09Z")

</div>

Good call - I replaced the following environment variables in my local environment:

- `CORS_ORIGINS=https://app.forestadmin.com`
- `DATABASE_REJECT_UNAUTHORIZED=false`
- `DATABASE_SSL=true`
- `DATABASE_URL=...`

…and sure enough, I’m loading production data perfectly fine! I even tried it with `NODE_ENV=production` to make sure. Could any of the values of the remaining environment variables in production be causing an issue?

- `APPLICATION_URL`
- `FOREST_AUTH_SECRET`
- `FOREST_CLIENT_ID`
- `FOREST_ENV_SECRET`

---

<div class="post-metadata">

**Author:** ![Sliman\_Medini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sliman_medini/32/19_2.png) [@Sliman\_Medini](https://community.forestadmin.com/u/Sliman_Medini)\
**Post date:** [April 16, 2021, 3:46pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/22 "2021-04-16T15:46:38Z")

</div>

Ok,

All the environment variables you mention are ok because we can see requests incoming inside your server.  
I ask myself if your code is really the same between prod and dev.  
Can you double/triple-check that? 🙂  
Can’t you have a try without a complete no-custom code version on the production?

Regards

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 16, 2021, 3:59pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/23 "2021-04-16T15:59:06Z")

</div>

Yes, it’s the same. Heroku auto-deploys off `master` and I just confirmed that the latest deploy commit matches what I have locally.

Since my project thinks nothing is deployed to production ([see my other thread](https://community.forestadmin.com/t/production-environment-cannot-be-removed/2247)), do you think it’s worth re-deploying to production, using development as the base?

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [April 19, 2021, 9:56am UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/24 "2021-04-19T09:56:53Z")

</div>

Hi @txtjournals,

Do you have the same version of postgres on dev and on production 🤔 ?

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 19, 2021, 6:01pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/25 "2021-04-19T18:01:32Z")

</div>

They’re both v12, but I can also point my local instance at the production database and it works fine.

---

<div class="post-metadata">

**Author:** ![anon34731316](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon34731316](https://community.forestadmin.com/u/anon34731316)\
**Post date:** [April 20, 2021, 4:54pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/26 "2021-04-20T16:54:15Z")

</div>

Hi @txtjournals,

So many questions and messages on this thread…  
Be sure we’re sorry we couldn’t help you out with your problem yet!

> Since my project thinks nothing is deployed to production ([see my other thread](https://community.forestadmin.com/t/production-environment-cannot-be-removed/2247)), do you think it’s worth re-deploying to production, using development as the base?

→ Definitively worth a shot!  
Let me know how this ends up.  
You might want to delete the remote environment called “Production” before, just in case it doesn’t have any value to you and if it causes some troubles in the deploy to production process.

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 20, 2021, 6:20pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/27 "2021-04-20T18:20:10Z")

</div>

Hi @anon34731316 - thanks for chiming in.

I removed the exciting remote environment, launched the production environment (updating the environment variables on Heroku), and cleared cache. Now I can’t authenticate to this new environment:

![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/d/dbfcbd27a3ac5f4d1cd96ab40b2ea4dd067af756.png)

HTTP Response:

Error: `invalid_grant`  
Error String: `You are not allowed to access to this client`  
State: `{"renderingId":88983}`

No errors on the server and can confirm that backend is receiving (and responding to) the requests.

---

<div class="post-metadata">

**Author:** ![anon90145840](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon90145840](https://community.forestadmin.com/u/anon90145840)\
**Post date:** [April 21, 2021, 9:38am UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/28 "2021-04-21T09:38:04Z")

</div>

Hi @txtjournals,

Could I ask you to open your Network tab, and share with me the call to `https://api.development.forestadmin.com/oidc/auth?client_id=<long_token>`. I am particularly interested in this `client_id` parameter so I can check if the data is correct.

Thank you

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 21, 2021, 6:24pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/29 "2021-04-21T18:24:42Z")

</div>

Hi @anon90145840,

I don’t have a call to `https://api.development.forestadmin.com/oidc/auth`, but rather to `https://api.forestadmin.com/oidc/auth` (will send in DM).

The `GET` results in a `302` with a redirect to `https://<My App>.herokuapp.com/forest/authentication/callback?error=invalid_grant&error_description=You+are+not+allowed+to+access+to+this+client&state=%7B%22renderingId%22%3A88983%7D`

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 21, 2021, 10:28pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/30 "2021-04-21T22:28:12Z")

</div>

Note: this authentication error began occurring after re-deploying the project to production. Is there perhaps a conflict between this new production environment and something old in the database since the DB was originally from an old remote environment?

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [April 22, 2021, 7:45am UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/31 "2021-04-22T07:45:41Z")

</div>

Hello @txtjournals,

Looking at your client id, it looks like you configured your `environment_secret` with the secret key of an environment named `Production` that you deleted at `2021-04-20 17:26:50.917+00` and you re-created one at `2021-04-20 17:39:10.404+00`.

Both the old and the new one share the same URL, but the environment secret must be changed.

Please check that the environment variable you provided to your liana matches the one that is visible in the environment’s settings on Forest Admin.

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 22, 2021, 2:30pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/32 "2021-04-22T14:30:04Z")

</div>

Hi @GuillaumeGautreau - thanks for your help on this!

Yes. I had updated all environment variables when I re-deployed. I suspected this could be the issue, so I re-checked and restarted the instance a half dozen times already. Could the old environment secret be cached in the database somewhere that needs to be cleared out?

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [April 22, 2021, 2:31pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/33 "2021-04-22T14:31:18Z")

</div>

Hello,

No, the env\_secret is directly retrieved from the initialization variables, it’s not cached anywhere

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 22, 2021, 2:49pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/34 "2021-04-22T14:49:03Z")

</div>

@GuillaumeGautreau Any other ideas then?

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 22, 2021, 2:56pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/35 "2021-04-22T14:56:15Z")

</div>

Perhaps the `FOREST_CLIENT_ID` environment value is wrong on Heroku…is this what you’re saying? If so, is there a way to recreate?

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [April 22, 2021, 2:57pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/36 "2021-04-22T14:57:45Z")

</div>

In fact you definitively need to regenerate the `FOREST_CLIENT_ID` with the new env secret. I did not realized that you could use a fixed value for this parameter.

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 22, 2021, 3:00pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/37 "2021-04-22T15:00:04Z")

</div>

@GuillaumeGautreau Is there a guide on how to do this correctly?

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [April 22, 2021, 3:05pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/38 "2021-04-22T15:05:07Z")

</div>

You have to follow this docs: [https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-sql-mongodb/upgrade-to-v7#setup-a-static-clientid](https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-sql-mongodb/upgrade-to-v7#setup-a-static-clientid)

And you were right about the cache, there is some cache involved regarding this value. I mixed up 2 different topics that were close.

Could please make sure that you’re using the last version of `forest-rails`, we recently released a fix regarding this issue about the cache.

---

<div class="post-metadata">

**Author:** ![txtjournals](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@txtjournals](https://community.forestadmin.com/u/txtjournals)\
**Post date:** [April 22, 2021, 3:30pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/39 "2021-04-22T15:30:13Z")

</div>

Back to square one. Authentication issue is resolved, but now I’m still receiving the initial error of “Cannot reach your data”.

@GuillaumeGautreau - we’re on Node, not rails.

To recap:

- Everything upgraded to Liana v7.3.1
- Development environment works great
- Removed original remote environment that was having this issue
- Redeployed production environment, updating environment secret, client ID, etc.
- Copied layout configuration from development to production
- No errors in logs other than the timeout error being thrown by the Heroku router
- When update the environment variables on my local environment to that of the production, it works great, so DB connection is not an issue (we also have other apps on Heroku using the same DB).

What’s a good way to confirm DB connection to 100% rule this out? Any other ideas?

Thanks for your help, everyone!

---

<div class="post-metadata">

**Author:** ![GuillaumeGautreau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guillaumegautreau/32/557_2.png) [@GuillaumeGautreau](https://community.forestadmin.com/u/GuillaumeGautreau)\
**Post date:** [April 22, 2021, 3:32pm UTC](https://community.forestadmin.com/t/cannot-reach-your-data/2193/40 "2021-04-22T15:32:28Z")

</div>

Thanks for the update @txtjournals,

Can you copy/paste the details about HTTP request that are failing, from the network tab of your browser’s developper tools?

It’ll give us details on the reasons of this failure.

Thanks

[Previous page](https://community.forestadmin.com/t/cannot-reach-your-data/2193.md?page=1)

[Next page](https://community.forestadmin.com/t/cannot-reach-your-data/2193.md?page=3)
