Skip to content

secrets:decrypt-to-local always exits successfully, even when there were errors #57539

@petrisorciprian-vitals

Description

@petrisorciprian-vitals

Description

The secrets:decrypt-to-local command exits successfully, even when there are errors.
This seems to be by design, and was changed here:
#43137

Steps to reproduce:

  1. Do not set an env for the decryption key
  2. Run bin/console secrets:decrypt-to-local --force --env=prod
  3. Errors are printed, saying decryption failed.
  4. Inspect exit code (echo $?), it is 0.

This makes it very hard to have reliable usage in deployment scripts, as no matter if the command fails or not, it exits with code 0 (e.g. missing decryption key) -- for the moment I'm grepping the output to work around this.

I propose either that an appropriate exit code is returned when secrets are not decrypted properly.
This can be opt in, via a CLI flag (e.g. bin/console secrets:decrypt-to-local --force --env=prod --fail-on-errors).

Example

bin/console secrets:decrypt-to-local --force --env=prod **--fail-on-errors**
echo $? // prints 1 if there were errors

OR

bin/console secrets:decrypt-to-local --force --env=prod
echo $? // prints 1 if there were errors

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy