Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: 'utf-8' codec can't decode byte 0xab in position 1: invalid start byte #10

Open
AdaptCharm opened this issue Dec 22, 2024 · 1 comment
Labels
bug Something isn't working in progress The issue is being worked on

Comments

@AdaptCharm
Copy link

Environment & Version:

  • OS: linux x86_64 Ubuntu 24.04.1 LTS
  • Docker: 27.4.0 (API: 1.47)
  • Portainer: Business Edition 2.21.5
  • Image: ghcr.io/zaarrg/comet-uncached:latest

Reproduction steps:

  1. Follow the docker instructions and ensure proper configuration for Portainer
  2. Start the container
  3. Navigate to http://localhost:8111/{URL_PREFIX}/base64_string/manifest.json

Expected result:

No exceptions or errors should occur during configuration checks or request processing.

Actual result:

2024-12-22 05:28:06 | ❌ ERROR | general.config_check - Error checking config: 'utf-8' codec can't decode byte 0xab in position 1: invalid start byte
2024-12-22 05:28:06 | ❌ ERROR | main.dispatch - Exception during request processing: can only concatenate str (not "NoneType") to str

Complete log:

Click to toggle
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Server started on http://0.0.0.0:8111 - 1 workers
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Dashboard Admin Password: dashpass -  http://0.0.0.0:8111/active-connections?password=dashpass
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Database (sqlite): data/comet.db - TTL: 86400s
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Debrid Proxy: http://warp:1080
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Indexer Manager: False
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Zilean: http://zilean:8181 - Take first: 1000
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Torrentio Scraper: True
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - MediaFusion Scraper: False
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Debrid Stream Proxy: True - Password: "REDACTED" - Max Connections: -1 - Default Debrid Service: realdebrid - Default Debrid API Key: REDACTED
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Title Match Check: True
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Remove Adult Content: True
2024-12-22 05:27:47 | 🌠 COMET | main.start_log - Custom Header HTML: True
2024-12-22 05:28:06 | ❌ ERROR | general.config_check - Error checking config: 'utf-8' codec can't decode byte 0xab in position 1: invalid start byte
2024-12-22 05:28:06 | ❌ ERROR | main.dispatch - Exception during request processing: can only concatenate str (not "NoneType") to str
Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 157, in call_next
    message = await recv_stream.receive()
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/anyio/streams/memory.py", line 111, in receive
    return self.receive_nowait()
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/anyio/streams/memory.py", line 104, in receive_nowait
    raise EndOfStream
anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/comet/main.py", line 29, in dispatch
    response = await call_next(request)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 163, in call_next
    raise app_exc
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 149, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
    raw_response = await run_endpoint_function(
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
    return await dependant.call(**values)
  File "/app/comet/api/core.py", line 116, in manifest
    "id": "comet-" + config["debridService"],
TypeError: can only concatenate str (not "NoneType") to str
2024-12-22 05:28:06 | 👾 API | main.dispatch - GET /base64_string/manifest.json - 500 - 0.01s
Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_utils.py", line 76, in collapse_excgroups
  |     yield
  |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 186, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 815, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    |     result = await app(  # type: ignore[func-returns-value]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    |     return await self.app(scope, receive, send)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    |     await super().__call__(scope, receive, send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
    |     raise exc
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
    |     await self.app(scope, receive, _send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__
    |     await self.app(scope, receive, send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 185, in __call__
    |     with collapse_excgroups():
    |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    |     raise exc
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 187, in __call__
    |     response = await self.dispatch_func(request, call_next)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/comet/main.py", line 29, in dispatch
    |     response = await call_next(request)
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 163, in call_next
    |     raise app_exc
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 149, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     raise exc
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
    |     await route.handle(scope, receive, send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
    |     await self.app(scope, receive, send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
    |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     raise exc
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    |     response = await f(request)
    |                ^^^^^^^^^^^^^^^^
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
    |     raw_response = await run_endpoint_function(
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
    |     return await dependant.call(**values)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/comet/api/core.py", line 116, in manifest
    |     "id": "comet-" + config["debridService"],
    |           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
    | TypeError: can only concatenate str (not "NoneType") to str
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 185, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 187, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/comet/main.py", line 29, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 163, in call_next
    raise app_exc
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/base.py", line 149, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/comet-9TtSrW0h-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/comet/api/core.py", line 116, in manifest
    "id": "comet-" + config["debridService"],
          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str
@Zaarrg Zaarrg added bug Something isn't working in progress The issue is being worked on labels Dec 23, 2024
@Zaarrg
Copy link
Owner

Zaarrg commented Jan 21, 2025

Stack.env:

INDEXER_MANAGER_API_KEY=######
INDEXER_MANAGER_TIMEOUT=30
INDEXER_MANAGER_INDEXERS=["1337x", "animetosho","torrentio"]
URL_PREFIX=/comet # Prefix to use for all endpoints like "/comet"
TOKEN=##### # Token to use for encryption/decryption of config in url. Example token: bPG&BWx#&sYtScpbs18222RmV77Y7R%

Make sure you are using the TOKEN env correctly and if you are not using it then clearing the web ui cache as it sill might think that it has to encrypt the URL.

Also this might happen because of a weird TOKEN so make sure its 31 characters long.

Tested it and i could only get this error when specifying the TOKEN env then copying the link then removing the TOKEN env and then trying to load the manifest url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress The issue is being worked on
Projects
None yet
Development

No branches or pull requests

2 participants