edsu / anon

tweet about anonymous Wikipedia edits from particular IP address ranges
Creative Commons Zero v1.0 Universal
975 stars 152 forks source link

Script crashing after processing several hundred edits #114

Closed parlieditsza closed 9 years ago

parlieditsza commented 10 years ago

As mentioned on the chat. Here is the Stack trace. I've replaced the path to anon repo with [path]:

loaded config from ./config.json
[path]/anon/node_modules/wikichanges/node_modules/irc/lib/irc.js:672
                    throw err;
                          ^
TypeError: Cannot read property 'compareTo' of undefined
  at compareIps ([path]/anon/anon.coffee:28:19)
  at isIpInRange ([path]/anon/anon.coffee:38:5)
  at [path]/anon/anon.coffee:45:28
  at Array.filter (native)
  at isIpInAnyRange ([path]/anon/anon.coffee:45:10)
  at inspect ([path]/anon/anon.coffee:105:12)
  at [path]/anon/anon.coffee:136:11
  at Client. ([path]/anon/node_modules/wikichanges/wikichanges.js:34:9)
  at Client.emit (events.js:118:17)
  at Client. ([path]/anon/node_modules/wikichanges/node_modules/irc/lib/irc.js:477:22)
  at Client.emit (events.js:107:17)
  at [path]/anon/node_modules/wikichanges/node_modules/irc/lib/irc.js:669:22
  at Array.forEach (native)
  at Socket. ([path]/anon/node_modules/wikichanges/node_modules/irc/lib/irc.js:666:15)
  at Socket.emit (events.js:107:17)
  at readableAddChunk (_stream_readable.js:161:16)
  at Socket.Readable.push (_stream_readable.js:128:10)
  at TCP.onread (net.js:514:20)

Appears to be a network issue? We're on an Amazon instance if that's relevant.

edsu commented 10 years ago

Thanks. What version of node are you running?

parlieditsza commented 10 years ago

The latest version from the repository. Output from git describe --tags is "v0.0.5-11-g0087da2"

edsu commented 10 years ago

I was more interested in the version of node:

node --version
parlieditsza commented 10 years ago

Sorry, reading too fast. The node is "v0.11.14-pre"

edsu commented 10 years ago

Can you share the ranges stanza from your config.json?

parlieditsza commented 10 years ago
"ranges": {
        "South African Parliament": [
        ["196.2.60.32","196.2.60.47"]
        ],
        "South African National Government":[
        ["164.146.0.0","164.151.255.255"]
        ]
      }
EmilGus commented 10 years ago

I have the exact same problem, same stack trace. Began when upgrading to v0.0.5 Node v0.10.29 Downgraded to v0.0.4 and It works fine.

parlieditsza commented 10 years ago

Interesting, OK I'll downgrade to 0.0.4 for the meanwhile.

parlieditsza commented 10 years ago

Still getting the issue with 0.0.4.

parlieditsza commented 10 years ago

To keep things up I using a short Python script:

#!/usr/bin/python
import subprocess
while(True):
        try: subprocess.check_output(["./anon.coffee"])
        except: print("Crash!")
EmilGus commented 10 years ago

Yeah, I was too early. I still have problems with 0.0.4 too.

This is the stack trace for v0.0.4

[path]node_modules/wikichanges/node_modules/irc/lib/irc.js:672 throw err; ^ TypeError: Cannot read property '1' of null at parse_msg ([path]node_modules/wikichanges/wikichanges.js:55:48) at Client. ([path]node_modules/wikichanges/wikichanges.js:32:15) at Client.emit (events.js:106:17) at Client. ([path]node_modules/wikichanges/node_modules/irc/lib/irc.js:477:22) at Client.emit (events.js:95:17) at [path]node_modules/wikichanges/node_modules/irc/lib/irc.js:669:22 at Array.forEach (native) at Socket. (/home/pi/anon/node_modules/wikichanges/node_modules/irc/lib/irc.js:666:15) at Socket.emit (events.js:95:17) at Socket. (_streamreadable.js:748:14) at Socket.emit (events.js:92:17) at emitReadable (_stream_readable.js:410:10) at emitReadable (_stream_readable.js:406:5) at readableAddChunk (_stream_readable.js:168:9) at Socket.Readable.push (_stream_readable.js:130:10) at TCP.onread (net.js:528:21)

Thank you for the code snippet. Very useful!

pedrofelipe commented 10 years ago

I'm experiencing the same problem. After dozens of edits, it crashes with the same error.

[root@wiki anon]# node --version v0.10.29

edsu commented 10 years ago

I don't quite understand why we don't all crash out after a dozen edits ; we all see the same stream. Perhaps it's just luck. I'm going to address this over in https://github.com/edsu/wikichanges/issues/8