TrashMonks / qud-wiki

Desktop app for creating and updating the official Caves of Qud wiki
https://wiki.cavesofqud.com/
GNU Affero General Public License v3.0
11 stars 3 forks source link

Forced Logout Issue? #48

Closed egocarib closed 3 years ago

egocarib commented 3 years ago

Have been encountering this issue fairly frequently as of late. Seems to have started after the UCP transition, maybe?

It seems easy to reproduce - upload 20 or 30 page templates, and then let QBE sit idle for 20 or 30 minutes. When you come back and try to upload something, you'll often get an error similar to this. I also sometimes run into it even while actively doing things, perhaps there's a page limit before it boots the account or something? Unsure exactly.

It would be nice if QBE could recover from this gracefully and re-log you in without having to restart the client each time it happens.

Traceback (most recent call last):
  File "D:\Users\<username>\PycharmProjects\qud-wiki\qbe\explorer.py", line 524, in upload_selected_templates
    self.upload_wikidata(self.upload_wiki_template, 'templates')
  File "D:\Users\<username>\PycharmProjects\qud-wiki\qbe\explorer.py", line 557, in upload_wikidata
    object_handler(qud_object, num)
  File "D:\Users\<username>\PycharmProjects\qud-wiki\qbe\explorer.py", line 578, in upload_wiki_template
    if page.upload_template() == 'Success':
  File "D:\Users\<username>\PycharmProjects\qud-wiki\qbe\wiki_page.py", line 90, in upload_template
    result = self.page.save(text=new_text, summary=self.EDITED_SUMMARY)
  File "C:\Users\<username>\.virtualenvs\hagadias-C3wQwRSd\lib\site-packages\mwclient\page.py", line 179, in save
    return self.edit(*args, **kwargs)
  File "C:\Users\<username>\.virtualenvs\hagadias-C3wQwRSd\lib\site-packages\mwclient\page.py", line 184, in edit
    return self._edit(summary, minor, bot, section, text=text, **kwargs)
  File "C:\Users\<username>\.virtualenvs\hagadias-C3wQwRSd\lib\site-packages\mwclient\page.py", line 200, in _edit
    raise mwclient.errors.AssertUserFailedError()
mwclient.errors.AssertUserFailedError: By default, mwclient protects you from accidentally editing without being logged in. If you actually want to edit without logging in, you can set force_login on the Site object to False.
egocarib commented 3 years ago

This has been happening less frequently lately. Perhaps it was a temporary issue related to the wiki infrastructure transition a few months back.

Yesterday I was able to upload every page on the wiki over the space of a few hours without QBE encountering this issue.

egocarib commented 3 years ago

Have been hitting this pretty frequently again, so I'm going to re-open the issue.

I am not really sure how to fix it but I assume we might be able to auto re-login via the API if this occurs. This has been a bit annoying lately because it seems to log me out whenever I spend more than 30 minutes or so doing stuff. If I scan a huge chunk of the wiki, I am then unable to upload templates for the things the scan detected differences in, because I get logged out. And then I have to start the whole process over again.

updated stack trace from today:

Traceback (most recent call last):
  File "D:\Users\jramm\PycharmProjects\qud-wiki\qbe\explorer.py", line 524, in upload_selected_templates
    self.upload_wikidata(self.upload_wiki_template, 'templates')
  File "D:\Users\jramm\PycharmProjects\qud-wiki\qbe\explorer.py", line 557, in upload_wikidata
    object_handler(qud_object, num)
  File "D:\Users\jramm\PycharmProjects\qud-wiki\qbe\explorer.py", line 578, in upload_wiki_template
    if page.upload_template() == 'Success':
  File "D:\Users\jramm\PycharmProjects\qud-wiki\qbe\wiki_page.py", line 90, in upload_template
    result = self.page.save(text=new_text, summary=self.EDITED_SUMMARY)
  File "C:\Users\jramm\.virtualenvs\hagadias-C3wQwRSd\lib\site-packages\mwclient\page.py", line 179, in save
    return self.edit(*args, **kwargs)
  File "C:\Users\jramm\.virtualenvs\hagadias-C3wQwRSd\lib\site-packages\mwclient\page.py", line 184, in edit
    return self._edit(summary, minor, bot, section, text=text, **kwargs)
  File "C:\Users\jramm\.virtualenvs\hagadias-C3wQwRSd\lib\site-packages\mwclient\page.py", line 200, in _edit
    raise mwclient.errors.AssertUserFailedError()
mwclient.errors.AssertUserFailedError: By default, mwclient protects you from accidentally editing without being logged in. If you actually want to edit without logging in, you can set force_login on the Site object to False.