Skip to content

Creating default project crashes QGIS #890

@Withalion

Description

@Withalion

Creating a new default project crashes QGIS while creating the project files/directory. The directory is created as well the geopackage, but QGIS project is missing. I have not detected this issue on Windows (QGIS 4.0) & QGIS plugin 2026.2.1.

QGIS log output
src/core/vectortile/qgsmapboxglstyleconverter.cpp:4174 : (parseSources) [2508605ms] Ignoring vector tile style source openmaptiles (Vector)
build-qt6/python/core/build/_core/sip_corepart24.cpp:21270 : (meth_QgsMessageLog_logMessage) [31ms] 2026-03-16T12:38:24 Python warning[1] warning:/home/Withalion/.local/share/QGIS/QGIS4/profiles/MM plugin tester/python/plugins/Mergin/utils.py:449: DeprecationWarning: QgsVectorFileWriter.writeAsVectorFormatV2() is deprecated
  res, err = QgsVectorFileWriter.writeAsVectorFormatV2(layer, layer_filename, transform_context, writer_opts)

traceback:  File "/home/Withalion/.local/share/QGIS/QGIS4/profiles/MM plugin tester/python/plugins/Mergin/plugin.py", line 475, in create_new_project
    if not wizard.exec():
  File "/home/Withalion/.local/share/QGIS/QGIS4/profiles/MM plugin tester/python/plugins/Mergin/create_project_wizard.py", line 490, in accept
    self.project_file = create_basic_qgis_project(project_path=self.project_file)
  File "/home/Withalion/.local/share/QGIS/QGIS4/profiles/MM plugin tester/python/plugins/Mergin/utils.py", line 501, in create_basic_qgis_project
    vector_fname, err = save_vector_layer_as_gpkg(mem_layer, os.path.dirname(project_path))
  File "/home/Withalion/.local/share/QGIS/QGIS4/profiles/MM plugin tester/python/plugins/Mergin/utils.py", line 449, in save_vector_layer_as_gpkg
    res, err = QgsVectorFileWriter.writeAsVectorFormatV2(layer, layer_filename, transform_context, writer_opts)

Warning: QMetaEnum::keysToValue: empty keys string.
Stacktrace (piped through c++filt):
./build-qt6/output/bin/qgis() [0x4038e1]
./build-qt6/output/bin/qgis() [0x4040f6]
/lib64/libQt6Core.so.6(+0x70642) [0x7f6a2b270642]
/lib64/libQt6Core.so.6(+0x71a66) [0x7f6a2b271a66]
/lib64/libQt6Core.so.6(QMessageLogger::warning(char const*, ...) const+0xea) [0x7f6a2b21c55c]
/lib64/libQt6Core.so.6(+0x295d5) [0x7f6a2b2295d5]
/lib64/libQt6Core.so.6(QMetaEnum::keysToValue(char const*, bool*) const+0x15) [0x7f6a2b3151c5]
/home/Withalion/Code-Repos/Work/Lutra/QGIS-fork/build-qt6/output/lib/libqgis_core.so.4.1.0(+0x19ffefe) [0x7f6a3f3ffefe]
/home/Withalion/Code-Repos/Work/Lutra/QGIS-fork/build-qt6/output/lib/libqgis_core.so.4.1.0(QgsProject::writeProjectFile(QString const&)+0xeb1) [0x7f6a3f3cdb7d]
/home/Withalion/Code-Repos/Work/Lutra/QGIS-fork/build-qt6/output/lib/libqgis_core.so.4.1.0(QgsProject::zip(QString const&)+0x475) [0x7f6a3f3e69fd]
/home/Withalion/Code-Repos/Work/Lutra/QGIS-fork/build-qt6/output/lib/libqgis_core.so.4.1.0(QgsProject::write()+0x91f) [0x7f6a3f3cc48b]
/home/Withalion/Code-Repos/Work/Lutra/QGIS-fork/build-qt6/output/python/qgis/_core.so(+0xd128da) [0x7f69405128da]
/lib64/libpython3.14.so.1.0(+0x183d4c) [0x7f6a43383d4c]
/lib64/libpython3.14.so.1.0(_PyObject_MakeTpCall+0x434) [0x7f6a4334b464]
/lib64/libpython3.14.so.1.0(_PyEval_EvalFrameDefault+0xa818) [0x7f6a4336ced8]
/lib64/libpython3.14.so.1.0(+0x15ed05) [0x7f6a4335ed05]
/lib64/libpython3.14.so.1.0(+0x1d888f) [0x7f6a433d888f]
/usr/lib64/python3.14/site-packages/PyQt6/sip.cpython-314-x86_64-linux-gnu.so(+0xff4e) [0x7f696004ef4e]
/usr/lib64/python3.14/site-packages/PyQt6/sip.cpython-314-x86_64-linux-gnu.so(+0x10034) [0x7f696004f034]
/usr/lib64/python3.14/site-packages/PyQt6/QtWidgets.abi3.so(+0x654c9) [0x7f6943a654c9]
src/gui/qgsmessagebar.cpp:325 : (pushItem) [190ms] 2026-03-16T12:38:25 Messages[2] Qt : QMetaEnum::keysToValue: empty keys string.
src/core/providers/ogr/qgsogrprovider.cpp:1409 : (extent) [17ms] Failure: unable to compute extent2D (ogr error: 6)
Fatal: ASSERT failure in QgsXmlUtils::writeVariant: "unsupported user variant type QgsFileWidget::RelativeStorage", file /home/Withalion/Code-Repos/Work/Lutra/QGIS-fork/src/core/qgsxmlutils.cpp, line 293
QGIS died on signal -1Extra Info File: /tmp/qgis-crash-info-2032486

Version info:
OS: Fedora 43
QGIS version: 4.0+ (using master from 12.3)
Plugin version: master (7ac74691d66a7e65c5cfef9ff674566dd1991478)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions