eshapard / AnkiHabitica

Anki 2.0/2.1 add-on for use with HabitRPG. Automatically scores habits when you reach the end of your Anki timebox and when you review all cards in a deck.
GNU General Public License v3.0
197 stars 31 forks source link

Doesn't seem to be working with Anki 2.1.38 or higher (I have 2.1.42) #115

Closed viviann16 closed 3 years ago

viviann16 commented 3 years ago

I noticed someone posted on the Ankiweb Add-on page on 1/4/2021 that Habitica didn't work for them on 2.1.38. I recently upgraded from 2.1.35 to 2.1.42 and now it doesn't work for me either.

I get a message every time I open AND close Anki that Habitica is not working unless I disable the add-on.

Please help!! I love the Anki-Habitica connection and use it every day!!

71e6fd52 commented 3 years ago

Thanks for your feedback. It works on my Anki 2.1.42 on Windows 10. Is there any error message?

viviann16 commented 3 years ago

Hi, yes.

Below is the message I get when I open my Anki if I have the Habitica add-on enabled. Also, I’m on a Mac, running MacOS Catalina, Version 10.15.7.

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.

Debug info: Anki 2.1.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.15.7 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-03-26 21:52:40 Add-ons possibly involved: Anki Habitica for 21

Caught exception: Traceback (most recent call last): File "aqt/progress.py", line 53, in handler File "aqt/main.py", line 142, in on_window_init File "aqt/main.py", line 231, in setupProfile File "aqt/main.py", line 413, in loadProfile File "aqt/hooks_gen.py", line 2194, in call File "anki/hooks.py", line 34, in runHook File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/init.py", line 751, in grab_profile check_unsynced_score() File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/init.py", line 707, in check_unsynced_score if not (be_ready() and ah.user_settings["check_db_on_profile_load"] and ah.habitica.grab_scorecounter() and compare_score_to_db()): File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_class.py", line 367, in grab_scorecounter response = self.api.task(self.habit_id) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 106, in task out = self.v3_request("get", "/tasks/%s" % str(task_id)) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 75, in v3_request response = json.load(opener.open(req, timeout=timeout)) File "urllib/request.py", line 531, in open File "urllib/request.py", line 640, in http_response File "urllib/request.py", line 569, in error File "urllib/request.py", line 502, in _call_chain File "urllib/request.py", line 649, in http_error_default urllib.error.HTTPError: HTTP Error 401: Unauthorized

If I try to “Score Habitica Backlog”, I also get this message:

Debug info: Anki 2.1.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.15.7 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-03-26 21:52:40 Add-ons possibly involved: ⁨Anki Habitica for 21⁩

Caught exception: Traceback (most recent call last): File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/init.py", line 620, in score_backlog ah.habitica.grab_scorecounter() File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_class.py", line 367, in grab_scorecounter response = self.api.task(self.habit_id) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 106, in task out = self.v3_request("get", "/tasks/%s" % str(task_id)) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 75, in v3_request response = json.load(opener.open(req, timeout=timeout)) File "urllib/request.py", line 531, in open File "urllib/request.py", line 640, in http_response File "urllib/request.py", line 569, in error File "urllib/request.py", line 502, in _call_chain File "urllib/request.py", line 649, in http_error_default urllib.error.HTTPError: HTTP Error 401: Unauthorized

And whenever I quit Anki with the add-on enabled, I get this message:

Debug info: Anki 2.1.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.15.7 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-03-26 21:52:40 Add-ons possibly involved: ⁨Anki Habitica for 21⁩

Caught exception: Traceback (most recent call last): File "aqt/taskman.py", line 88, in _on_closures_pending File "aqt/taskman.py", line 59, in File "aqt/taskman.py", line 77, in wrapped_done File "aqt/sync.py", line 114, in on_future_done File "aqt/main.py", line 913, in on_collection_sync_finished File "aqt/hooks_gen.py", line 2912, in call File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/init.py", line 707, in check_unsynced_score if not (be_ready() and ah.user_settings["check_db_on_profile_load"] and ah.habitica.grab_scorecounter() and compare_score_to_db()): File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_class.py", line 367, in grab_scorecounter response = self.api.task(self.habit_id) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 106, in task out = self.v3_request("get", "/tasks/%s" % str(task_id)) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 75, in v3_request response = json.load(opener.open(req, timeout=timeout)) File "urllib/request.py", line 531, in open File "urllib/request.py", line 640, in http_response File "urllib/request.py", line 569, in error File "urllib/request.py", line 502, in _call_chain File "urllib/request.py", line 649, in http_error_default urllib.error.HTTPError: HTTP Error 401: Unauthorized

From: 71e6fd52 @.> Date: Saturday, March 27, 2021 at 03:36 To: eshapard/AnkiHabitica @.> Cc: viviann16 @.>, Author @.> Subject: Re: [eshapard/AnkiHabitica] Doesn't seem to be working with Anki 2.1.38 or higher (I have 2.1.42) (#115)

