When deploying with both --verbose and disableRollback: true, the CLI hangs indefinitely after a CloudFormation resource fails. Without --verbose the failure is reported immediately.
This was originally reported in serverless/serverless#12770 and a fix was proposed in serverless/serverless#12772, but it was never merged upstream.
Steps to reproduce
- Set
disableRollback: true in the provider config:
provider:
name: aws
disableRollback: true
- Deploy with
--verbose:
serverless deploy --verbose
- Trigger any resource failure (e.g. an
ApiGatewayDeployment that fails to create).
Expected behavior
The CLI should detect the failure and exit with an error, same as it does without --verbose.
Actual behavior
The CLI hangs forever. The CloudFormation stack lands in UPDATE_FAILED (or CREATE_FAILED), and because disableRollback is enabled, no rollback occurs — the stack never transitions to ROLLBACK_COMPLETE, DELETE_FAILED, or DELETE_COMPLETE.
Root cause
In lib/plugins/aws/lib/monitor-stack.js, the error-throwing condition when --verbose is active waits for a terminal status:
if (
stackLatestError &&
(!this.options.verbose ||
(stackStatus &&
(stackStatus.endsWith('ROLLBACK_COMPLETE') ||
['DELETE_FAILED', 'DELETE_COMPLETE'].includes(stackStatus))))
)
With disableRollback: true, the stack status stays at UPDATE_FAILED or CREATE_FAILED — neither of which matches the condition above. The monitor loop keeps polling forever.
Proposed fix
Add CREATE_FAILED and UPDATE_FAILED to the status check:
['CREATE_FAILED', 'UPDATE_FAILED', 'DELETE_FAILED', 'DELETE_COMPLETE'].includes(stackStatus)
This way the CLI exits on failure regardless of whether rollback is enabled.
Environment
- osls 3.63.2
- Node.js 24.x
- macOS / Linux
When deploying with both
--verboseanddisableRollback: true, the CLI hangs indefinitely after a CloudFormation resource fails. Without--verbosethe failure is reported immediately.This was originally reported in serverless/serverless#12770 and a fix was proposed in serverless/serverless#12772, but it was never merged upstream.
Steps to reproduce
disableRollback: truein the provider config:--verbose:ApiGatewayDeploymentthat fails to create).Expected behavior
The CLI should detect the failure and exit with an error, same as it does without
--verbose.Actual behavior
The CLI hangs forever. The CloudFormation stack lands in
UPDATE_FAILED(orCREATE_FAILED), and becausedisableRollbackis enabled, no rollback occurs — the stack never transitions toROLLBACK_COMPLETE,DELETE_FAILED, orDELETE_COMPLETE.Root cause
In
lib/plugins/aws/lib/monitor-stack.js, the error-throwing condition when--verboseis active waits for a terminal status:With
disableRollback: true, the stack status stays atUPDATE_FAILEDorCREATE_FAILED— neither of which matches the condition above. The monitor loop keeps polling forever.Proposed fix
Add
CREATE_FAILEDandUPDATE_FAILEDto the status check:This way the CLI exits on failure regardless of whether rollback is enabled.
Environment