Skip to content

[BUG] common.errors module missing but imported in multiple core files (main branch) #426

@Extremity

Description

@Extremity

OS

Linux

GPU Library

CUDA 12.x

Python version

3.12

Describe the bug

common.errors is imported, but the file does not exist.

Hi! I'm still relatively new to TabbyAPI specifically but have drowned in documentation for the past 18 hours to make sure I'm not just being an idiot - but I could still just be an idiot, so please excuse me if I've just missed something obvious and am wasting your time. I've done everything I can think of to make sure that's not the case. Edit 2: Sorry for the wall of text - I tend to ramble when I type (thanks, ADHD!) and asked ChatGPT to clean this up for me but now I'm worried it did the opposite.


Environment

  • OS: Ubuntu 26.04 (WSL2 on Windows 10 LTSC host)
  • Python: 3.12
  • GPU: FE RTX 3090
  • GPU stack: nvidia-smi reports CUDA 13.3
  • CUDA toolkit: not explicitly installed (WSL/PyTorch runtime)
  • Repos:
    • TabbyAPI: fresh clone of main
    • ExLlamaV3: separate sibling directory

Issue

Startup fails with:

ModuleNotFoundError: No module named 'common.errors'

Traceback excerpt:

File "/home/apoc/ai-projects/tabbyAPI/main.py", line 26, in entrypoint_async
from common import model
File "/home/apoc/ai-projects/tabbyAPI/common/model.py", line 15, in
from backends.base_model_container import BaseModelContainer
File "/home/apoc/ai-projects/tabbyAPI/backends/base_model_container.py", line 13, in
from common.errors import ContextLengthExceededError
ModuleNotFoundError: No module named 'common.errors'


Investigation performed

  • Fresh clone of main
  • Tried in sibling folder to ExLlamaV3, within ExLlamaV3 folder, without ExLlamaV3 on the system at all
  • Clean venv (tried both creating manually beforehand and letting start.sh create it)
  • No local modifications
  • No common/errors.py exists in repo or filesystem
  • Searched repo history for common.errors and ContextLengthExceededError
  • Confirmed common.utils exists and imports correctly

Edit:
Unable to give up, I've attempted again on a completely fresh Ubuntu LXC, then a VM, then baremetal (ie, not in WSL2) with fresh clone + clean venv: common.errors is not present anywhere in the working tree or git history, but is imported by multiple backend modules. Something's either wrong or I am very, very dumb.


Notes

The import was introduced in commit:
671c12d78c90d06fc67ad9fe07fb8f5d04a0b4ba9

That commit adds:

from common.errors import ContextLengthExceededError
from common.utils import unwrap

However, no corresponding common.errors module exists in the repository.


Question

Is common.errors expected to:

  • be generated during setup? Across all attempts setup has completed successfully; failure is at runtime
  • exist in a different branch or submodule?
  • or has it been moved/renamed and imports are now outdated?

Reproduction steps

I attempted this 10+ times, but this was the final and most basic install possible that still failed:

  1. Clone:
    git clone https://github.com/theroyallab/tabbyAPI
    cd tabbyAPI

  2. Run:
    bash start.sh (also via "./start.sh" just because)

  3. Allow installer to complete (venv + dependencies + config)

  4. Startup fails during import phase (common.errors) due to missing errors.py in /common

Edit - Just to be as thorough as possible, because output states to use this:

4a. Run:
./update_scripts/update_deps.sh
./start.sh

4b. update_deps.sh completes successfully; start.sh ends in same module failure.

Expected behavior

It should... run. It should either not be calling common.errors, or common.errors should exist.

Logs

(I edited out the bulk above this point - it's all just successful, normal dependency stuff)

Dependencies installed. Update them with update_deps.sh inside the update_scripts folder.
Successfully wrote your start script options to start_options.json.
If something goes wrong, editing or deleting the file will reinstall TabbyAPI as a first-time user.
A config.yml wasn't found.
Created one at /home/apoc/ai-projects/tabbyAPI/config.yml
Starting TabbyAPI...
2026-06-13 00:50:15.293 INFO: Configured backend: cudaMallocAsync
Traceback (most recent call last):
File "/home/apoc/ai-projects/tabbyAPI/start.py", line 310, in
entrypoint(args, parser)
File "/home/apoc/ai-projects/tabbyAPI/main.py", line 199, in entrypoint
asyncio.run(entrypoint_async())
File "/usr/lib/python3.12/asyncio/runners.py", line 195, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
File "/home/apoc/ai-projects/tabbyAPI/main.py", line 26, in entrypoint_async
from common import model
File "/home/apoc/ai-projects/tabbyAPI/common/model.py", line 15, in
from backends.base_model_container import BaseModelContainer
File "/home/apoc/ai-projects/tabbyAPI/backends/base_model_container.py", line 13, in
from common.errors import ContextLengthExceededError
ModuleNotFoundError: No module named 'common.errors'

This error was raised because a package was not found.
Update your dependencies by running update_scripts/update_deps.sh

Additional context

No response

Acknowledgements

  • I have looked for similar issues before submitting this one.
  • I have read the disclaimer, and this issue is related to a code bug. If I have a question, I will use the Discord server.
  • I understand that the developers have lives and my issue will be answered when possible.
  • I understand the developers of this program are human, and I will ask my questions politely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions