Database Upgrade Error: attempt to write a readonly database

Version 5.0.82
I'm using a Snap package with Ubuntu.

Since the Update I cannot start Zotero, getting the following error:

Error: Error(s) encountered during statement execution: attempt to write a readonly database [QUERY: DELETE FROM itemTypeFields] [PARAMS: ] [ERROR: attempt to write a readonly database]
Zotero.DBConnection.prototype.queryAsync<@chrome://zotero/content/xpcom/db.js:664:13
From previous event:
_updateGlobalSchema@chrome://zotero/content/xpcom/schema.js:509:11

Any ideas?

Your's
Felix
  • You'll have to contact the maintainers of the Snap package (or figure out yourself why the packaged program can't write to the database).
  • Hi! I'm the maintainer of the snap, it would be nice if you can file an issue at the repo: https://github.com/extraymond/zotero-snap.

    I've experience the same error once but can't seem to find it anymore, I suppose it's something to do with me changing the project folder to /home/$USER/Zotero other than the default one which links to /home/$USER/snap/zotero-snap/version/snap

    I assumed because that path might only be available to the current version, if zotero-snap updated it might not be able to find the .sqlite file under that folder.

    Further discussion about that might be better suited to the repo. So other users can share feedback and help me find the cause. Again, thanks for reporting.
  • I'm running Zotero on my Ubuntu box and I'm seeing the same error. The snap looks like it updated yesterday on March 5.
  • I'm getting the same error version 5.0.84 on Ubuntu.
  • Hi! Sorry that you've encountered the error, I've updated the instruction to avoid that.
    https://snapcraft.io/zotero-snap

    To my knowledge, it happened because snap's strict ownership between versions,
    and if you put your config sqlite file under version specific folder, it won't be recognized by newer version.

    The easiest way to avoid that without changing zotero source, is to place your project folder in a path where snap's considered it persistent.

    You can check the issue here:
    https://github.com/extraymond/zotero-snap/issues/3

    TLDR:
    1. The default $XDG_HOME path snap see is different than your typical $XDG_HOME. So version upgrade makes config sqlite db unreachable.
    2. Put it in the either common(persistent) folder or your typical $XDG_HOME or other path works.

    Hope this helps!
  • Thanks for the update. How exactly do we accomplish this? I tried just moving the Zotero directory from current/ to common/ but I'm getting the same error. Is there a snap command to do it?
  • I tried reverting the snap to the previous version. Now Zotero loads again. Then I went into Preferences/Advanced/Files and Folders. When I click on the Custom button under Data Directory Location the program crashes with the following error:

    **
    Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unable to load image-loading module: /snap/zotero-snap/11/gnome-platform/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/zotero-snap/11/gnome-platform/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5)
    Redirecting call to abort() to mozalloc_abort

    /snap/zotero-snap/10/zotero: line 13: 24974 Segmentation fault (core dumped) "$CALLDIR/zotero-bin" -app "$CALLDIR/application.ini" "$@"

    Both /snap/zotero-snap/current and ~/snap/zotero-snap/current are pointing to version 10, not version 11, but this seems to indicate it's still looking in the version 11 directory.
  • I ended up removing zotero-snap and deleting ~/snap/zotero-snap then reinstalling. When I started it the first thing I did was change the directory to common/Zotero. This time it worked. Then I resynced and that seemed to work as well.
  • Oh! I mean you have to set the project folder in zotero to other places.

    But since now zotero is not working, you would have to backup your original folder, rm the ~/snap/zotero-snap folder and restart again. After that you can set it and it should work fine.
  • edited March 10, 2020
    Hi! I've updated the snap version in the edge channel to redirect initial folder position by pointing XDG_CONFIG_HOME and HOME env_vars to SNAP_COMMON_DATA where won't get forgotten after upgrades.

    I would like to get some feedback so I can push it to stable. Thanks for anyone testing this out. Hope I can get this stabilized.
Sign In or Register to comment.