Project history and Remove locally fail in projects with long paths on Windows (> 260 characters)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Both failures are long-path (>260 char) issues: Mergin/diff.py near line 386 (make_version_changes_layers) opens the cached .mergin/.cache/...schema.json, and Mergin/data_item.py line 215 (_delete_project_dir) walks the cache to delete it. Reproduce with the PowerShell snippet, then trace how those paths are built and where Windows long-path handling is missing. Done when Project history opens without the dialog and Remove locally deletes the folder completely.
Written by the indexing model from the issue text.
Description
Description
In a project stored in a long folder on Windows, syncing works, but two plugin features show FileNotFoundError:
- Project history: an error dialog appears when the window opens. After closing it, the history shows the changes.
- Remove locally: an error appears and the project folder is left partly deleted.
It happens when files in the project's .mergin folder exceed 260 characters. In short-path projects both features work without errors.
Environment
[x] Staging [x] PROD
Application (+ app version, build, operating system)
QGIS 3.44.15-Solothurn, Mergin Maps plugin master (python-api-client 0.15.1, geodiff 2.3.2), Windows 11 64-bit Arm. LongPathsEnabled = 1 and 0 (same result).
Steps to reproduce
- On Windows, create a folder about 215 characters long, e.g. in PowerShell:
$target = 215; $p = "C:\mmlong" while ($p.Length + 51 -le $target) { $p = Join-Path $p ("a"*50) } $p = Join-Path $p ("b" * ($target - $p.Length - 1)) New-Item -ItemType Directory -Path $p -Force | Out-Null; $p.Length - In QGIS, Browser → Mergin Maps → right-click a project with a GeoPackage → Download into that folder.
- Open the project, add a feature to the GeoPackage layer, save and sync.
- Click Project history on the Mergin Maps toolbar.
- Close the error dialog, the history window and the project (Project → Close).
- In the Browser, right-click the project → Remove locally.
Actual results
- Step 4: an error dialog appears when the history window opens. After closing it, the history shows the changes.
FileNotFoundError: [Errno 2] No such file or directory: '…\issue954_lv95\.mergin\.cache\v22\observations.gpkg-schema.json' File "Mergin\diff.py", line 386, in make_version_changes_layers - Step 6: an error appears and the project folder isn't fully removed (17 files left):
FileNotFoundError: [WinError 3] The system cannot find the path specified: '…\issue954_lv95\.mergin\.cache\v25\observations.gpkg' File "Mergin\data_item.py", line 215, in _delete_project_dir
Expected results
- Step 4: Project history opens without an error, as in short-path projects.
- Step 6: The local project folder is removed completely, as in short-path projects.
Screenshots or logs
An error has occurred while executing Python code:
FileNotFoundError: [Errno 2] No such file or directory: 'C:/mm932/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bb/issue954_lv95\\.mergin\\.cache\\v22\\observations.gpkg-schema.json'
Traceback (most recent call last):
File "C:\Users/mrcic/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Mergin\version_viewer_dialog.py", line 589, in selected_version_changed
self.show_version_changes(version)
File "C:\Users/mrcic/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Mergin\version_viewer_dialog.py", line 676, in show_version_changes
layers = make_version_changes_layers(QgsProject.instance().homePath(), version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/mrcic/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Mergin\diff.py", line 386, in make_version_changes_layers
with open(schema_file, encoding="utf-8") as fl:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:/mm932/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bb/issue954_lv95\\.mergin\\.cache\\v22\\observations.gpkg-schema.json'
Python version: 3.12.15 (main, Oct 2 2026, 17:29:02) [MSC v.1944 64 bit (AMD64)]
QGIS version: 3.44.15-Solothurn Solothurn, 44b4ef05178
Conclusion
Created by Claude and supervised by a human test analyst.
- Dominant language
- Python
- Stars
- 45
- Forks
- 21
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MerginMaps/qgis-plugin
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
MerginMaps/qgis-plugin#953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MerginMaps/qgis-plugin#848 · 1 comment ·
-
View changes and schema check use the wrong base copy for GeoPackages in subfoldersPossibly taken @harminius claimed this 6 days ago. Openbug
MerginMaps/qgis-plugin#963 · 1 assignee ·
-
Error when syncing project.Possibly taken @harminius claimed this 7 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 54/100
MerginMaps/qgis-plugin#960 · 2 comments · 1 assignee ·
-
@mm_project_version is not updatedPossibly taken @harminius claimed this 20 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
MerginMaps/qgis-plugin#947 · 1 assignee ·
All issues in MerginMaps/qgis-plugin
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Deltares/numba_celltree#100 · 1 comment ·
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
soup airgap-bundle --bundle-size-cap nan, inf or a cap above ~1.67e299 GiB stops with an internal ValueError/OverflowError (exit 1) instead of a usage errorPossibly taken @Keshemir claimed this today. Openbug claimed difficulty:2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
MakazhanAlpamys/Soup#3045 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dagster-io/skills#80 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day