Cannot build due to app not reading env vars
Hello, i restrucutred my project because i needed to separate some logic to some packages. I got to the point where the packages are build, but the Astro app fails with the following error
Login required!
which basically means that the ASTRO_DB_APP_TOKEN
env var is missing. I've checked the build container and echo
ing the env vars seems OK, they both are printed out and set. If i attempt to build the application in the container with the env vars, everything seems fine (e.g. sudo ASTRO_DB_REMOTE_URL=db/dev.db ASTRO_DB_APP_TOKEN="" pnpm astro build --remote
).
Do i have something wrong?
The env var is supposed to be secret (see screenshot) and i have it in the zerops.yaml from runtime.

8 Replies
Log output from when i was trying some things:
In the build phase, runtime environment variables are available with
RUNTIME_
prefix.
$RUNTIME_ASTRO_DB_APP_TOKEN
This should take care of it, no? it always worked for me like that
Sorry I missed that.In your zerops.yml file.
I'll see if there's a problem. Give me a minute.
It works as expected.
Aaaa I see you are using
sudo
, try sudo -E
because sudo
doesn't propagate environment variables.
Ah yeah thats my bad, however if i push the project the build fails with the
login required
error, in the build container i just wanted to confirm that the app builds fine when it is done manually (which it does), for example now a pipeline 1k0B2uo9T4Kv7OSYfzLhvw
failed.
Well, maybe its the ASTRO_DB_REMOTE_URL
env var, when the app does not find it, it also wants me to login
oh for sure it's the ASTRO_DB_REMOTE_URL
not the other one, sorry for thatfile:db/dev.db
Is this value wrong?
file://db/dev/db
i see it is an issue with
turbo
, running standalone build works
Yeah my bad
https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#environment-modes
Sorry for the confusion here!