[lxc-devel] [lxd/master] Fix "no transaction is active" error during database updates

freeekanayaka on Github lxc-bot at linuxcontainers.org
Thu Aug 9 06:32:32 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 618 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180809/4acae9a5/attachment.bin>
-------------- next part --------------
From 167c3084d1261173309fc014b3a4d0d24e06d72d Mon Sep 17 00:00:00 2001
From: Free Ekanayaka <free.ekanayaka at canonical.com>
Date: Thu, 9 Aug 2018 08:29:36 +0200
Subject: [PATCH] Fix "no transaction is active" error during database updates

The daemon patch upgrading from v0.14 to v0.15 requires a containers
restart. However it uses internal db API that require the database schema to be
already up-to-date.

This commits drops the automatic container restart and turns it into a warning.

Signed-off-by: Free Ekanayaka <free.ekanayaka at canonical.com>
---
 lxd/patches.go | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lxd/patches.go b/lxd/patches.go
index 2e5d740ecf..6f593a6b4b 100644
--- a/lxd/patches.go
+++ b/lxd/patches.go
@@ -2968,10 +2968,7 @@ func patchUpdateFromV10(d *Daemon) error {
 			return err
 		}
 
-		logger.Debugf("Restarting all the containers following directory rename")
-		s := d.State()
-		containersShutdown(s)
-		containersRestart(s)
+		logger.Warn("You're upgrading from LXD version 0.15 or earlier to version 3.0.2 or later: please restart your containers.")
 	}
 
 	return nil


More information about the lxc-devel mailing list