layday / instawow

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

internal error: "'NoneType' object has no attribute 'startswith'" #104

Closed ciphersimian closed 2 years ago

ciphersimian commented 2 years ago
$ ./instawow --version
instawow, version 1.39.1

This may be due to some extremely old out of date data (I was last using instawow 1.20.post1 or something like that, well over a year ago), but after going through several rounds of reconciling and learning I could install tokens for GitHub and CFCore, I've now got some lingering errors on the following addons I had installed previously:

! curse:details
  internal error: "'NoneType' object has no attribute 'startswith'"
✗ curse:long-forgotten-hippogryph
  no files available for download
! curse:scrap
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:tradeskill-master
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:handynotes-pandaria
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:better-wardrobe-and-transmog
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:leatrix-plus
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:kaliels-tracker
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:handynotes-shadowlands
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:hidingbar
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:convert-ratings
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:mythic-dungeon-tools
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:gladiatorlossa2
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:att
  internal error: "'NoneType' object has no attribute 'startswith'"

Here's the complete debug output for one of them:

$ ./instawow --debug --profile wow1 update curse:details
2022-05-25 23:05:39.123 | DEBUG    | logging:callHandlers:1661
  Using selector: EpollSelector
2022-05-25 23:05:39.195 | INFO     | instawow.manager:_load_certifi_certs:199
  loading certifi certs
2022-05-25 23:05:39.443 | DEBUG    | instawow.manager:synchronise:498
  loaded catalogue from cache in 0.230s
2022-05-25 23:05:39.703 | ERROR    | instawow.manager:capture_manager_exc_async:247
  unclassed error
Traceback (most recent call last):

  File "instawow/__main__.py", line 15, in <module>
    main(prog_name=prog_name)
    │              └ '/wow/instawow-cli-1.39.1-ubuntu-latest/instawow-standalone'
    └ <function Logger.catch.<locals>.Catcher.__call__.<locals>.catch_wrapper at 0x7f269272da60>

  File "click/core.py", line 1130, in __call__

  File "click/core.py", line 1055, in main

  File "click/core.py", line 1657, in invoke

  File "click/core.py", line 1404, in invoke

  File "click/core.py", line 760, in invoke

  File "click/decorators.py", line 38, in new_func

  File "instawow/cli.py", line 395, in update
    results = mw.run_with_progress(mw.manager.update(update_defns, False))
              │  │                 │  │       │      └ [Defn(source='curse', alias='details', id=None, strategy=<Strategy.default: 'default'>, version=None)]
              │  │                 │  │       └ <function Manager.update at 0x7f26927299d0>
              │  │                 │  └ <instawow.manager.Manager object at 0x7f2691690a60>
              │  │                 └ <instawow.cli._CtxObjWrapper object at 0x7f269427a040>
              │  └ <function _CtxObjWrapper.run_with_progress at 0x7f269272d310>
              └ <instawow.cli._CtxObjWrapper object at 0x7f269427a040>

  File "instawow/cli.py", line 199, in run_with_progress
    return asyncio.run(run())
           │       │   └ <function _CtxObjWrapper.run_with_progress.<locals>.run at 0x7f2692749700>
           │       └ <function run at 0x7f26942994c0>
           └ <module 'asyncio' from '/wow/instawow-cli-1.39.1-ubuntu-latest/asyncio/__init__.pyc'>

  File "asyncio/runners.py", line 44, in run

  File "asyncio/base_events.py", line 634, in run_until_complete

  File "asyncio/base_events.py", line 601, in run_forever

  File "asyncio/base_events.py", line 1905, in _run_once

  File "asyncio/events.py", line 80, in _run

> File "instawow/manager.py", line 240, in capture_manager_exc_async
    return await awaitable
                 └ <coroutine object Manager._download_pkg_archive at 0x7f268347ec40>

  File "instawow/manager.py", line 701, in _download_pkg_archive
    elif url.startswith('file://'):
         └ None

AttributeError: 'NoneType' object has no attribute 'startswith'
2022-05-25 23:05:39.710 | DEBUG    | logging:callHandlers:1661
  Using selector: EpollSelector
! curse:details
  internal error: "'NoneType' object has no attribute 'startswith'"
ciphersimian commented 2 years ago

Removing it works, but then I get the same error when trying to install again.

ciphersimian commented 2 years ago

Because I had ancient versions of the addons in question I tried removing curse:details, then downloading it manually from https://www.curseforge.com/wow/addons/details/download, installing that, and then doing another reconcile to see what would happen. instawow finds it and matches it up with reconcile:

- Details, Details_DataStorage, [...] [?] curse:details==DetailsRetail.9.2.0.9817.146

but then on re-install of the same version it does the same thing:

? Install selected add-ons? Yes
Downloading curse:details   0.0% [>                                                                                                                                                                                                        ] 0.0/0.1MB   eta [?:??:??]
! curse:details
  internal error: "'NoneType' object has no attribute 'startswith'"
ciphersimian commented 2 years ago

So after removing each of the above with instawow, and then reinstalling manually by downloading, unziping, etc. I was then able to reconcile and find several of them at wowi; those installed just fine... exact same addon and version. I'm not sure why those weren't found by reconcile --installed originally, perhaps due to the error with curse.

The remaining which are only available at curse did the exact same thing after being manually reinstalled.

So, this issue seems to be specific to curse somehow.

$ ./instawow -p wow1 reconcile
Use the arrow keys to navigate, <o> to open an add-on in your browser,
enter to make a selection and <s> to skip to the next item.

