[SAC] [OSGeo] #2700: Error on backup of weblate

#2700: Error on backup of weblate
---------------------------+-----------------------
Reporter: robe | Owner: robe
     Type: task | Status: assigned
Priority: normal | Milestone: Unplanned
Component: Systems Admin | Keywords:
---------------------------+-----------------------
Got a notice that osgeo4 was unable to pull a snapshot of weblate.
I think this might have been because of the auto upgrade of lxd.

Issue is detailed here - https://github.com/lxc/lxd/issues/7024

The error is:

{{{
  Failed creating instance snapshot record "snap52": Failed initialising
instance: Failed creating storage record for snapshot: Insert volume
snapshot: UNIQUE constraint failed: storage_volumes_snapshot
}}}

restarting the container doesn't work, so had to go with suggestion in
that ticket

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2700&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2700: Error on backup of weblate
---------------------------+------------------------
Reporter: robe | Owner: robe
     Type: task | Status: closed
Priority: normal | Milestone: Unplanned
Component: Systems Admin | Resolution: fixed
Keywords: |
---------------------------+------------------------
Changes (by robe):

* status: assigned => closed
* resolution: => fixed

Comment:

Fix as noted in above ticket is to increment the sequence

First ssh into osgeo9 host

{{{
# fails with above error
lxc snapshot weblate
}}}

{{{
lxd sql global "SELECT max(id) FROM storage_volumes_snapshots;"

-- last snapshot id is 390

lxd sql global "SELECT seq FROM sqlite_sequence WHERE name =
'storage_volumes';"

-- last sequence is 182, change to 390 (the last snapshot id)
lxd sql global "UPDATE sqlite_sequence SET seq = 390 WHERE name =
'storage_volumes'"
}}}

Now doing a snapshot should work

{{{
lxc snapshot weblate
}}}

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2700#comment:1&gt;
OSGeo <https://osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.