Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows lock when running migration #194

Open
Jonasvsl opened this issue Feb 11, 2025 · 0 comments
Open

windows lock when running migration #194

Jonasvsl opened this issue Feb 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Jonasvsl
Copy link

Jonasvsl commented Feb 11, 2025

When migrating windows locks the migrated file (?). Or at least it locks something. And that is causing issues in the Modeller Interface:

https://app.zenhub.com/workspaces/modeller-interface-61e574104cc38a001fb287de/issues/gh/nens/threedi-api-qgis-client/652

Lukasz had a look at it and he says it originates in the migration.

image.png

He and Olof were under the impression that it sometimes occurs but I have a 3 out of 3 so far. Restarting the laptop, which seems to work for Olof doesn't work on my laptop.

We need to fix this issue before we can release this to our customers,

I check the task manager but cannot see the prcoess in the task manager
I did find the file in windows explorer.

Closing the MI (otherwise file is locked)
Deleting the file
Starting the MI
Running the migration manually
And the file is immediately locked again.

QGIS version: 3.34.5-Prizren
QGIS code revision: 4b308492
Qt version: 5.15.3
Python version: 3.9.18
GDAL version: 3.8.4
GEOS version: 3.12.1-CAPI-1.18.1
PROJ version: Rel. 9.3.1, December 1st, 2023
PDAL version: 2.6.0 (git-version: 3fced5)
Algorithm started at: 2025-02-11T14:49:47
Algorithm 'Migrate Spatialite' starting…
Input parameters:
{ 'INPUT' : 'C:\\threedi_schematisations_staging\\Burnhams\\work in progress\\schematisation\\Burnhams_Dec_2013_OB_weir52_v2.sqlite' }

Traceback (most recent call last):
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\importlib\_common.py", line 35, in _tempfile
os.write(fd, reader())
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\zipfile.py", line 2331, in read_bytes
with self.open('rb') as strm:
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\zipfile.py", line 2315, in open
stream = self.root.open(self.at, zip_mode, pwd=pwd)
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\zipfile.py", line 1511, in open
zinfo = self.getinfo(name)
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\zipfile.py", line 1438, in getinfo
raise KeyError(
KeyError: "There is no item named 'threedi_schema/migrations/' in the archive"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\jonas.vanschrojenste\AppData\Roaming\3Di\QGIS3\profiles\lutra schematisation editor test/python/plugins\threedi_results_analysis\processing\schematisation_algorithms.py", line 77, in processAlgorithm
schema.validate_schema()
File "C:\Users\jonas.vanschrojenste\AppData\Roaming\3Di\QGIS3\profiles\lutra schematisation editor test\python\plugins\threedi_results_analysis\deps\threedi_schema\application\schema.py", line 144, in validate_schema
schema_version = get_schema_version()
File "C:\Users\jonas.vanschrojenste\AppData\Roaming\3Di\QGIS3\profiles\lutra schematisation editor test\python\plugins\threedi_results_analysis\deps\threedi_schema\application\schema.py", line 33, in get_schema_version
script = ScriptDirectory.from_config(config)
File "C:\Users\jonas.vanschrojenste\AppData\Roaming\3Di\QGIS3\profiles\lutra schematisation editor test\python\plugins\threedi_results_analysis\deps\alembic\script\base.py", line 211, in from_config
util.coerce_resource_to_filename(script_location),
File "C:\Users\jonas.vanschrojenste\AppData\Roaming\3Di\QGIS3\profiles\lutra schematisation editor test\python\plugins\threedi_results_analysis\deps\alembic\util\pyfiles.py", line 63, in coerce_resource_to_filename
fname = file_manager.enter_context( # type: ignore[assignment]
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\contextlib.py", line 448, in enter_context
result = _cm_type.__enter__(cm)
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\contextlib.py", line 119, in __enter__
return next(self.gen)
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\importlib\_common.py", line 52, in as_file
with _tempfile(path.read_bytes, suffix=path.name) as local:
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\contextlib.py", line 119, in __enter__
return next(self.gen)
File "C:\PROGRA~1\3DIMOD~1.34\apps\Python39\lib\importlib\_common.py", line 40, in _tempfile
os.remove(raw_path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\JONAS~1.VAN\\AppData\\Local\\Temp\\tmpsye18mcxmigrations'

Execution failed after 0.06 seconds

Loading resulting layers
Algorithm 'Migrate Spatialite' finished

@Jonasvsl Jonasvsl added the bug Something isn't working label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant