amondnet/vercel-action

Deployment succeeds but action log says it failed

forde opened this issue · 23 comments

forde commented

HI.

The setup in my .yml file is:

name: Deployment

on:
  push:
    branches:
  - master

jobs:
 deploy:
 runs-on: ubuntu-latest
 steps:
  - uses: actions/checkout@v2
  - name: 'Set build id'
    id: build_id
    run: echo "::set-output name=id::$(date +%s)"

  - name: Deploy master branch
    if: github.ref == 'refs/heads/master'
    uses: amondnet/vercel-action@v19.0.1+2
    with:
      vercel-token: ${{ secrets.ZEIT_TOKEN }}
      vercel-args: '--prod -b BUILD=${{ steps.build_id.outputs.id }} -b BUILD_BRANCH=master -b ENVIRONMENT=production'
      vercel-org-id: ${{ secrets.ZEIT_ORG_ID }}
      vercel-project-id: ${{ secrets.ZEIT_PRODUCTION_PROJECT_ID }}

On push to master the action gets triggered but when it finishes action log says it failed (even tho code gets deployed and logs on vercel.com confirm succesful deployment)

Action logs:

https://*****************.vercel.app- Queued

- Queued

- Building

- Building

Production: https://***************** [3m]
Due to "builds" existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings

set preview-url output
/usr/local/bin/npx vercel inspect https://*****************.vercel.app -t ***
Vercel CLI 19.2.0

Vercel CLI 19.2.0
- Fetching deployment "https://*****************.vercel.app" in *****

- Fetching deployment "https://*****************.vercel.app" in *****

Error! Failed to find deployment "https://*****************.vercel.app" in *****

Error! Failed to find deployment "https://*****************.vercel.app" in *****
##[error]The process '/usr/local/bin/npx' failed with exit code 1

Any ideas?

same issue with such logs:
Снимок экрана 2020-08-07 в 14 38 24

I encountered the same:

Error! An unexpected error occurred in inspect: TypeError: Cannot read property 'split' of undefined
    at /usr/local/lib/node_modules/vercel/dist/index.js:2:650065
    at Array.reduce (<anonymous>)
    at A (/usr/local/lib/node_modules/vercel/dist/index.js:2:650029)
    at inspect_main (/usr/local/lib/node_modules/vercel/dist/index.js:2:655310)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at he (/usr/local/lib/node_modules/vercel/dist/index.js:2:375059)

However, the deployment was succesfully done. Retrying the same action results in the same error, so it's reproducable.

The same:

Error! An unexpected error occurred in inspect: TypeError: Cannot read property 'split' of undefined
91
    at S (/usr/local/lib/node_modules/vercel/dist/index.js:2:649236)
92
    at C (/usr/local/lib/node_modules/vercel/dist/index.js:2:649365)
93
    at Array.sort (<anonymous>)
94
    at A (/usr/local/lib/node_modules/vercel/dist/index.js:2:649999)
95
    at inspect_main (/usr/local/lib/node_modules/vercel/dist/index.js:2:655310)
96
    at runMicrotasks (<anonymous>)
97
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
98
    at he (/usr/local/lib/node_modules/vercel/dist/index.js:2:375059)
99
##[error]The process '/usr/local/bin/npx' failed with exit code 1

Same:

Error! An unexpected error occurred in inspect: TypeError: Cannot read property 'split' of undefined
    at /usr/local/lib/node_modules/vercel/dist/index.js:2:650065
    at Array.reduce (<anonymous>)
    at A (/usr/local/lib/node_modules/vercel/dist/index.js:2:650029)
    at inspect_main (/usr/local/lib/node_modules/vercel/dist/index.js:2:655310)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at he (/usr/local/lib/node_modules/vercel/dist/index.js:2:375059)

Error! An unexpected error occurred in inspect: TypeError: Cannot read property 'split' of undefined
    at /usr/local/lib/node_modules/vercel/dist/index.js:2:650065
    at Array.reduce (<anonymous>)
    at A (/usr/local/lib/node_modules/vercel/dist/index.js:2:650029)
    at inspect_main (/usr/local/lib/node_modules/vercel/dist/index.js:2:655310)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at he (/usr/local/lib/node_modules/vercel/dist/index.js:2:375059)
