Project history and Remove locally fail in projects with long paths on Windows (> 260 characters)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 45
- Fork
- 21
- Merge medio
- 3g 13h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MerginMaps/qgis-plugin
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
MerginMaps/qgis-plugin#953 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MerginMaps/qgis-plugin#848 · 1 commento ·
-
View changes and schema check use the wrong base copy for GeoPackages in subfoldersForse già presa @harminius l’ha presa 6 giorni fa. Apertabug
MerginMaps/qgis-plugin#963 · 1 assegnatario ·
-
Error when syncing project.Forse già presa @harminius l’ha presa 7 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 54/100
MerginMaps/qgis-plugin#960 · 2 commenti · 1 assegnatario ·
-
@mm_project_version is not updatedForse già presa @harminius l’ha presa 20 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
MerginMaps/qgis-plugin#947 · 1 assegnatario ·
Tutte le issue di MerginMaps/qgis-plugin
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Deltares/numba_celltree#100 · 1 commento ·
-
auto-reported bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
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 errorForse già presa @Keshemir l’ha presa oggi. Apertabug claimed difficulty:2
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
MakazhanAlpamys/Soup#3045 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
dagster-io/skills#80 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno