layday / instawow

World of Warcraft add-on manager CLI and GUI
GNU General Public License v3.0
161 stars 9 forks source link

internal error: "'username'" #74

Closed psychoticbeef closed 3 years ago

psychoticbeef commented 3 years ago

Hello there,

for a few versions now I've gotten this error on update:

C:\Users\da\Downloads>instawow.exe -p retail update
! instawow:weakauras-companion-autoupdate
  internal error: "'username'"

My json file looks good... do you have any idea what might be causing this?

Thank you!

Edit: Just realized from GUI app that it is related to weakauras companion on retail... Is it gone?

layday commented 3 years ago

Hi, thanks for the report. Could you attach your error log? You can find where it’s located by running instawow configure --active and then look inside config_dir.

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, 30 March 2021 17:49, psychoticbeef @.***> wrote:

Hello there,

for a few versions now I've gotten this error on update:

C:\Users\da\Downloads>instawow.exe -p retail update ! instawow:weakauras-companion-autoupdate internal error: "'username'"

My json file looks good... do you have any idea what might be causing this?

Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

layday commented 3 years ago

That will be instawow.exe -p retail configure --active for you.

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, 30 March 2021 18:03, layday @.***> wrote:

Hi, thanks for the report. Could you attach your error log? You can find where it’s located by running instawow configure --active and then look inside config_dir.

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, 30 March 2021 17:49, psychoticbeef @.***> wrote:

Hello there,

for a few versions now I've gotten this error on update:

C:\Users\da\Downloads>instawow.exe -p retail update ! instawow:weakauras-companion-autoupdate internal error: "'username'"

My json file looks good... do you have any idea what might be causing this?

Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

layday commented 3 years ago

I would guess that one of your WAs or Plater scripts does not have a username field on Wago, which instawow assumes is always present. This might be the case if an author would delete their account and their WAs become orphaned.

psychoticbeef commented 3 years ago

Hey layday,

the issue seems to have resolved itself after removing and readding wa-companion. Here's the log though:

2021-03-30 16:46:41.372 | INFO     | instawow.wa_updater:extract_installed_auras:167 - loading C:\Program Files (x86)\World of Warcraft\_retail_\WTF\Account\[redacted]\SavedVariables\Plater.lua from cache at C:\Users\da\AppData\Local\Temp\instawow\cache\[redacted]
2021-03-30 16:46:41.474 | ERROR    | instawow.manager:capture_manager_exc_async:272 - unclassed error
Traceback (most recent call last):

  File "instawow.__main__", line 4, in <module>
  File "click.core", line 829, in __call__
  File "click.core", line 782, in main
  File "click.core", line 1259, in invoke
  File "click.core", line 1066, in invoke
  File "click.core", line 610, in invoke
  File "click.decorators", line 33, in new_func
  File "instawow.cli", line 303, in update
  File "instawow.manager", line 803, in run
  File "asyncio.base_events", line 574, in run_until_complete
  File "asyncio.base_events", line 541, in run_forever
  File "asyncio.base_events", line 1786, in _run_once
  File "asyncio.events", line 88, in _run
> File "instawow.manager", line 265, in capture_manager_exc_async
  File "instawow.resolvers", line 1028, in resolve_one
  File "instawow.wa_updater", line 316, in build
  File "concurrent.futures.thread", line 57, in run
  File "instawow.wa_updater", line 269, in make_addon
  File "instawow.wa_updater", line 269, in <listcomp>

KeyError: 'username'
layday commented 3 years ago

It is a bit odd that re-installing weakauras-companion-autoupdate would fix it, but if it works, it works ;)

Let me know if it resurfaces and we can try debugging it in more detail.

psychoticbeef commented 3 years ago

Hi, I must have failed re-installing the WA companion autoupdate... The error is back. Can I assist somehow?

layday commented 3 years ago

Could you attach the output of instawow.exe -p retail weakauras-companion list?

psychoticbeef commented 3 years ago

Sure thing, here you go:

C:\Users\da\Downloads>instawow -p retail weakauras-companion list
   in file                 name                              URL
-------------  -----------------------------  ---------------------------------
WeakAuras.lua  0. Xaeric's Fistweaving [...]  https://wago.io/mjNHTXCaf/11
WeakAuras.lua  Bottled Flayedwing Toxin       https://wago.io/7XH_PJdby/13
WeakAuras.lua  Coldheart Fear                 https://wago.io/nvFwnuRM_/5
WeakAuras.lua  Explosive Orbs 2.0             https://wago.io/explosiveorbs/27
WeakAuras.lua  Flash Concentration            https://wago.io/yPSE6q93r/1
WeakAuras.lua  KILL THE POD                   https://wago.io/Wi5b8_TmZ/5
WeakAuras.lua  LuckyoneUI - Monk              https://wago.io/luckyoneMonk/11
WeakAuras.lua  LuckyoneUI - Priest            https://wago.io/luckyonePriest/10
WeakAuras.lua  MDT Pull Assist                https://wago.io/twT6CzqdD/17
WeakAuras.lua  Quaking Affix                  https://wago.io/V15AfQ7ym/13
WeakAuras.lua  SL-Dungeons                    https://wago.io/SL-Dungeons/116
WeakAuras.lua  Thorns                         https://wago.io/1LKPnMesm/1
WeakAuras.lua  Torghast - Ravenous [...]      https://wago.io/wFdSkgqXS/6
layday commented 3 years ago

Looking at the Wago API response for your installed auras, they all have a username set: https://data.wago.io/api/check/weakauras?ids=mjNHTXCaf,7XH_PJdby,nvFwnuRM_,explosiveorbs,yPSE6q93r,Wi5b8_TmZ,luckyoneMonk,luckyonePriest,twT6CzqdD,V15AfQ7ym,SL-Dungeons,1LKPnMesm,wFdSkgqXS. I wonder if this is an intermittent failure on the part of Wago.

layday commented 3 years ago

The code that implements this does not guarantee that the username is set - there's no else condition:

https://github.com/oratory/wago.io/blob/a71fc36003a3c9de5a74ba5d262619e0c823b44e/backend/api/services/api.js#L78-L89

I'll add a failsafe in instawow and release a new version, probably tomorrow.

layday commented 3 years ago

v1.23.1, which I've just published, should fix this.

psychoticbeef commented 3 years ago

Hi, thank you. Visited familiy, so I couldn't try. Now I get:

! instawow:weakauras-companion internal error: "[Errno 2] No such file or directory: 'C:\\Users\\da \\AppData\\Roaming\\instawow\\profiles\\retail\\plugins\\instawow. wa_updater\\checksum.txt'"

(There is no space after da, it's just due to the newline; the output is correct: path exists, but there's only a WeakAurasCompanion.zip, no other files.)

layday commented 3 years ago

Do you have the auto-update variant installed: instawow:weakauras-companion-autoupdate?

psychoticbeef commented 3 years ago

God damnit. No, I hadn't. Thanks. I had a bit of trouble with that though.

C:\Users\da\Downloads>instawow -p retail remove instawow:weakauras-companion
! instawow:weakauras-companion
  internal error: "list index out of range"

C:\Users\da\Downloads>instawow -p retail install instawow:weakauras-companion-autoupdate
✓ instawow:weakauras-companion-autoupdate
  installed c8c8811

C:\Users\da\Downloads>instawow -p retail install instawow:weakauras-companion-autoupdate

C:\Users\da\Downloads>instawow -p retail install instawow:weakauras-companion-autoupdate
✗ instawow:weakauras-companion-autoupdate
  package already installed

C:\Users\da\Downloads>instawow -p retail remove instawow:weakauras-companion-autoupdate
✓ instawow:weakauras-companion-autoupdate
  removed

C:\Users\da\Downloads>instawow -p retail update
! instawow:weakauras-companion
  internal error: "list index out of range"

No biggie, I renamed the db and reconciliated. If it is of any help for you, I can attach it somewhere. I'd appreciate it though if you'd let me know if it contains things like account name; if so I'd rather send it to you instead of posting it publically.

And WA updates are now working again, thank youuuu!

layday commented 3 years ago

Thank you, the error log would probably be enough. The database does not contain any personal information, no, and instawow does not store your account name.

layday commented 3 years ago

Ah, I think I know what happened. Because of where the previous failure occured, the zip file was created but was not populated. When you installed weakauras-companion, which requires you to have pre-built the add-on, it installed the folder-less zip that was already there. The 'remove' command attempted to access the first item in the list of installed folders for that add-on which was empty. If you had passed --keep-folders to 'remove', it would've been able to remove it.

layday commented 3 years ago

https://github.com/layday/instawow/commit/9d5f340d68a152ed9bdbb84913561a511eb67109 should fix removing add-ons without folders for anyone who might encounter this condition again.

layday commented 3 years ago

Thanks for working with me through this, I'll close this issue now.