Skip to content

Setup prints misleading config error and logs unclosed aiohttp session #403

@sternma

Description

@sternma

Describe the bug
Setup prints misleading config error and logs unclosed aiohttp session

To Reproduce
Steps to reproduce the behavior:

  1. Ensure data dir exists but config.json does not.
  2. Run iSponsorBlockTV setup.
  3. Exit setup after creating config.
  4. Actual output:
Could not load config file
Blank config file created
After exit: asyncio - ERROR - Unclosed client session ...
Image

To be clear, the config is properly generated.

Expected behavior

  • No error message for normal first-run config creation.
  • No asyncio “Unclosed client session” error on setup exit.

Environment

iSponsorBlockTV installed and run via systemd (data dir exists, e.g. /var/lib/isponsorblocktv)
Command: iSponsorBlockTV setup

Additional context

  • Config.__load() prints error text for the expected first-run FileNotFoundError and prints “Blank config file created” even though it doesn’t create a file (see src/iSponsorBlockTV/helpers.py (line 82) and src/iSponsorBlockTV/helpers.py (line 104)). This is misleading when the data dir already exists.
  • aiohttp.ClientSession instances created during setup are never closed, leading to the asyncio error:
    • Setup wizard: AddDevice and AddChannel (src/iSponsorBlockTV/setup_wizard.py (line 234), src/iSponsorBlockTV/setup_wizard.py (line 387))
    • CLI setup: src/iSponsorBlockTV/config_setup.main() (src/iSponsorBlockTV/config_setup.py (line 83))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions