Skip to content

Let Bref Cloud find the error of a failed serverless deploy - #61

Merged
mnapoli merged 1 commit into
mainfrom
osls-error-from-cloud
Sep 28, 2026
Merged

mnapoli merged 1 commit into
mainfrom
osls-error-from-cloud

Conversation

@mnapoli

@mnapoli mnapoli commented Sep 28, 2026

Copy link
Copy Markdown
Member

When serverless deploy fails, the CLI no longer looks for the error in the osls output. It sends no error message, and Bref Cloud finds the error in the deployment logs, which already contain the whole osls output.

Bref Cloud must be deployed first: with the current Bref Cloud, failed deployments would have no error message.

Why

The CLI sent the line that follows Error:, which is often not the useful one:

  • For a CloudFormation failure, it is CREATE_FAILED: HelloLambdaFunction (AWS::Lambda::Function), and AWS's reason is on the next line.
  • For an unresolved variable, it is Cannot resolve serverless.yml: Variables resolution errored with:, and the variable is on the next line.

Bref Cloud can be fixed without a CLI release, and the change reaches every CLI version: it replaces the line older CLIs send with the whole error.

Also removed

The check for a missing npx never matched: it looked for npo: command not found. Bref Cloud now adds that hint from the logs. It matches the shell errors of bash (npx: command not found) and dash/busybox (npx: not found).

Tested

Tested against Bref Cloud with the server side of this change:

  • An unresolved variable prints the whole osls error, with this branch and with the current release:

    Serverless Framework error: Cannot resolve serverless.yml: Variables resolution errored with:
      - Cannot resolve variable at "provider.environment.API_KEY": Value not found at "env" source
    
  • Without npx in the PATH:

    The "serverless deploy" command failed: see the deployment logs.
    
    NPM is not installed: deploying a serverless.yml application requires Node.js and NPM. Install them: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
    

The CLI sent the line after `Error:` in the osls output as the deployment's error message,
which is often not the useful one: for a CloudFormation failure, AWS's reason is on the next
line. The whole osls output is already pushed as the deployment's logs, so Bref Cloud now
finds the error there, and the CLI sends none when osls fails.

This also removes the check for a missing `npx`, which never matched (it looked for
`npo: command not found`): Bref Cloud adds that hint instead.

Claude-Session: https://claude.ai/code/session_01Awk33iZ9mDSg1xgSAPkgGK
@mnapoli
mnapoli merged commit 40c7162 into main Sep 28, 2026
4 checks passed
@mnapoli
mnapoli deleted the osls-error-from-cloud branch September 28, 2026 14:14
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.

1 participant