Repository navigation
Closed
Labels
Description
Crash Report
$ mypy . --show-traceback
error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 2.3.1
Traceback (most recent call last):
File "/tmp/py/lib/python3.14/site-packages/mypy/__main__.py", line 16, in console_entry
main()
~~~~^^
File "mypy/main.py", line 154, in main
File "mypy/main.py", line 244, in run_build
res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
File "mypy/build.py", line 385, in build
File "mypy/build.py", line 1908, in create_metastore
mds: MetadataStore = SqliteMetadataStore(
File "mypy/metastore.py", line 200, in __init__
File "mypy/metastore.py", line 172, in connect_db
db.execute("PRAGMA synchronous=OFF")
sqlite3.OperationalError: disk I/O error
note: use --pdb to drop into pdb
To Reproduce
Source files are in a network mount:
$ mount | grep src
src on /home/hugo/src type 9p (rw,relatime,access=client,trans=virtio)
Sources are readable, execute fine, can be checked with ruff, etc.
You can quickly run a VM to reproduce this via:
qemu-system-x86_64 \
--enable-kvm \
-nic user \
-nographic \
-m 4G \
-smp cores=2 \
-drive file=alpine-virt-3.24.1-x86_64.iso,format=raw \
-virtfs local,path=$HOME/src/,mount_tag=src,security_model=mapped-xattrThen install mypy, mount the shared filesystem, and run it on any code in that fs.
Your Environment
- Mypy version used:
mypy 2.3.1 (compiled: yes) - Mypy command-line flags: (none/any)
- Mypy configuration options from
mypy.ini(and other config files): irrelevant; always happens - Python version used: Python 3.14.7
- Operating system and version: Alpine Linux Edge
Activity
WhyNotHugo commentedon Sep 20, 2026
Looks like the issue is writing the cache file into the project directory, and the network mount not properly handling mmap.
Adding
sqlite_cache = falseto[tool.mypy]serves as a workaround, although a correct fix would be in mypy storing the cache into the user's cache directory (e.g. XDG_CACHE_HOME) instead of in the project directory.WhyNotHugo commentedon Sep 20, 2026
The workaround is good for a single project but using a configuration file in
$HOME/.config/mypy/configdoesn't work: mypy ignores this file if any project-specific configuration exists.ilevkivskyi commentedon Oct 13, 2026
I am just going to fix the crash for now. We have a separate issue about XDG specification, #8790
Fallback to FS cache when sqlite fails (#22201)