Strider-CD / strider

Open Source Continuous Integration & Deployment Server
http://strider-cd.github.io/
4.59k stars 432 forks source link

Cannot read property 'commands' of undefined #768

Open oliversalzburg opened 9 years ago

oliversalzburg commented 9 years ago

I get a lot of Cannot read property 'commands' of undefined errors during a run.

knownasilya commented 9 years ago

Is this during rebases

oliversalzburg commented 9 years ago

No, I wasn't rebasing. This was a fresh setup of Strider in combination with GitLab.

knownasilya commented 9 years ago

Do you have a callstack? Would like to know which phase is triggering the error.

oliversalzburg commented 9 years ago

@knownasilya I don't seem to be able to repro right now. It happened in a fresh installation.

I'm only seeing this right now, but it's probably a different issue:

oliversalzburg commented 9 years ago

Seems like ensureCommand is missing semicolons btw.

knownasilya commented 9 years ago

@oliversalzburg most of the code is not following a specific style guide. I've been slowly following the airbnb guide as I make changes. Eventually I want to setup eslint and fix all the code O.O

oliversalzburg commented 9 years ago

Yeah, sorry for not collecting more useful information when the error happens.

Whenever I set up a fresh Strider instance, I seem to be running into all kinds of weird issues that resolve themselves shortly after. In those situations I'm usually under a lot of time pressure and am battling with multiple issues.

If it happens again, I'll make sure to capture more useful information.

knownasilya commented 9 years ago

@oliversalzburg can you walk me through how you setup gitlab with Strider (I don't use gitlab and the plugin is a little raw - adds to huge todo list)?

oliversalzburg commented 9 years ago

@knownasilya I can try and reproduce this later at home, but it was a process involving a lot of trial-and-error. I'm not sure if I'll remember making the same mistakes again ;D

oliversalzburg commented 9 years ago

@knownasilya So, I'm trying to reproduce this, but I'm running into https://github.com/Strider-CD/strider-gitlab/issues/8 for now. I'll see if I can find the root of that one.

oliversalzburg commented 9 years ago

Alright, I got two more call stacks for the same error after setting up a fresh strider instance on my Windows desktop.

The git clone failed here, because I neglected to add the strider SSH key to GitLab though. But maybe this is already helping:

oliversalzburg commented 9 years ago

So, this is what I did (originally, I used our on-premise GitLab, but I would assume the public gitlab.com works just as well):

  1. Clone strider git clone git@github.com:Strider-CD/strider.git
  2. npm install
  3. bower install
  4. Set SERVER_NAME environment variable (http://localhost:3000)
  5. Add initial user node .bin/strider addUser
  6. Start strider node .bin/strider
  7. Log into strider
  8. Add GitLab account to my strider account
  9. Add a project from Gitlab to strider
    • Set it as a nodejs project
  10. Configure the project
    • Set node_modules caching to strict
  11. Deploy project
knownasilya commented 9 years ago

@oliversalzburg awesome! Thanks for hanging in there. This will make it much easier to debug.

oliversalzburg commented 9 years ago

I'm experiencing a similar issue right now that feels related.

I have set up all our projects fresh. When there are no builds running, I go to the project configuration and click Retest & Deploy, which sends me to the build page.

I have placed a breakpoint in the command.done handler of JobDataMonitor.prototype.statuses. Here, this.phase is undefined:

The full async stack trace is:

JobDataMonitor.statuses._.extend.command.done (app.js:2729)
JobMonitor.update (app.js:2822)
Emitter.emit (app.js:46010)
Socket.onevent (app.js:45554)
Socket.onpacket (app.js:45512)
module.exports (app.js:45872)
Emitter.emit (app.js:46010)
Manager.ondecoded (app.js:45070)
module.exports (app.js:45872)
Emitter.emit (app.js:46010)
Decoder.add (app.js:50621)
Manager.ondata (app.js:45060)
module.exports (app.js:45872)
Emitter.emit (app.js:46010)
Socket.onPacket (app.js:46628)
(anonymous function) (app.js:46446)
Emitter.emit (app.js:46010)
Transport.onPacket (app.js:47053)
Polling.onData.callback (app.js:47893)
(anonymous function) (app.js:49336)
exports.decodePayloadAsBinary (app.js:49335)
exports.decodePayload (app.js:49103)
Polling.onData (app.js:47897)
(anonymous function) (app.js:47481)
Emitter.emit (app.js:46010)
Request.onData (app.js:47629)
Request.onLoad (app.js:47700)
Request.create.xhr.onreadystatechange (app.js:47582)
XMLHttpRequest.send (async)
Request.create (app.js:47594)
Request (app.js:47517)
XHR.request (app.js:47448)
XHR.doPoll (app.js:47478)
Polling.poll (app.js:47867)
Polling.onData (app.js:47906)
(anonymous function) (app.js:47481)
Emitter.emit (app.js:46010)
Request.onData (app.js:47629)
Request.onLoad (app.js:47700)
Request.create.xhr.onreadystatechange (app.js:47582)
XMLHttpRequest.send (async)
Request.create (app.js:47594)
Request (app.js:47517)
XHR.request (app.js:47448)
XHR.doPoll (app.js:47478)
Polling.poll (app.js:47867)
Polling.doOpen (app.js:47811)
Transport.open (app.js:46988)
Socket.open (app.js:46418)
Socket (app.js:46300)
Socket (app.js:46235)
Manager.open.Manager.connect (app.js:44974)
Manager (app.js:44832)
Manager (app.js:44802)
lookup (app.js:44735)
module.exports (app.js:1817)
invoke (app.js:8253)
instantiate (app.js:8264)
$get (app.js:11561)
link (app.js:4266)
nodeLinkFn (app.js:10991)
compositeLinkFn (app.js:10385)
publicLinkFn (app.js:10281)
$get.boundTranscludeFn (app.js:10405)
controllersBoundTransclude (app.js:11012)
update (app.js:4224)
$get.Scope.$broadcast (app.js:17239)
(anonymous function) (app.js:3905)
deferred.promise.then.wrappedCallback (app.js:15848)
deferred.promise.then.wrappedCallback (app.js:15848)
(anonymous function) (app.js:15934)
$get.Scope.$eval (app.js:16960)
$get.Scope.$digest (app.js:16772)
$get.Scope.$apply (app.js:17064)
(anonymous function) (app.js:5734)
invoke (app.js:8253)
doBootstrap (app.js:5732)
bootstrap (app.js:5746)
angularInit (app.js:5655)
(anonymous function) (app.js:26236)
jQuery.Callbacks.fire (app.js:30682)
jQuery.Callbacks.self.fireWith (app.js:30794)
jQuery.extend.ready (app.js:31006)
completed (app.js:31037)
oliversalzburg commented 9 years ago

I can, however, not repro this issue at will. Partly due to #785

oliversalzburg commented 9 years ago

If I wait long enough I get a ton of these though. Here's more:

These all seem related and look like race conditions to me. I can't even tell where std is set on the job monitor.