Running backend as a docker container does not sees the env variables

This is a template you can use to report issues. You can also drag images, videos and include Preformatted text

Expected behavior

I have setup a build pipeline that builds a docker image from the initial backend code. The code was left untouched. The image was built from the Dockerfile provided.
When I run this docker image from my server I’m getting an error saying The Forest_env_secret is missing:

> hophopadmin@0.0.1 start /usr/src/app

> node ./server.js

Your application is listening on port 3310.

[forest] 🌳🌳🌳 An error occured while retrieving your IP whitelist. Your Forest envSecret seems to be missing or unknown. Can you check that you properly set your Forest envSecret in the Forest initializer?

Your admin panel is available here: https://app.forestadmin.com/projects

GET /forest 204 - - 22.101 ms

GET /forest 204 - - 2.060 ms

GET /forest 204 - - 1.921 ms

GET /forest 204 - - 2.388 ms

But looking at the pod configuration the environment are properly set:

Containers:
  hophopadmin:
    Container ID:   docker://51e233befec7d6f70e52f994b937302bffc897cff1223792fcce2d922ea2e868
    Image:          xxxxxxxxxxxx/hophopme/hophopadmin:latest
    Image ID:       docker-pullable://xxxxxxxxx/hophopme/hophopadmin@sha256:b2b4b81d9c06b6be0b27596ad685a46d742145698e7480114218372aaa539860
    Port:           3310/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Fri, 05 Jun 2020 23:20:54 +0200
    Ready:          True
    Restart Count:  0
    Environment:
      APPLICATION_PORT:    3310
      DATABASE_URL:        xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      DATABASE_SCHEMA:     public
      DATABASE_SSL:        true
      FOREST_AUTH_SECRET:  xxxxxxxxxxxxxxxxxxxxxxx
      FOREST_ENV_SECRET:   xxxxxxxxxxxxxxxxxxxxxxxx
      NODE_ENV:            staging
    Mounts:

Actual behavior

What is the current behavior?
The forest_app_secret is not taken from the environment variable.

Failure Logs

Please include any relevant log snippets, if necessary.

Context

Please provide any relevant information about your setup.

  • Package Version: Latest version
  • Express Version:
  • Sequelize Version:
  • Database Dialect:
  • Database Version:
  • Project Name:

Hi @Alexandre_Roba,

Welcome and thank you for sharing your issue!

There is two possible issues here:

  • Either the way you defined your pod configuration file does not handle the env variables (maybe a link to the documentation you used to write it might be helpful)
  • Or the environment variable are well used but there is a mismatch between the env secret you specified and the one intended for the environment you’re trying to deploy. (you can find all expected env secrets by going to your project settings > environments and clicking on the one you’re trying to deploy)

Screenshot 2020-06-08 at 17.13.44

I hope my answer will be useful!

Hello @anon37102731,

Thanks for reaching out to me. the issue resolved by itself. It was an issue with the istio mesh that is installed on the cluster. the version 1.6.0 has a severe bug that prevent any connection from a running pod to an external system such as a DB or another API :frowning: Once the istio team sent me the work around for another pod, the forest admin pod started to work on its own. It there is one thing we could correct on forest is the error message from forest. So the scenario to reproduce this would be I guess:
Run the forest background pod without any external connection and you will get thet missing forest secret variable message following by a series of http connection /forest with result 204.

thanks for the help,

Regards,

Alex.

I’m still having this issue and have tried for hours to fix it. The environment variables are being passed in but it’s simply not working. This is our first experience trying to put forest admin into production (and eventually buy pro) but this sort of extremely obscure error is not promising.