Which tool versions are you using?
tauw_legger_tool
SDK: v13.6.0
Platform: v2023.07.0
Python: v3.10
Isolation mode: venv
Current Behavior
Exporting to shapefile or geopackage gives errors. Something because of fiona
Expected Behavior
Export to shapefile or geopackage used to work. But now all the export functions have to stopped working.
Context (optional, but preferred)
A project in the tauw_legger_tool has to be renewed. But the export functions have stopped working. The logging says that something is wrong with Fiona. Could it be that Fiona or Gdal have been updated recently on the viktor servers? Because I think Fiona is dependent on Gdal which might be the case.
Traceback for Geopackage:
Traceback (most recent call last):
File “fiona/_shim.pyx”, line 110, in fiona._shim.gdal_create
File “fiona/_err.pyx”, line 291, in fiona._err.exc_wrap_pointer
fiona._err.CPLE_OpenFailedError: sqlite3_open(temp3.gpkg) failed: unable to open database file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “viktor_connector/connector.pyx”, line 295, in connector.Job.execute
File “viktor/core.pyx”, line 1837, in viktor.core._handle_job
File “viktor/core.pyx”, line 1803, in viktor.core._handle_job._handle_button
File “/home/user/src/app/legger_design/controller.py”, line 203, in download_gis_file
output_file = GisExporter(driver=driver).create_gis_file(trajectory_line=trajectory_linestring,
File “/home/user/src/app/legger_design/gis_exporter.py”, line 230, in create_gis_file
self._write_trajectory_line(trajectory_line, file_name=file_name, layer_name=“Trajectlijn”)
File “/home/user/src/app/legger_design/gis_exporter.py”, line 41, in _write_trajectory_line
with fiona.open(file_name, ‘w’, driver=self.driver, crs=self.crs, schema=trajectory_line_schema,
File “/usr/local/lib/python3.10/site-packages/fiona/env.py”, line 417, in wrapper
return f(*args, **kwargs)
File “/usr/local/lib/python3.10/site-packages/fiona/init.py”, line 280, in open
c = Collection(path, mode, crs=crs, driver=driver, schema=this_schema,
File “/usr/local/lib/python3.10/site-packages/fiona/collection.py”, line 165, in init
self.session.start(self, **kwargs)
File “fiona/ogrext.pyx”, line 1010, in fiona.ogrext.WritingSession.start
File “fiona/ogrext.pyx”, line 1011, in fiona.ogrext.WritingSession.start
File “fiona/_shim.pyx”, line 114, in fiona._shim.gdal_create
fiona.errors.DriverError: sqlite3_open(temp3.gpkg) failed: unable to open database file
Traceback for shapefiles:
Traceback (most recent call last):
File “fiona/ogrext.pyx”, line 1133, in fiona.ogrext.WritingSession.start
File “fiona/_err.pyx”, line 291, in fiona._err.exc_wrap_pointer
fiona._err.CPLE_AppDefinedError: Failed to create file Trajectlijn.shp: Permission denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “viktor_connector/connector.pyx”, line 295, in connector.Job.execute
File “viktor/core.pyx”, line 1837, in viktor.core._handle_job
File “viktor/core.pyx”, line 1803, in viktor.core._handle_job._handle_button
File “/home/user/src/app/legger_design/controller.py”, line 203, in download_gis_file
output_file = GisExporter(driver=driver).create_gis_file(trajectory_line=trajectory_linestring,
File “/home/user/src/app/legger_design/gis_exporter.py”, line 252, in create_gis_file
self._write_trajectory_line(trajectory_line, file_name=f"Trajectlijn{extension}")
File “/home/user/src/app/legger_design/gis_exporter.py”, line 41, in _write_trajectory_line
with fiona.open(file_name, ‘w’, driver=self.driver, crs=self.crs, schema=trajectory_line_schema,
File “/usr/local/lib/python3.10/site-packages/fiona/env.py”, line 417, in wrapper
return f(*args, **kwargs)
File “/usr/local/lib/python3.10/site-packages/fiona/init.py”, line 280, in open
c = Collection(path, mode, crs=crs, driver=driver, schema=this_schema,
File “/usr/local/lib/python3.10/site-packages/fiona/collection.py”, line 165, in init
self.session.start(self, **kwargs)
File “fiona/ogrext.pyx”, line 1141, in fiona.ogrext.WritingSession.start
fiona.errors.DriverIOError: Failed to create file Trajectlijn.shp: Permission denied