Thanks for your feedback. It works on my Anki 2.1.42 on Windows 10. Is there any error message?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/eshapard/AnkiHabitica/issues/115#issuecomment-808680455, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASLVVZ53F5WZNSWJWZ6TQEDTFWDHFANCNFSM4Y7R3ACQ.

viviann16 commented 3 years ago

Oh never mind, I just figured it out.

Apparently I had entered the wrong API Username and Token. I re-entered my API username and token/password and it works now.

Sorry for the trouble!

Vivian From: Vivian Nguyen @.> Date: Saturday, March 27, 2021 at 03:47 To: eshapard/AnkiHabitica @.> Subject: Re: [eshapard/AnkiHabitica] Doesn't seem to be working with Anki 2.1.38 or higher (I have 2.1.42) (#115) Hi, yes.

Below is the message I get when I open my Anki if I have the Habitica add-on enabled. Also, I’m on a Mac, running MacOS Catalina, Version 10.15.7.

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.

Debug info: Anki 2.1.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.15.7 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-03-26 21:52:40 Add-ons possibly involved: Anki Habitica for 21

Caught exception: Traceback (most recent call last): File "aqt/progress.py", line 53, in handler File "aqt/main.py", line 142, in on_window_init File "aqt/main.py", line 231, in setupProfile File "aqt/main.py", line 413, in loadProfile File "aqt/hooks_gen.py", line 2194, in call File "anki/hooks.py", line 34, in runHook File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/init.py", line 751, in grab_profile check_unsynced_score() File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/init.py", line 707, in check_unsynced_score if not (be_ready() and ah.user_settings["check_db_on_profile_load"] and ah.habitica.grab_scorecounter() and compare_score_to_db()): File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_class.py", line 367, in grab_scorecounter response = self.api.task(self.habit_id) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 106, in task out = self.v3_request("get", "/tasks/%s" % str(task_id)) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 75, in v3_request response = json.load(opener.open(req, timeout=timeout)) File "urllib/request.py", line 531, in open File "urllib/request.py", line 640, in http_response File "urllib/request.py", line 569, in error File "urllib/request.py", line 502, in _call_chain File "urllib/request.py", line 649, in http_error_default urllib.error.HTTPError: HTTP Error 401: Unauthorized

If I try to “Score Habitica Backlog”, I also get this message:

Debug info: Anki 2.1.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.15.7 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-03-26 21:52:40 Add-ons possibly involved: ⁨Anki Habitica for 21⁩

Caught exception: Traceback (most recent call last): File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/init.py", line 620, in score_backlog ah.habitica.grab_scorecounter() File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_class.py", line 367, in grab_scorecounter response = self.api.task(self.habit_id) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 106, in task out = self.v3_request("get", "/tasks/%s" % str(task_id)) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 75, in v3_request response = json.load(opener.open(req, timeout=timeout)) File "urllib/request.py", line 531, in open File "urllib/request.py", line 640, in http_response File "urllib/request.py", line 569, in error File "urllib/request.py", line 502, in _call_chain File "urllib/request.py", line 649, in http_error_default urllib.error.HTTPError: HTTP Error 401: Unauthorized

And whenever I quit Anki with the add-on enabled, I get this message:

Debug info: Anki 2.1.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 Platform: Mac 10.15.7 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-03-26 21:52:40 Add-ons possibly involved: ⁨Anki Habitica for 21⁩

Caught exception: Traceback (most recent call last): File "aqt/taskman.py", line 88, in _on_closures_pending File "aqt/taskman.py", line 59, in File "aqt/taskman.py", line 77, in wrapped_done File "aqt/sync.py", line 114, in on_future_done File "aqt/main.py", line 913, in on_collection_sync_finished File "aqt/hooks_gen.py", line 2912, in call File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/init.py", line 707, in check_unsynced_score if not (be_ready() and ah.user_settings["check_db_on_profile_load"] and ah.habitica.grab_scorecounter() and compare_score_to_db()): File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_class.py", line 367, in grab_scorecounter response = self.api.task(self.habit_id) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 106, in task out = self.v3_request("get", "/tasks/%s" % str(task_id)) File "/Users/VivNguyen/Library/Application Support/Anki2/addons21/1758045507/habitica_api.py", line 75, in v3_request response = json.load(opener.open(req, timeout=timeout)) File "urllib/request.py", line 531, in open File "urllib/request.py", line 640, in http_response File "urllib/request.py", line 569, in error File "urllib/request.py", line 502, in _call_chain File "urllib/request.py", line 649, in http_error_default urllib.error.HTTPError: HTTP Error 401: Unauthorized

From: 71e6fd52 @.> Date: Saturday, March 27, 2021 at 03:36 To: eshapard/AnkiHabitica @.> Cc: viviann16 @.>, Author @.> Subject: Re: [eshapard/AnkiHabitica] Doesn't seem to be working with Anki 2.1.38 or higher (I have 2.1.42) (#115)

Thanks for your feedback. It works on my Anki 2.1.42 on Windows 10. Is there any error message?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/eshapard/AnkiHabitica/issues/115#issuecomment-808680455, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASLVVZ53F5WZNSWJWZ6TQEDTFWDHFANCNFSM4Y7R3ACQ.