Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 deploys #34

Closed
mxstbr opened this issue Jul 11, 2017 · 24 comments · Fixed by #37
Closed

404 deploys #34

mxstbr opened this issue Jul 11, 2017 · 24 comments · Fixed by #37

Comments

@mxstbr
Copy link

mxstbr commented Jul 11, 2017

I just set up the new version of stage-ci and pushed to a PR, this is what I got:

stage-ci-issue

This links to <reponame>-<branchname>.now.sh which is great except that URL just shows a Zeit 404. 😢

404-deployment-not-found

Looking at the webhook everything is green, the stage-ci server replied with 200 OK. Any ideas what the culprit could be? /cc @paulirish

Sidenote: Now that we have the deployment API and have links to the deploys (:tada:) maybe there could be a way to turn off the "nice" names? For obfuscation reason I'd rather like having the default now pseudo-random URLs.

@hugomd
Copy link
Contributor

hugomd commented Jul 13, 2017

@mxstbr Does a deployment actually occur — does anything appear when you run now ls ?

If the version of now that stage-ci uses is pinned then nothing should have changed...

I'll try to replicate this locally ✌️

@mxstbr
Copy link
Author

mxstbr commented Jul 13, 2017

I'm running on a private repo maybe that why?

@mxstbr
Copy link
Author

mxstbr commented Jul 13, 2017

now ls doesn't show any deployments so maybe I put the wrong Zeit token in or somesuch?

@mxstbr
Copy link
Author

mxstbr commented Jul 13, 2017

Trying anew

@mxstbr
Copy link
Author

mxstbr commented Jul 13, 2017

Nope I have a completely new deploy of stage-ci, added the webhook and everything. It says "OK" in the webhook response but there's no deploy in now ls and the error message still shows

@mxstbr
Copy link
Author

mxstbr commented Jul 13, 2017

This is the log from the StageCI instance:

                > node ./src/server.js
07/13 09:45 AM
                Server listening on 3000...
07/13 11:00 AM  > Deploying org/repo@branch-name#asdf123ahfafgh834eg to https://project-branch-name.now.sh
07/13 11:00 AM  > Setting GitHub status to "pending"...
07/13 11:00 AM  > Cloning repository...
07/13 11:00 AM  > Fetching branch-name...
07/13 11:00 AM  > Checking out branch-name@asdf123ahfafgh834eg...
07/13 11:00 AM  > Setting GitHub status to "error"...
07/13 11:00 AM  Error: /bin/sh: 1:
                    at Socket.nowProc.stderr.on (/stage-ci/src/core.js:34:49)
                    at emitOne (events.js:101:20)
                    at Socket.emit (events.js:191:7)
                    at readableAddChunk (_stream_readable.js:178:18)
                    at Socket.Readable.push (_stream_readable.js:136:10)
                    at Pipe.onread (net.js:561:20)
07/13 11:00 AM  > Done!

@hugomd
Copy link
Contributor

hugomd commented Jul 14, 2017

@mxstbr I've managed to replicate this — I think it's an issue with git itself, or the wrapper around it (simple-git). I'll see if I can resolve it 👍

It being a private repository shouldn't be an issue either, as it uses the GitHub token to clone.

@hugomd
Copy link
Contributor

hugomd commented Jul 14, 2017

It's not a git issue — it gets to performing staging and fails on deployment somewhere, although it's hard to debug based on even my local error log...

I've got terribly slow internet at the moment, which is also making it difficult to debug, might be able to go to a coffee shop tomorrow to keep cracking this (amongst other things!)

✌️

@mxstbr
Copy link
Author

mxstbr commented Jul 14, 2017

Awesome, excited to get this resolved!

@paulirish
Copy link
Contributor

paulirish commented Jul 18, 2017

I can't reproduce this bug locally, but I've created a branch which has some extra logging so hopefully we can track this down:

master...paulirish:logging

Once change of note in here is going from nowProc.stdout.on('close', ... to nowProc.on('close', .... AFAICT, this fixes a potential bug. This branch also checks exit codes.

screenshot of extra logging:
image

@paulirish
Copy link
Contributor

Also worth pointing out that we're behind on the version of now. A bump to 7.2.4 may possibly resolve the bug here.

@Foxhunt
Copy link

Foxhunt commented Jul 19, 2017

also does this have anything to do with the Problem?
there is still a yarn.lock file in the deployment

@nikolaevigor
Copy link

I have the same issue with this PR: nikolaevigor/yard-frontend#29

@mxstbr
Copy link
Author

mxstbr commented Jul 20, 2017

I ran @paulirish' branch, these are the logs:

Server listening on 3000...
07/19 06:30 PM  > Setting GitHub status to "pending"...
07/19 06:30 PM  > Cloning repository...
07/19 06:30 PM  > Fetching branch-name...
07/19 06:30 PM  > Checking out branch-name@a123412341235ywhfsdg8f24gywsfh...
07/19 06:30 PM  > Executing:
      now
07/19 06:30 PM  > Setting GitHub status to "error"...
07/19 06:30 PM  Error: /bin/sh: 1: /stage-ci/node_modules/now/build/bin/now: not found

    at Socket.nowProc.stderr.on (/stage-ci/src/core.js:36:49)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:561:20)
07/19 06:30 PM  > Done!

Note: Seems like the nowProc.stderr.on fix did it

It looks like now isn't correctly installed? Let's try upgrading now maybe?

@paulirish
Copy link
Contributor

It looks like now isn't correctly installed? Let's try upgrading now maybe?

sg. you should be able to try that out locally pretty easily.

@mxstbr
Copy link
Author

mxstbr commented Jul 20, 2017

Upgrading to now@8.0.0-beta.1 throws the exact same error, so that's not the issue 😕

@paulirish
Copy link
Contributor

Something that stuck out to me was this line:

const nowBin = path.resolve('./node_modules/now/build/bin/now');

Maybe the path isn't reliable.. perhaps it may be more successful with something like this...

const nowBin = path.join(require.resolve('now'), '../../bin/now');

Just a stab in the dark here. :)

@mxstbr
Copy link
Author

mxstbr commented Aug 27, 2017

I have a public repo where this happening: styled-components/styled-components-website#74

@jaredpalmer
Copy link

@mxstbr Same thing happened to me today

@codeofsumit
Copy link

codeofsumit commented Sep 6, 2017

I got the same problem on a private repo. Completely new stage-ci setup
these are the logs:

09/06 04:50 PM (44s)
> Deploying codeofsumit/med-www@test-feature#4dc2418a3f174fca7232c7b1e20f854c11f30641 to https://med-www-test-feature.now.sh
09/06 04:50 PM (43s)
> Setting GitHub status to "pending"...
09/06 04:50 PM (43s)
> Fetching test-feature...
09/06 04:50 PM (43s)
> Checking out test-feature@4dc2418a3f174fca7232c7b1e20f854c11f30641...
09/06 04:50 PM (43s)
Error: /bin/sh: 1: 
    at Socket.nowProc.stderr.on (/stage-ci/src/core.js:34:49)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:561:20)
09/06 04:50 PM (43s)
> Setting GitHub status to "error"...
09/06 04:50 PM (42s)
> Done!

@SaraVieira
Copy link

SaraVieira commented Sep 9, 2017

I get the same problem on a public repo:

The logs:

> Setting GitHub status to "pending"...
09/09 11:41 PM (19m)
> Cloning repository...
09/09 11:41 PM (19m)
> Fetching now...
09/09 11:41 PM (19m)
> Checking out now@7f41e68c98f90074ebab4d4f6ed6d16b0ccaa814...
09/09 11:41 PM (19m)
> Setting GitHub status to "error"...
09/09 11:41 PM (19m)
Error: /bin/sh: 1: /stage-ci/node_modules/now/build/bin/now: not found

    at Socket.nowProc.stderr.on (/stage-ci/src/core.js:34:49)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:561:20)

https://zeit.co/saravieira/stage-ci/binxaephvp/logs

@hugomd
Copy link
Contributor

hugomd commented Nov 1, 2017

@mxstbr I've (hopefully) fixed this in #37, if you'd like to try it out, you can just checkout my branch:

git clone git@github.com:hugomd/stage-ci.git
cd stage-ci
git fetch && git checkout feature/use-now-cli-binary
now deploy --npm . -e ZEIT_API_TOKEN=YOUR_TOKEN_HERE -e GITHUB_TOKEN=YOUR_TOKEN_HERE -e GITHUB_WEBHOOK_SECRET=YOUR_SECRET

Not sure when/if it'll be merged in, I expect @zpnk is a bit busy!

@zpnk zpnk closed this as completed in #37 Nov 6, 2017
@infiniteluke
Copy link

Hi @zpnk - Thanks making this cool project OSS! I'm still seeing this issue after deploying master today.

screen shot 2017-11-07 at 4 14 24 pm

Maybe I'm missing something? I used the link at stage.now.sh to deploy to now, which uses master of stage-ci.

@hugomd
Copy link
Contributor

hugomd commented Nov 8, 2017

@infiniteluke Are you running this in Docker? If you are, I suspect the issue is that the npm build script isn't being run, it simply installs and then runs.

"build": "node ./src/build.js",

stage-ci/Dockerfile

Lines 7 to 14 in 408f6a0

COPY package.json .
RUN npm install --production
ADD . .
EXPOSE 3000
CMD npm start

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 a pull request may close this issue.

9 participants