strider icon indicating copy to clipboard operation
strider copied to clipboard

Unexpected server error: -302 undefined undefined undefined Error

Open pedrofranceschi opened this issue 13 years ago • 34 comments

Hi,

I'm trying to use Strider with my project, but after running npm install, the server logs this error:

4 Aug 12:48:20 - info: Got new job
4 Aug 12:48:20 - info: Processing job 51fe77c4b1540f6fe900000a
4 Aug 12:48:20 - info: running command rm -rf /Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject; mkdir -p /Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject undefined
4 Aug 12:48:20 - info: done with sh [ '-c',
  'rm -rf /Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject; mkdir -p /Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject' ] 0
4 Aug 12:48:28 - info: collecting phases
4 Aug 12:48:28 - info: skipping deploy phase; test run
4 Aug 12:48:28 - info: Running phase prepare
4 Aug 12:48:28 - info: running command sh [ '-c', 'npm install' ]
4 Aug 12:53:31 - info: api.jobs
4 Aug 12:59:27 - info: Done with phase prepare { phase: 'prepare', code: -302, tasks: undefined }
4 Aug 12:59:27 - info: finished with all phases
4 Aug 12:59:27 - info: Running phase cleanup
4 Aug 12:59:27 - info: running command sh [ '-c', 'echo "cleanup...";' ]
4 Aug 12:59:27 - info: Done with phase cleanup null
4 Aug 12:59:27 - error: Unexpected server error: -302 undefined undefined undefined Error
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/job.js:80:101)
    at EventEmitter.emit (events.js:95:17)
    at Function.<anonymous> (/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/worker.js:100:16)
    at next (/usr/local/lib/node_modules/strider/node_modules/step/lib/step.js:51:23)
    at /usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/utils.js:207:11
    at /usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/utils.js:194:11
    at /usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:190:13
    at /usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:116:25
    at /usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:187:17
    at /usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:491:34
4 Aug 12:59:27 - info: done 500
4 Aug 12:59:27 - info: done 0

The web console tells me this:

[STRIDER] $ echo "cleanup...";
strider $ echo "cleanup...";
cleanup...
[STRIDER] Custom cleanup command `echo "cleanup...";` failed with exit code -302
[STRIDER] ERROR Worker error occurred. Please report this to https://github.com/Strider-CD/strider/. Thank you.

If I remove my cleanup command, it keeps failing too.

What can I do to fix this bug? I'd really like to try Strider.

Thanks,

Pedro

pedrofranceschi avatar Aug 04 '13 16:08 pedrofranceschi

Ah interesting. I think I know where that's coming from. For now, how about you go with the last release (1.3.2) I think that should work for you. Or you could try the docker install; that's a great way to try out strider.

Pedro Franceschi [email protected] wrote:

Hi,

I'm trying to use Strider with my project, but after running npm install, the server logs this error:

4 Aug 12:48:20 - info: Processing job 51fe77c4b1540f6fe900000a
4 Aug 12:48:20 - info: running command rm -rf
/Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject;
mkdir -p
/Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject
undefined
4 Aug 12:48:20 - info: done with sh [ '-c',
'rm -rf
/Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject;
mkdir -p
/Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject' ]
0
4 Aug 12:48:28 - info: collecting phases
4 Aug 12:48:28 - info: skipping deploy phase; test run
4 Aug 12:48:28 - info: Running phase prepare
4 Aug 12:48:28 - info: running command sh [ '-c', 'npm install' ]
4 Aug 12:53:31 - info: api.jobs
4 Aug 12:59:27 - info: Done with phase prepare { phase: 'prepare',
code: -302, tasks: undefined }
4 Aug 12:59:27 - info: finished with all phases
4 Aug 12:59:27 - info: Running phase cleanup
4 Aug 12:59:27 - info: running command sh [ '-c', 'echo "cleanup...";'
]
4 Aug 12:59:27 - info: Done with phase cleanup null
4 Aug 12:59:27 - error: Unexpected server error: -302 undefined
undefined undefined Error
at EventEmitter.<anonymous>
(/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/job.js:80:101)
   at EventEmitter.emit (events.js:95:17)
at Function.<anonymous>
(/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/worker.js:100:16)
at next
(/usr/local/lib/node_modules/strider/node_modules/step/lib/step.js:51:23)
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/utils.js:207:11
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/utils.js:194:11
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:190:13
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:116:25
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:187:17
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:491:34
4 Aug 12:59:27 - info: done 500
4 Aug 12:59:27 - info: done 0

The web console tells me this:

strider $ echo "cleanup...";
cleanup...
[STRIDER] Custom cleanup command `echo "cleanup...";` failed with exit
code -302
[STRIDER] ERROR Worker error occurred. Please report this to
https://github.com/Strider-CD/strider/. Thank you.```

If I remove my cleanup command, it keeps failing too.

What can I do to fix this bug? I'd really like to try Strider.

Thanks,

Pedro

---
Reply to this email directly or view it on GitHub:
https://github.com/Strider-CD/strider/issues/162

Sent from my Android device with K-9 Mail. Please excuse my brevity.

jaredly avatar Aug 04 '13 18:08 jaredly

Actually, I'm using 1.3.2 and I'm getting this bug.

Docker is an option, but I'ld like to use Strider locally because I want to be able to contribute with the project too.

On Aug 4, 2013, at 3:19 PM, Jared Forsyth [email protected] wrote:

Ah interesting. I think I know where that's coming from. For now, how about you go with the last release (1.3.2) I think that should work for you. Or you could try the docker install; that's a great way to try out strider.

Pedro Franceschi [email protected] wrote:

Hi,

I'm trying to use Strider with my project, but after running npm install, the server logs this error:

4 Aug 12:48:20 - info: Processing job 51fe77c4b1540f6fe900000a
4 Aug 12:48:20 - info: running command rm -rf
/Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject;
mkdir -p
/Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject
undefined
4 Aug 12:48:20 - info: done with sh [ '-c',
'rm -rf
/Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject;
mkdir -p
/Users/pedrofranceschi/.strider/51fdf19a4ecd4166db000008.testproject' ]
0
4 Aug 12:48:28 - info: collecting phases
4 Aug 12:48:28 - info: skipping deploy phase; test run
4 Aug 12:48:28 - info: Running phase prepare
4 Aug 12:48:28 - info: running command sh [ '-c', 'npm install' ]
4 Aug 12:53:31 - info: api.jobs
4 Aug 12:59:27 - info: Done with phase prepare { phase: 'prepare',
code: -302, tasks: undefined }
4 Aug 12:59:27 - info: finished with all phases
4 Aug 12:59:27 - info: Running phase cleanup
4 Aug 12:59:27 - info: running command sh [ '-c', 'echo "cleanup...";'
]
4 Aug 12:59:27 - info: Done with phase cleanup null
4 Aug 12:59:27 - error: Unexpected server error: -302 undefined
undefined undefined Error
at EventEmitter.<anonymous>
(/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/job.js:80:101)
at EventEmitter.emit (events.js:95:17)
at Function.<anonymous>
(/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/worker.js:100:16)
at next
(/usr/local/lib/node_modules/strider/node_modules/step/lib/step.js:51:23)
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/utils.js:207:11
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/lib/utils.js:194:11
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:190:13
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:116:25
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:187:17
at
/usr/local/lib/node_modules/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:491:34
4 Aug 12:59:27 - info: done 500
4 Aug 12:59:27 - info: done 0

The web console tells me this:

strider $ echo "cleanup...";
cleanup...
[STRIDER] Custom cleanup command `echo "cleanup...";` failed with exit
code -302
[STRIDER] ERROR Worker error occurred. Please report this to
https://github.com/Strider-CD/strider/. Thank you.```

If I remove my cleanup command, it keeps failing too.

What can I do to fix this bug? I'd really like to try Strider.

Thanks,

Pedro

---
Reply to this email directly or view it on GitHub:
https://github.com/Strider-CD/strider/issues/162

Sent from my Android device with K-9 Mail. Please excuse my brevity. — Reply to this email directly or view it on GitHub.

pedrofranceschi avatar Aug 04 '13 18:08 pedrofranceschi

That's fantastic! So I just tried to reproduce this on v 1.3.2, and wasn't able to. What os & version of node are you using? That -302 exit code indicates that the pseudoterminal isn't correctly reporting the exit code of the command run ... can't imagine what would cause that though. I'm on OSX 10.7.5, tested with node 0.8.25. looking at 0.10 now

jaredly avatar Aug 04 '13 19:08 jaredly

I'm using Node 0.10.12 and OS X 10.8.3.

Thanks.

On Aug 4, 2013, at 4:05 PM, Jared Forsyth [email protected] wrote:

That's fantastic! So I just tried to reproduce this on v 1.3.2, and wasn't able to. What os & version of node are you using? That -302 exit code indicates that the pseudoterminal isn't correctly reporting the exit code of the command run ... can't imagine what would cause that though. I'm on OSX 10.7.5, tested with node 0.8.25. looking at 0.10 now

— Reply to this email directly or view it on GitHub.

pedrofranceschi avatar Aug 04 '13 19:08 pedrofranceschi

Ah. Just got the error using 0.10.15. So strange. I'll see what I can do.

jaredly avatar Aug 04 '13 19:08 jaredly

That's awesome, thanks!

On Aug 4, 2013, at 4:10 PM, Jared Forsyth [email protected] wrote:

Ah. Just got the error using 0.10.15. So strange. I'll see what I can do.

— Reply to this email directly or view it on GitHub.

pedrofranceschi avatar Aug 04 '13 19:08 pedrofranceschi

Now it does look like the builds are passing, though [even with the ugly error]. Is that what's happening with you?

jaredly avatar Aug 04 '13 19:08 jaredly

Ok, the npm registry is really unreliable atm, and I have to go. I should be able to get this nailed down tomorrow.

jaredly avatar Aug 04 '13 20:08 jaredly

I see the bug. Fixing now.

niallo avatar Aug 04 '13 20:08 niallo

@pedrofranceschi please delete your node_modules and re-install. I just fixed a bug in pty.js:

https://github.com/niallo/pty.js/commit/1586aae0c19246e931d2d79d2b99208828532449

niallo avatar Aug 04 '13 20:08 niallo

That's weird... After reinstalling, I still get this error in console:

4 Aug 20:14:21 - error: Unexpected server error: -302 undefined undefined undefined Error
    at EventEmitter.<anonymous> (/Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/strider-simple-worker/lib/job.js:80:101)
    at EventEmitter.emit (events.js:95:17)
    at Function.<anonymous> (/Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/strider-simple-worker/lib/worker.js:100:16)
    at next (/Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/step/lib/step.js:51:23)
    at /Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/strider-simple-worker/lib/utils.js:207:11
    at /Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/strider-simple-worker/lib/utils.js:194:11
    at /Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:190:13
    at /Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:116:25
    at /Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:187:17
    at /Users/pedrofranceschi/Desktop/TUDO/strider/node_modules/strider-simple-worker/node_modules/async/lib/async.js:491:34

pedrofranceschi avatar Aug 04 '13 23:08 pedrofranceschi

Can you confirm you have the version of pty.js with my commit in it? If you rm -rf strider-simple-worker under node_modules and re-run npm install I think it should pull it in.

EDIT: wait, actually I am still seeing this myself locally on a different mac. investigating more.

niallo avatar Aug 04 '13 23:08 niallo

Ok I think something (probably node) is replacing our SIGCHLD handler under certain conditions sigh.

niallo avatar Aug 05 '13 00:08 niallo

yeah that's what I just found too. :( should we go back to the "echo $?" hack until things get sorted out?

On Sun, Aug 4, 2013 at 6:03 PM, niallo [email protected] wrote:

Ok I think something (probably node) is replacing our SIGCHLD handler under certain conditions sigh.

— Reply to this email directly or view it on GitHubhttps://github.com/Strider-CD/strider/issues/162#issuecomment-22081803 .

jaredly avatar Aug 05 '13 00:08 jaredly

I just confirmed and I'm in the latest version of pty.js.

On Aug 4, 2013, at 9:06 PM, Jared Forsyth [email protected] wrote:

yeah that's what I just found too. :( should we go back to the "echo $?" hack until things get sorted out?

On Sun, Aug 4, 2013 at 6:03 PM, niallo [email protected] wrote:

Ok I think something (probably node) is replacing our SIGCHLD handler under certain conditions sigh.

— Reply to this email directly or view it on GitHubhttps://github.com/Strider-CD/strider/issues/162#issuecomment-22081803 .

— Reply to this email directly or view it on GitHub.

pedrofranceschi avatar Aug 05 '13 00:08 pedrofranceschi

Ah, it looks like if you run a child_process (in node 0.10!) it reinstalls the sigchld handler. Clever them.

On Sun, Aug 4, 2013 at 6:06 PM, Jared Forsyth [email protected] wrote:

yeah that's what I just found too. :( should we go back to the "echo $?" hack until things get sorted out?

On Sun, Aug 4, 2013 at 6:03 PM, niallo [email protected] wrote:

Ok I think something (probably node) is replacing our SIGCHLD handler under certain conditions sigh.

— Reply to this email directly or view it on GitHubhttps://github.com/Strider-CD/strider/issues/162#issuecomment-22081803 .

jaredly avatar Aug 05 '13 00:08 jaredly

Yeah. There isn't anything we can do other than hack libuv to tell it about our child process I think. The pty.js approach is just broken.

I'm not happy with the exit $? hack because it doesn't always work.

niallo avatar Aug 05 '13 00:08 niallo

No, I think we can just reinstall ours whenever a new pty term is created. Right? (trying now)

On Sun, Aug 4, 2013 at 6:13 PM, niallo [email protected] wrote:

Yeah. There isn't anything we can do other than hack libuv to tell it about our child process I think. The pty.js approach is just broken.

I'm not happy with the exit $? hack because it doesn't always work.

— Reply to this email directly or view it on GitHubhttps://github.com/Strider-CD/strider/issues/162#issuecomment-22081933 .

jaredly avatar Aug 05 '13 00:08 jaredly

No, because what's to stop a child_process call in between us creating ours and it finishing? There is a race condition.

niallo avatar Aug 05 '13 00:08 niallo

I mean something like this in PtyFork() will "work" but there is still a race condition:

      // retrieve current SIGCHLD handler.
      struct sigaction cur_action;
      cur_action.sa_flags = SA_SIGINFO;
      sigaction(SIGCHLD, NULL, &cur_action);
      if (cur_action.sa_sigaction != sigChldHandler) {
        printf("think our SIGCHLD handler has been replaced\n");
        node_sighandler = cur_action.sa_handler;
        struct sigaction action;
        memset (&action, '\0', sizeof(action));
        action.sa_sigaction = sigChldHandler;
        action.sa_flags = SA_SIGINFO;
        action.sa_flags |= SA_NOCLDSTOP;
        // set new SIGCHLD handler. this will call node/libuv's handler at the end.
        sigaction(SIGCHLD, &action, NULL);
      }



niallo avatar Aug 05 '13 00:08 niallo