You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bulk secrets creation from files fails on duplicate secrets.
Assume there is an .env file with some new secrets added. Attempt to create the secrets from that file fails if at least one of the secrets defined in the file already exists.
Current Behavior
Bulk secrets creation fails when at least one of the secrets in the batch already exist.
The error message for single secret failure is confusing and not too informative.
Expected behavior
Bulk secrets creation from file should skip already existing secrets and create only the new ones.
The error message for single secret failure should hide the underlying HTTP error code and be more user-friendly.
Reproducible example
Create some new secrets in ~/repo-secrets.env file and add them with garden cloud secrets create --from-file ~/repo-secrets.env.
Add some new entries to ~/repo-secrets.env file and rerun the secrets creation command. It will fail with the error:
> garden cloud secrets create --from-file ~/repo-secrets.envCreate secrets 🔒 ℹ garden → Initializing...ℹ garden-cloud → Connecting project...✔ garden-cloud → Readyℹ garden → Running in environment dev.true-customer-danieltaylorℹ secrets-command → Creating secrets...ℹ secrets-command → Creating secrets... → 1/10Encountered an unexpected Garden error. This is likely a bug 🍂You can help by reporting this on GitHub: https://github.com/garden-io/garden/issues/new?labels=bug,crash&template=CRASH.md&title=Crash%3A%20Response%20code%20409%20(Conflict)Please attach the following information to the bug report after making sure that the error message does not contain sensitive information:HTTPError: Response code 409 (Conflict) at Request.<anonymous> (file:///Users/danieltaylor/Library/Application%20Support/io.garden.garden/1715246255-NGojvKX.r/rollup/garden.mjs:226907:42) at Object.onceWrapper (node:events:634:26) at Request.emit (node:events:531:35) at Request.emit (node:domain:488:12) at Request._onResponseBase (file:///Users/danieltaylor/Library/Application%20Support/io.garden.garden/1715246255-NGojvKX.r/rollup/garden.mjs:226411:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Request._onResponse (file:///Users/danieltaylor/Library/Application%20Support/io.garden.garden/1715246255-NGojvKX.r/rollup/garden.mjs:226453:13)
Workaround
Use garden secrets update command with --upsert flag:
Garden Bonsai (0.13) Bug
Bulk secrets creation from files fails on duplicate secrets.
Assume there is an
.env
file with some new secrets added. Attempt to create the secrets from that file fails if at least one of the secrets defined in the file already exists.Current Behavior
Expected behavior
Reproducible example
Create some new secrets in
~/repo-secrets.env
file and add them withgarden cloud secrets create --from-file ~/repo-secrets.env
.Add some new entries to
~/repo-secrets.env
file and rerun the secrets creation command. It will fail with the error:Workaround
Use
garden secrets update
command with--upsert
flag:garden cloud secrets update --upsert --from-file ~/repo-secrets.env
Suggested solution(s)
Additional context
Consider implementing
--upsert
(or--overwrite
) flag for thegarden secrets create command
to overwrite the already existing secrets.Your environment
garden version 0.13.30
The text was updated successfully, but these errors were encountered: