omaralvarez / deluge-autoremoveplus

Auto removing of deluge torrents
152 stars 61 forks source link

"Uncaught TypeError: Cannot read property 'get_remove_rules' of undefined" #24

Closed dgw closed 8 years ago

dgw commented 8 years ago

This is with deluged 1.3.13 and AutoRemovePlus 0.6-py2.7.

The error appears in the browser JavaScript console, tagged autoremoveplus.js:152. Deluge's Web UI appears not to finish loading; most of the buttons are disabled, and there are no filters or extra panes (Status, Trackers, etc.) added to the left sidebar. This error seems to completely stop the Web UI from initializing. At least I can open Preferences and disable AutoRemovePlus under Plugins, and the Web UI loads properly on page refresh.

I've looked in all the places I know how (mostly .config/deluge/deluged.log) for errors that would point to the source of this issue, but the log files are empty. Happy to keep poking at this if you can't reproduce and need more info; just tell me where to look. 😄

omaralvarez commented 8 years ago

They must have changed something in the Web UI, I haven't tested 1.3.13, let me take a look and I will get back to you.

dgw commented 8 years ago

Hmm, I've been on 1.3.13 for a while now, and this issue only appeared after installing plugin 0.6. Start with those changes between 0.5.1 and 0.6?

omaralvarez commented 8 years ago

Ok, perfect. That narrows my search. Thx!

omaralvarez commented 8 years ago

So, I could not reproduce your error in my system, but seeing the error, I believe this fix will work. Please test the attached egg and tell me if the error persists. AutoRemovePlus-0.6-py2.7.egg.zip

dgw commented 8 years ago

The error has moved to line 527 of the same .js file.

I'm starting to think there's something wrong with my Deluge installation. Something might have gotten corrupted when the server's disk filled up yesterday. It's also not saving core preferences, like download directory and queue sizes, across service deluged restarts.

Let me get back to you again after I've had a chance to wipe Deluge's configuration and start over.

dgw commented 8 years ago

I've gone through removing Deluge's config (mv .config/ .config.bak/) and even done apt-get install --reinstall deluge-web deluged. The error will not go away. Sometimes I can get the WebUI to load the first time after the server is started, when the client displays the connection dialog, because there is no default client set. But thereafter this JS error prevents the WebUI from loading after page refreshes.

On the plus side, it appears to be saving settings across restarts again, so my installation must be less screwed up than it was before…

omaralvarez commented 8 years ago

Could you tell me what browser are you using?

dgw commented 8 years ago

Chrome 52, OS X 10.10.5

omaralvarez commented 8 years ago

Just out of curiosity. Are you running a local server or connecting remotely. And could you also test if 0.5.1 is still working. I haven't been able to reproduce the issue...

dgw commented 8 years ago

Remote server, running Ubuntu 14.04.

I went back to 0.5.1 at one point, but probably didn't stay on it long enough to answer conclusively. I will try that for real later tonight.

dgw commented 8 years ago

0.5.1 doesn't seem to have the WebUI issue, no. Loads up fine, shows the preferences section, sidebar filters, torrent list, etc. Only one entry in the JavaScript console log under 0.5.1: autoremoveplus.js:602 AutoRemovePlus enabled.

Environment is otherwise the same (Ubuntu 14.04 running Deluge 1.3.13, OS X 10.10 running WebUI in Chrome 52).

omaralvarez commented 8 years ago

Perfect, I now am sure why this is happening. I will upload the egg in a little bit for you guys to test.

omaralvarez commented 8 years ago

Coul you guys test this fix? AutoRemovePlus-0.6-py2.7.egg 2.zip

dgw commented 8 years ago

Appears to be working. Upon restarting deluged & deluge-web and reloading the WebUI, I see autoremoveplus.js:1082 AutoRemovePlus enabled in the JS console.

Checked the plugin's own Enable box and double checked my settings, Apply'd, and reloaded again. Still working. I think you've nipped it, @omaralvarez!

@daneger Can you test as well?

omaralvarez commented 8 years ago

I'm really glad to hear it. I will make a new minor release with the fix, so everybody will switch to the fixed code. I also made some minor tweaks.

@daneger have you had time to test the fix?

daneger commented 8 years ago

Just updated and so far it seems to be working perfect. Thank-you very much.

omaralvarez commented 8 years ago

Awesome, then I will release the hotfix. Thanks for your feedback guys!