Versions that differ from the installed version or differ between
choices are highlighted in purple.

The reconciler will perform three passes in decreasing order of accuracy,
looking to match source IDs and add-on names in TOC files, and folders.

Selected add-ons will be reinstalled.

You can also run `reconcile` in promptless mode by passing
the `--auto` flag.  In this mode, add-ons will be reconciled
without user input.

- Handynotes_Pandaria [1.5.1] curse:handynotes-pandaria==1.5.1
- Leatrix_Plus [9.2.12] curse:leatrix-plus==9.2.12
? Install selected add-ons? Yes
! curse:handynotes-pandaria
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:leatrix-plus
  internal error: "'NoneType' object has no attribute 'startswith'"
✗ curse:handynotes
  package folders conflict with installed package HandyNotes
    (github:Nevcairiel/HandyNotes)
- ATT [36] curse:att==v36
- BetterWardrobe, BetterWardrobe_SourceData [3.14.5] curse:better-wardrobe-and-transmog==
3.14.5
- ConvertRatings [2.0.9] wowi:24341-convert-ratings==v2.0.9
- Details, Details_DataStorage, [...] [?] curse:details==DetailsRetail.9.2.0.9817.146
- GladiatorlosSA2 [3.14.1] curse:gladiatorlossa2==GSA2_3.14.1
- Handynotes_Pandaria [1.5.1] curse:handynotes-pandaria==1.5.1
- HandyNotes_Shadowlands [46] wowi:25828-handynotes-shadowlands==v46
- HidingBar, HidingBar_Options [v9.2.7] curse:hidingbar==v9.2.7
- !KalielsTracker [4.4.0] curse:kaliels-tracker==4.4.0
- Leatrix_Plus [9.2.12] curse:leatrix-plus==9.2.12
- MythicDungeonTools [3.9.3] curse:mythic-dungeon-tools==v3.9.3
- Scrap, Scrap_Config, Scrap_Merchant [9.1.2] curse:scrap==9.1.2
- TradeSkillMaster [v4.11.29] wowi:24165-tradeskillmaster==v4.11.29
? Install selected add-ons? Yes
! curse:att
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:better-wardrobe-and-transmog
  internal error: "'NoneType' object has no attribute 'startswith'"
✓ wowi:24341-convert-ratings
  installed v2.0.9
! curse:details
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:gladiatorlossa2
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:handynotes-pandaria
  internal error: "'NoneType' object has no attribute 'startswith'"
✓ wowi:25828-handynotes-shadowlands
  installed v46
! curse:hidingbar
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:kaliels-tracker
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:leatrix-plus
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:mythic-dungeon-tools
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:scrap
  internal error: "'NoneType' object has no attribute 'startswith'"
✓ wowi:24165-tradeskillmaster
  installed v4.11.29
✗ curse:handynotes
  package folders conflict with installed package HandyNotes
    (github:Nevcairiel/HandyNotes)
- GladiatorlosSA2 [3.14.1] curse:gladiatorlossa2==GSA2_3.14.1
- Handynotes_Pandaria [1.5.1] curse:handynotes-pandaria==1.5.1
- HidingBar [v9.2.7] github:sfmict/hidingbar==v9.2.7
- MythicDungeonTools [3.9.3] curse:mythic-dungeon-tools==v3.9.3
? Install selected add-ons? Yes
Downloading github:sfmict/hidingbar   0.0% [>              ] 0.0/0.1MB     eta [?:??:??]
! curse:gladiatorlossa2
  internal error: "'NoneType' object has no attribute 'startswith'"
! curse:handynotes-pandaria
  internal error: "'NoneType' object has no attribute 'startswith'"
✓ github:sfmict/hidingbar
  installed v9.2.7
! curse:mythic-dungeon-tools
  internal error: "'NoneType' object has no attribute 'startswith'"
✗ curse:handynotes
  package folders conflict with installed package HandyNotes
    (github:Nevcairiel/HandyNotes)

      unreconciled       
-------------------------
!KalielsTracker          
ATT                      
BetterWardrobe           
BetterWardrobe_SourceData
Details                  
Details_DataStorage      
Details_EncounterDetails 
Details_RaidCheck        
Details_Streamer         
Details_TinyThreat       
Details_Vanguard         
GladiatorlosSA2          
Handynotes_Pandaria      
Leatrix_Plus             
MythicDungeonTools       
Scrap                    
Scrap_Config             
Scrap_Merchant
layday commented 2 years ago

This is a (more vexing) variation of https://github.com/layday/instawow/issues/102 - the mods in question disallow distribution through the new API. instawow should refuse to reconcile them.

ciphersimian commented 2 years ago

Ah, gotcha, I saw #102 but didn't recognize the connection. Though it seems like if an addon author posts the same addon at curse (with new API disallowed) and wowi, that instawow should be allowed to reconcile to the wowi version? But yeah, for the others where curse is the only option and it's disallowed, just printing a better error message makes sense.

Thanks again for all your work on this project. I'm glad to see it's still going and all things considered, even with the trouble I ran into, it still saved me a ton of time getting things updated.

layday commented 2 years ago

Though it seems like if an addon author posts the same addon at curse (with new API disallowed) and wowi, that instawow should be allowed to reconcile to the wowi version?

It can, it's just that Curse takes priority by default on account of being more popular with add-on authors and having an all-around better API with first-class support for TBC and Classic.

Thanks again for all your work on this project.

Thanks for sticking with it :)

layday commented 2 years ago

Fixed in 1.39.2, thanks for the report.