Skip to content

fix: resolve silent failures in 'algokit project deploy' by improving error logging#718

Open
Tusharkhadde wants to merge 1 commit intoalgorandfoundation:mainfrom
Tusharkhadde:fix/silent-deploy-failure
Open

fix: resolve silent failures in 'algokit project deploy' by improving error logging#718
Tusharkhadde wants to merge 1 commit intoalgorandfoundation:mainfrom
Tusharkhadde:fix/silent-deploy-failure

Conversation

@Tusharkhadde
Copy link
Copy Markdown

Description

This PR resolves an issue where algokit project deploy would fail silently when errors occurred in the deployment configuration (e.g., an ImportError in deploy_config.py).

The silent failure was primarily caused by two factors:

  1. Encoding Sensitivity: Subprocess output containing non-UTF-8 characters could cause the output reader to crash, silencing the error.
  2. Missing Error Fallback: The deploy command lacked an explicit fallback to display captured subprocess output when a failure occurred, relying solely on real-time logging which could be suppressed or interrupted.

Changes

  • src/algokit/core/proc.py: Added errors="backslashreplace" to proc.run to ensure that decoding errors in subprocess output are handled gracefully rather than crashing the CLI.
  • src/algokit/cli/project/deploy.py: Added explicit logging of the captured subprocess output (at the ERROR level) whenever the deployment command exits with a non-zero code. This aligns the behavior with the project run command.

Verification

Verified using a reproduction script that triggers an ImportError and produces non-UTF-8 output. The CLI now correctly displays the Python traceback and error context even if real-time logging is insufficient.

Related Issues

Closes #710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deployment command is failing silently

1 participant