After the forest init I get my forest secrets for the Development environment, but when I try to create a new branch for the Development environment, I get the following errors in Observed behavior part
Hello Jacques,
I see that there is no environment named “Development” on your project, but there is an environment with the name “Development | nostrumtech.”
Can you try to create a branch from this environment ?
quotes are important. There is spaces in the name of your environment, so the CLI take each word as a command.
You wrote “orgin” instead of origin.
The CLI takes the values in your .env to determine on which environment you are. Can you check that you provided the right FOREST_ENV_SECRET in your .env ?
To which environment this FOREST_ENV_SECRET corresponds ?
Do you execute the command forest branch development-local from the same directory of the .env file ?
This error means that the CLI does not find any environment from the .env in the same folder that the command is executed. Are you sure the FOREST_ENV_SECRET has the same value of the one provided in the environment settings page ?
Hello @jacques_liao,
Thank you for keeping us updated !
I’m marking the topic as solved temporarily. If you find that the solution suggested by @Enki doesn’t fix your problem, feel free to update the status.
Hello @Nicolas@Enki
it’s fine, I’m available to take up this subject which is still unresolved on my side.
As you can see, the .env file is in our Nostrum-forest folder, and when I run the command, it’s also in the same directory. However, I still get the not found error
I see that you have none of the required environment variables to make forest work.
During the onboarding, you should have seen a screen similar to this:
These environment variables need to be added to your .env
You can find the FOREST_ENV_SECRET in the details of an environment in the environment settings.
FOREST_AUTH_SECRET is used for user authentication and can be any value at the same format.
Can you add these to your .env and tell me if it solved your issue ?
Could you please ensure that you have the latest version of the forest-cli (by checking with forest -v, and upgrade if necessary).
Then try running forest environments again and see if you can find your environment among the listed projects. This command shouldnt require .env variables, only for you to be logged in to the correct user account.
Hello @Nicolas.M
I have forest-cli/4.3.1 darwin-arm64 node-v20.7.0
And for forest environments:
forest environments
Error: Not Found
at Request.callback (/opt/homebrew/lib/node_modules/forest-cli/node_modules/superagent/lib/node/index.js:857:15)
at /opt/homebrew/lib/node_modules/forest-cli/node_modules/superagent/lib/node/index.js:1100:20
at IncomingMessage.<anonymous> (/opt/homebrew/lib/node_modules/forest-cli/node_modules/superagent/lib/node/parsers/json.js:22:7)
at IncomingMessage.emit (node:events:526:35)
at endReadableNT (node:internal/streams/readable:1376:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
From previous event:
at PromiseRequest.then (/opt/homebrew/lib/node_modules/forest-cli/node_modules/superagent-promise/index.js:43:12)
at ProjectManager.getByEnvSecret (/opt/homebrew/lib/node_modules/forest-cli/dist/services/project-manager.js:41:14)
at withCurrentProject (/opt/homebrew/lib/node_modules/forest-cli/dist/services/with-current-project.js:13:53)
at async EnvironmentCommand.runAuthenticated (/opt/homebrew/lib/node_modules/forest-cli/dist/commands/environments.js:15:24)
at async EnvironmentCommand.run (/opt/homebrew/lib/node_modules/forest-cli/dist/abstract-authenticated-command.js:17:13)
at async EnvironmentCommand._run (/opt/homebrew/lib/node_modules/forest-cli/node_modules/@oclif/command/lib/command.js:29:20)
at async Config.runCommand (/opt/homebrew/lib/node_modules/forest-cli/node_modules/@oclif/config/lib/config.js:151:9)
at async Main.run (/opt/homebrew/lib/node_modules/forest-cli/node_modules/@oclif/command/lib/main.js:21:9)
at async Main._run (/opt/homebrew/lib/node_modules/forest-cli/node_modules/@oclif/command/lib/command.js:29:20
Hello,
The error that you are getting is highlighting the fact that you still have an incorrect FOREST_ENV_SECRET in your environment.
it is most probably due to the key FOREST_ENV_SECRET in the .env file in the directory where you are running the forest environments command.
Could you please provide with the first 4 and last 4 digits of this FOREST_ENV_SECRET so that I can check against our database that it exists and you have rights to access it ?
You can send it in private message if you prefer.