a month ago
Constantly seeing this error with a Spring boot java app,
"failed to solve: secret spring not found"
Logs have nothing more than above. Any pointers on how to debug this?
Thanks
Attachments
Pinned Solution
a month ago
yes you can, the generated railpack-plan.json content shows up in your build logs. look for the section right BEFORE the line that says "load build definition from railpack-plan.json"
it'll show something like:
Packages
──────────
Steps
──────────
Deploy
──────────
Successfully prepared Railpack plan for buildif there's a secret called "spring" in the plan, it would be listed there.
also check if you have a Dockerfile in your repo with --mount=type=secret,id=spring or any references to ${spring} in your application.properties or application.yml files
if you find where "spring" is being referenced, you either need to add a "spring" variable in railway, or remove/fix that reference
5 Replies
a month ago
the error means you have a railpack-plan.json or railpack.json file that lists "spring" in the secrets array, but there's no variable called "spring" set in your railway service.
to solve this either add a "spring" variable in railway's variables tab, or remove "spring" from the secrets array in your config file.
BUT for spring boot apps, railway auto-detects everything and you probably don't need any railpack config file at all. try deleting railpack-plan.json / railpack.json completely and let railway handle it automatically
ilyassbreth
the error means you have a railpack-plan.json or railpack.json file that lists "spring" in the secrets array, but there's no variable called "spring" set in your railway service.to solve this either add a "spring" variable in railway's variables tab, or remove "spring" from the secrets array in your config file.BUT for spring boot apps, railway auto-detects everything and you probably don't need any railpack config file at all. try deleting railpack-plan.json / railpack.json completely and let railway handle it automatically
a month ago
I don't have any railpack config files in my repo. Seems like the build process is generating it's own railpack-plan.json file. Is there a way to inspect the contents of this generated file to debug ?
a month ago
yes you can, the generated railpack-plan.json content shows up in your build logs. look for the section right BEFORE the line that says "load build definition from railpack-plan.json"
it'll show something like:
Packages
──────────
Steps
──────────
Deploy
──────────
Successfully prepared Railpack plan for buildif there's a secret called "spring" in the plan, it would be listed there.
also check if you have a Dockerfile in your repo with --mount=type=secret,id=spring or any references to ${spring} in your application.properties or application.yml files
if you find where "spring" is being referenced, you either need to add a "spring" variable in railway, or remove/fix that reference
ilyassbreth
yes you can, the generated railpack-plan.json content shows up in your build logs. look for the section right BEFORE the line that says "load build definition from railpack-plan.json"it'll show something like:Packages ────────── Steps ────────── Deploy ────────── Successfully prepared Railpack plan for buildif there's a secret called "spring" in the plan, it would be listed there.also check if you have a Dockerfile in your repo with --mount=type=secret,id=spring or any references to ${spring} in your application.properties or application.yml filesif you find where "spring" is being referenced, you either need to add a "spring" variable in railway, or remove/fix that reference
a month ago
There were no variables called spring but there were variables that started with 'spring.' The dot '.' was the issue finally !! I replaced them with underscores _ and all was good. They were correctly referenced by my Spring app. Thanks for your help.
aldrinm
There were no variables called spring but there were variables that started with 'spring.' The dot '.' was the issue finally !! I replaced them with underscores _ and all was good. They were correctly referenced by my Spring app. Thanks for your help.
a month ago
i'm always happy to help
Status changed to Solved chandrika • about 1 month ago