##[error]The process '/usr/local/bin/npx' failed with exit code 1

I'm getting a similar error with some differences:

Error! An unexpected error occurred in inspect: Error: val is not a non-empty string or a valid number. val=null
    at Object.e.exports [as default] (/usr/local/lib/node_modules/vercel/dist/index.js:2:1212562)
    at elapsed (/usr/local/lib/node_modules/vercel/dist/index.js:2:25757)
    at inspect_main (/usr/local/lib/node_modules/vercel/dist/index.js:2:655267)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at he (/usr/local/lib/node_modules/vercel/dist/index.js:2:375059)

Error! An unexpected error occurred in inspect: Error: val is not a non-empty string or a valid number. val=null
    at Object.e.exports [as default] (/usr/local/lib/node_modules/vercel/dist/index.js:2:1212562)
    at elapsed (/usr/local/lib/node_modules/vercel/dist/index.js:2:25757)
    at inspect_main (/usr/local/lib/node_modules/vercel/dist/index.js:2:655267)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at he (/usr/local/lib/node_modules/vercel/dist/index.js:2:375059)
##[error]The process '/usr/local/bin/npx' failed with exit code 1

The actual deployment on Vercel's end succeeds for me, too.

The project in question is here: https://github.com/joonashak/reclab-web (N.B., I'm currently deploying just the trunk)

I'm getting the same error
image

but the weird part is that the deployment in vercel finishes succesfully.

image

Looks to be similar to issue #28

So the GitHub Actions docs says I can set the secret ACTIONS_STEP_DEBUG to true and re-run actions to get more details. I did and then saw that this is the command being ran right before the error:

vercel inspect https://my-site.vercel.app --scope team_ABC123

Running that locally gives me the same error:

Error! An unexpected error occurred in inspect: TypeError: Cannot read property 'split' of undefined

I tried to update to the latest cli now@19.2.0 but had same error.

So this is happening during the vercel inspect usage - which happens after the vercel deploy so that's why deploys are still successful. This step is most likely used to get all the useful GitHub actions outputs like deploy url (which I love BTW!). When I ran this locally, it fails right before listing the "Builds" out - I'm guessing that is an array and the cli is basically trying to run builds.split('\n') but builds is undefined. Probably an API data structure change. PS This is why optional chaining is amazing b/c then builds?.split('\n') wouldn't crash the whole thing.

ScreenShot 2020-08-07 at 14 37 33@2x

I've contacted Vercel Support about this, as I believe this is an upstream issue.

@simonhaenisch did you get any update? contacted them as well, but didn't get any response yet.

Yeah they said it's an issue with the inspect command but they haven't updated me since.

Is there a GitHub issue on the https://github.com/vercel/vercel repo anyone has a link to?

Nope because they don't do bug tracing publicly anymore. Let me rephrase that, you can't open a bug report publicly anymore, unless you "ask for help" in their discussions.

Well that's a convenient way to appear less buggy 😠

That's annoying, I have to do manually deployment.

I've got a fork that is working for me (use EvanLovely/vercel-action@506f39d in GitHub Actions config to use/test) and have made a PR for it: #29

I've filled an issue about this as well, got in response:

Hello,

There is an issue with vercel inspect which we are currently fixing as we speak.

We will get back to you as soon as that is fixed.

It works for me now.

I've got a response from the Vercel support team

The issue has been fixed for all new deployments. We are working to make it compatible with old deployments as well.

vercel inspect seems to be working now but this vercel action still fails with Error! Failed to find deployment xxx in xxx.

Got the same response from support as well, and new deployments with this action are working again for us.

@simonhaenisch
By

new deployments

do you mean new pull requests (assuming you're using this action for deploying PR previews?)
It seems to be still broken for me when I'm triggering new workflow runs within the same PR.

We use it to manually deploy master to a staging environment. It works for new commits on master now. PR previews are done by the Github Integration.