2

When I try to move a label for a point in a layer called 'Places', I am prompted to choose a primary key, but when I select the fid column, I get the error 'Unable to execute 'CREATE TABLE IF NOT EXISTS 'Places_52bd342a_70bb_4877_a31e_ea26276ff2d4' ( 'ASPK' Real )': unable to open database file'.

Unable to execute 'CREATE TABLE IF NOT EXISTS 'Places_52bd342a_70bb_4877_a31e_ea26276ff2d4' ( 'ASPK' Real  )': unable to open database file

I get an identical error if I try to select the 'Store Data in the Project' option in the labelling menu:

Store Data in the Project

and if I try to create an auxiliary layer directly within the Auxiliary Storage menu in the Layer Properties: Create Auxiliary Layer

The layer was originally a geopackage - I've tried exporting it to a shapefile but get exactly the same error. I've also tried using different attributes as the Primary Key, but whatever attribute I choose I get the same error. Is there a setting within the project that I can change to allow auxiliary storage?

(adding the sqlite tag because googling the error code gives me the impression that the error comes in some way from an sqlite component within QGIS)

1 Answer 1

2

The important thing to remember is that by default QGIS stores user-defined label location data in auxiliary layers. These layers are stored in the QGIS project file itself, not in your geopackage or shapefile. (It is possible to store the label position data in attributes of your data file, but since QGIS 3.0 this is no longer the default.)

Because of this, it sounds like there is a problem with your QGIS project file itself - perhaps something got corrupted? Since a QGIS project file (.qgz) is actually a zip archive of a .qgs file (project information in XML format) and a .qgd file (auxiliary data in sqlite format), you can unzip the .qgz file and try to open each of its component files to narrow down which one has a problem. If the .qgs file is corrupted, it may be possible to fix it in a simple text editor, since XML is a plain-text format. If the .qgd file is corrupted, you can delete it and go through the process you followed in your original answer, which should prompt QGIS to create a new .qgd file that should not be corrupted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.