Skip to content

"No root found for path" panic #3594

@drewp

Description

@drewp

Question

Running 0.0.40 in vscode 1.121.0

I get this when I restart ty server and then typo "@dataclass" to "@dataclassx" in my code:

2026-05-29 16:49:14.249803823  INFO Server shut down
[Error - 4:49:14 PM] Server process exited with code 0.
2026-05-29 16:49:14.296759483  INFO Version: 0.0.40
2026-05-29 16:49:14.300316662  INFO Defaulting to python-platform `linux`
2026-05-29 16:49:14.300757309  INFO Python version: Python 3.14, platform: linux
2026-05-29 16:49:43.434055608 ERROR An error occurred with request ID 107: request handler panicked at crates/ty_module_resolver/src/list.rs:84:35:
No root found for path '/my/proj/rdfdb'. Known roots: FileRoots(
    [
        FileRoot {
            [salsa id]: Id(0),
            path: "/usr/local/lib/python3.13/dist-packages",
            kind_at_time_of_creation: LibrarySearchPath,
            revision: FileRevision(
                32837022451618442247930728098,
            ),
        },
        FileRoot {
            [salsa id]: Id(1),
            path: "/usr/local/lib/python3.11/dist-packages",
            kind_at_time_of_creation: LibrarySearchPath,
            revision: FileRevision(
                32837022451618442247930734199,
            ),
        },
        FileRoot {
            [salsa id]: Id(2),
            path: "/usr/local/lib/python3.12/dist-packages",
            kind_at_time_of_creation: LibrarySearchPath,
            revision: FileRevision(
                32837022451618442247930737275,
            ),
        },
        FileRoot {
            [salsa id]: Id(3),
            path: "/usr/lib/python3/dist-packages",
            kind_at_time_of_creation: LibrarySearchPath,
            revision: FileRevision(
                32837022451618442247930738267,
            ),
        },
        FileRoot {
            [salsa id]: Id(4),
            path: "/home/drewp/own/proj/light9",
            kind_at_time_of_creation: Project,
            revision: FileRevision(
                32837022728319603353554827276,
            ),
        },
    ],
)query stacktrace:
   0: DatabaseKeyIndex(IngredientIndex(102), Id(2b401))
   1: DatabaseKeyIndex(IngredientIndex(100), Id(2b000))


run with `RUST_BACKTRACE=1` environment variable to display a backtrace
...
  Code: -32603 
✨ dash(pts/0):~/projects/light9% pdm info
PDM version:
  2.26.6
Python Interpreter:
  /home/drewp/.local/share/pdm/venvs/light9-zxQNOBNq-3.14/bin/python (3.14)
Project Root:
  /home/drewp/own/proj/light9
Local Packages:
  /home/drewp/.local/share/pdm/venvs/light9-zxQNOBNq-3.14/lib/python3.14/site-packages

✨ dash(pts/0):~/projects/light9% pdm list | grep ty           
│ ptyprocess              │ 0.7.0       │                                │
│ pycodestyle             │ 2.14.0      │                                │
│ service-identity        │ 24.2.0      │                                │
│ tenacity                │ 9.1.4       │                                │
│ ty                      │ 0.0.40      │                                │
│ typing_extensions       │ 4.15.0      │                                │

✨ dash(pts/0):~/projects/light9% pdm list | grep rdfdb        
│ rdfdb                   │ 0.24.0      │ -e /my/proj/rdfdb              │

✨ dash(pts/0):~/projects/light9% realpath .
/home/drewp/own/proj/light9

✨ dash(pts/0):~/projects/light9% grep ty .vscode/settings.json 
        "type": "debugpy",
  "ty.configurationFile": "./ty.toml",
  "ty.interpreter": "/home/drewp/.local/share/pdm/venvs/light9-zxQNOBNq-3.14/bin/python"

✨ dash(pts/0):~/projects/light9% cat ty.toml
[environment]
python-version = "3.14"
root = [
    "/home/drewp/own/proj/light9",
    "/my/proj/rdfdb",
    "/home/drewp/.local/share/pdm/venvs/light9-zxQNOBNq-3.14",
]

✨ dash(pts/0):~/projects/light9% cat /my/proj/rdfdb/pyproject.toml 
[project]
name = "rdfdb"
version = "0.24.0"
description = ""
authors = [{ name = "Drew Perttula", email = "drewp@bigasterisk.com" }]
license = {text = "MIT"}
dependencies = [
    'rdflib>=7.6.0',
    'autobahn>=23.1.2',
    "prometheus-client>=0.13.1",
    "starlette-exporter>=0.12.0",
    "asyncinotify>=4.0.2",
    "aiohttp>=3.8.1",
]
requires-python = ">=3.10"

[project.urls]
Homepage = ""

[build-system]
requires = ["pdm-pep517>=0.12.0"]
build-backend = "pdm.pep517.api"

[tool.pytest.ini_options]
...

[dependency-groups]
dev = [
    "flake8>=4.0.1",
    "yapf>=0.32.0",
    "pytest>=7.1.1",
    "pytest-watcher>=0.2.3",
    "mock",
    "pytest-asyncio>=0.21.0",
    "pydeps>=1.10.18",
    "uvicorn>=0.22.0",
    "websockets",
    "ty>=0.0.20",
]

I wish there was a match in the docs for the mysterious "/usr/local/lib/python3.11/dist-packages" roots (that don't match my py version). I expected at most one weird path to a builtin typeshed dir for py3.14. The two roots I provided, but then aren't listed in the error message's list of roots, I expected a message about what is wrong with them.

Specifically, why is my provided root "/my/proj/rdfdb" present leading to the error "No root found for path '/my/proj/rdfdb'. "?

Version

0.0.40

Metadata

Metadata

Assignees

No one assigned

    Labels

    configurationRelated to settings and configurationfatala fatal error (panic or crash)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions