magalhas / atom-jenkins

Keep track of your jenkins builds inside Atom
MIT License
1 stars 4 forks source link

Uncaught TypeError: Cannot read property 'Project' of undefined #2

Open rdelassus opened 9 years ago

rdelassus commented 9 years ago

[Enter steps to reproduce below:]

  1. Toggle Jenkins

Atom Version: 0.177.0 System: linux 3.13.0-45-generic Thrown From: jenkins package, v0.3.1

Stack Trace

Uncaught TypeError: Cannot read property 'Project' of undefined

At events.js:94

TypeError: Cannot read property 'Project' of undefined
  at /home/remi/.atom/packages/jenkins/lib/jenkins-gateway.coffee:43:26
  at Parser.<anonymous> (/home/remi/.atom/packages/jenkins/node_modules/xml2js/lib/xml2js.js:425:18)
  at Parser.emit (events.js:116:17)
  at Object.onclosetag (/home/remi/.atom/packages/jenkins/node_modules/xml2js/lib/xml2js.js:394:26)
  at emit (/home/remi/.atom/packages/jenkins/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
  at emitNode (/home/remi/.atom/packages/jenkins/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
  at closeTag (/home/remi/.atom/packages/jenkins/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
  at Object.write (/home/remi/.atom/packages/jenkins/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
  at Parser.exports.Parser.Parser.parseString (/home/remi/.atom/packages/jenkins/node_modules/xml2js/lib/xml2js.js:444:31)
  at Parser.parseString (/home/remi/.atom/packages/jenkins/node_modules/xml2js/lib/xml2js.js:6:61)
  at Object.exports.parseString (/home/remi/.atom/packages/jenkins/node_modules/xml2js/lib/xml2js.js:476:19)
  at /home/remi/.atom/packages/jenkins/lib/jenkins-gateway.coffee:37:14
  at Request.<anonymous> (/home/remi/.atom/packages/jenkins/lib/jenkins-gateway.coffee:18:5)
  at Request.emit (events.js:119:17)
  at Request.mixin._fireSuccess (/home/remi/.atom/packages/jenkins/node_modules/restler/lib/restler.js:226:10)
  at /home/remi/.atom/packages/jenkins/node_modules/restler/lib/restler.js:158:20
  at IncomingMessage.parsers.auto (/home/remi/.atom/packages/jenkins/node_modules/restler/lib/restler.js:394:7)
  at Request.mixin._encode (/home/remi/.atom/packages/jenkins/node_modules/restler/lib/restler.js:195:29)
  at /home/remi/.atom/packages/jenkins/node_modules/restler/lib/restler.js:154:16
  at Request.mixin._decode (/home/remi/.atom/packages/jenkins/node_modules/restler/lib/restler.js:170:7)
  at IncomingMessage.<anonymous> (/home/remi/.atom/packages/jenkins/node_modules/restler/lib/restler.js:147:14)
  at IncomingMessage.emit (events.js:138:20)
  at _stream_readable.js:909:16
  at process._tickCallback (node.js:364:11)

Commands

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "seti-syntax"
    ],
    "disabledPackages": [
      "snippets",
      "symbols-view",
      "autocomplete-paths",
      "autocomplete-plus",
      "jenkins"
    ],
    "projectHome": "/home/remi/Documents/project"
  },
  "jenkins": {
    "password": "my_password",
    "username": "my_username",
    "url": "http://my_ip/job/my_job/"
  }
}

Installed Packages

# User
atom-python-debugger, v0.2.2
linter, v0.11.1
linter-pylint, v0.2.0
minimap, v4.3.0
minimap-color-highlight, v4.0.0
minimap-find-and-replace, v3.1.0
minimap-highlight-selected, v4.0.0
minimap-selection, v4.1.0
remote-edit, v1.6.4
seti-syntax, v0.3.3
seti-ui, v0.6.3
test-status, v0.27.1
wheel-zoom, v0.6.0

# Dev
No dev packages

/cc @atom/core

magalhas commented 9 years ago

Thanks for reporting. I'll take a look ASAP.

winstliu commented 9 years ago

It's come back with a vengeance. I'm getting these every 5 seconds now. Jenkins is up and running, version 1.607.

magalhas commented 9 years ago

Are you still facing this issue?

winstliu commented 9 years ago

Yes if the server is down long enough or if it's down right when you enable the package (which I happened to do). I noticed that you bumped the default interval up to one minute, but that still doesn't protect fully against the error. Perhaps you should do lastBuildStatus = project?.$.lastBuildStatus at https://github.com/magalhas/atom-jenkins/blob/master/lib/jenkins-gateway.coffee#L44? Just guessing here.

The constant erroring is gone now; not sure if that was just my Jenkins instance though.

winstliu commented 9 years ago

This also happens if your username/password is wrong, apparently. I thought there was a check against that but it doesn't look like it's working:

1000 events.js:141 Uncaught TypeError: Cannot read property 'Project' of undefined
140212 console messages are not shown.
2349 events.js:141 Uncaught TypeError: Cannot read property 'Project' of undefined

Where 1000 and 2349 are the number of errors...

magalhas commented 9 years ago

This hasn't been fixed yet.

aaronmcohen commented 6 years ago

still seeing this error.