5 months 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
5 months 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
5 months 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
5 months 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 ?
5 months 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 build ``` if 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](http://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 months 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.
5 months ago
i'm always happy to help
Status changed to Solved chandrika • 5 months ago

