Unable to start forest container when creating a new enviroment

Feature(s) impacted

Hello,
we already have a forest project with three branches (dev, staging, prod) and now i am tryring to create a new envirement called Alpha (its connected to a new database and to a new sever app).

Observed behavior

Through forest app i cannot connect to the new envirement (its loading infinetlly). so i figured out that the forest container is not lunched, and every time it fails whith the error {\"errors\":[{\"status\":404,\"detail\":\"unknown secret key \\\"xxxxxxxxxxxxxxxxxxxxxxxxxxxx\\\"\",\"name\":\"NotFoundError\"}]}"

Expected behavior

the forest container get started and get connected o the client app

Failure Logs

Your admin panel is available here: https://app.forestadmin.com/projects
[forest] 🌳🌳🌳  An error occured while computing the Forest schema. Your application schema cannot be synchronized with Forest. Your admin panel might not reflect your application models definition. Not Found
{
  "status": 404,
  "response": {
    "req": {
      "method": "POST",
      "url": "https://api.forestadmin.com/forest/apimaps/hashcheck",
      "data": {
        "schemaFileHash": "6ded9c8c504430d48ef6510b1d4770266f047546"
      },
      "headers": {
        "forest-secret-key": "xxxxxxxxxxxxxxxxxxxxxx",
        "content-type": "application/json"
      }
    },
    "header": {
      "server": "Cowboy",
      "report-to": "{\"group\":\"heroku-nel\",\"max_age\":3600,\"endpoints\":[{\"url\":\"https://nel.heroku.com/reports?ts=1706704450&sid=812dcc77-0bd0-43b1-a5f1-b25750382959&s=C1Z6ZdJxZMMMPcv991vvMZ6cohabX9ERNLkWfAnCoig%3D\"}]}",
      "reporting-endpoints": "heroku-nel=https://nel.heroku.com/reports?ts=1706704450&sid=812dcc77-0bd0-43b1-a5f1-b25750382959&s=C1Z6ZdJxZMMMPcv991vvMZ6cohabX9ERNLkWfAnCoig%3D",
      "nel": "{\"report_to\":\"heroku-nel\",\"max_age\":3600,\"success_fraction\":0.005,\"failure_fraction\":0.05,\"response_headers\":[\"Via\"]}",
      "connection": "close",
      "cross-origin-embedder-policy": "require-corp",
      "cross-origin-opener-policy": "same-origin",
      "cross-origin-resource-policy": "same-origin",
      "x-dns-prefetch-control": "off",
      "expect-ct": "max-age=0",
      "x-frame-options": "SAMEORIGIN",
      "strict-transport-security": "max-age=15552000; includeSubDomains",
      "x-download-options": "noopen",
      "x-content-type-options": "nosniff",
      "origin-agent-cluster": "?1",
      "x-permitted-cross-domain-policies": "none",
      "referrer-policy": "no-referrer",
      "x-xss-protection": "0",
      "content-type": "application/json; charset=utf-8",
      "content-length": "149",
      "etag": "W/\"95-KYFGWuxBkBfbvRRK644ecAZu9z8\"",
      "vary": "Accept-Encoding",
      "date": "Wed, 31 Jan 2024 12:34:10 GMT",
      "via": "1.1 vegur"
    },
    "status": 404,
    "text": "{\"errors\":[{\"status\":404,\"detail\":\"unknown secret key \\\"xxxxxxxxxxxxxxxxxxxxxxxxxx\\\"\",\"name\":\"NotFoundError\"}]}"
  },
  "stack": "Error: Not Found\n    at Request.callback (/usr/src/app/node_modules/superagent/lib/node/index.js:871:15)\n    at /usr/src/app/node_modules/superagent/lib/node/index.js:1114:20\n    at IncomingMessage.<anonymous> (/usr/src/app/node_modules/superagent/lib/node/parsers/json.js:22:7)\n    at IncomingMessage.emit (node:events:525:35)\n    at endReadableNT (node:internal/streams/readable:1358:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)"
}

Context

  • Project name: Supermonday
  • Team name:
  • Environment name: Alpha
  • Database type: postgresql

Hello @iliyas.boumour,

Can you please send me the 4 last characters of your secret key? I’ll check on my side if they match what we have in the DB.

The error is pretty clear about the problem: the secret key that is sent does not match any environment from our DB (that has not been deleted).

Hello @GuillaumeGautreau

here are the last 4 characters :
ENV_SECRET : a086
AUTH_SECRET : 326e

yes i understood the problem but i verified that i set the right key

Thnk you :blush:

Just to be sure, can you please copy the 4 first and 4 last characters of the "forest-secret-key" headers that the logs are showing?

The previous values seem OK to me, I would like to check that the value actually sent matches this one.

Thanks

here they are 99b2…7ac7

tks

Ok, thanks.

As you can see, the value that is actually sent is not the one you shared in the first place:

  • ENV_SECRET : …a086 that you shared at first ;
  • forest-secret-key : 99b2…7ac7 that is actually sent by the agent.

So my guess is that the configuration is not correctly applied on your server. Please make sure that environment variables are correctly configured with the value ending by a086.

The value 99b2…7ac7 corresponds to a previous environment also named alpha, but that has been deleted on January the 17th.

thank you guillaume,

i fixed the issue by removing the container and launching it (not just by restarting it), however i still cannot connect through the admin panel,

here is my forest container

and when i try to acces to the app locally through curl it says this

and i cannot see any logs to know whats going on, do you have any idea please.

Note that when i try the curl command for the container of another environnement i got an HTML response saying that Forest is running

thank you.

Can you please open a new thread for this other issue? It seems to be something totally different.