Sibin_M
(Sibin M)
January 28, 2022, 3:11pm
1
Hello,
we are getting the error “failed to begin transaction: context deadline exceeded” while running the below commands sometimes.
lxc storage volume set default vmname size 45000MB
lxc config set vmname limits.processes 5000
lxc config set vmname limits.cpu.allowance 10%
can you please help me on this.
stgraber
(Stéphane Graber)
January 28, 2022, 4:07pm
2
This usually indicates that you have a very high commit latency on your database, effectively that creating a new DB transaction took over 3s.
I’d recommend checking that none of your servers are overloaded (especially those with the database or database-leader roles in lxc cluster list
if on a cluster) and having a close look at I/O performance since this most likely indicates that a disk write couldn’t be completed in that time frame.
Sibin_M
(Sibin M)
January 31, 2022, 9:11am
3
thanks for the update. we have also noticed the below error with the mentioned commands.
Error: Failed to write backup file: failed to begin transaction: context deadline exceeded
stgraber
(Stéphane Graber)
February 1, 2022, 5:03pm
5
Same answer, it suggests one of your machine is unable to perform timely I/O.
I’d recommend looking at your monitoring system for I/O performance issues on the systems as well as potential disk or memory starvation.
Sibin_M
(Sibin M)
February 3, 2022, 7:57am
6
today we have faced the same issue. i have checked our monitoring system and couldn’t see any peak in the I/O and the load of the server is normal.
amarc
(Amar Cosic)
February 7, 2022, 8:27am
8
It’s not LXC/LXD issue, it’s your hardware issue. No one here can help you with that… as @stgraber already pointed out.
For fun of it, post screenshots of ‘top’ and ‘iotop’
Sibin_M
(Sibin M)
February 14, 2022, 8:02am
9
effectively that creating a new DB transaction took over 3s
if this is the case,for avoiding the error
Error: Failed to write backup file: failed to begin transaction: context deadline exceeded
can you please suggest a solution for this case?
Sibin_M
(Sibin M)
February 18, 2022, 8:25am
10
Hello,
we have getting the below error in the logs at the time the issue faced.
Feb 18 09:22:10 cpu-6257 lxd[3179]: t=2022-02-18T09:22:10+0100 lvl=warn msg="Transaction timed out. Retrying once" err="failed to begin transaction: context deadline exceeded" member=1
Feb 18 09:22:11 cpu-6257 lxd[3179]: t=2022-02-18T09:22:11+0100 lvl=warn msg="Transaction timed out. Retrying once" err="failed to begin transaction: context deadline exceeded" member=1
Feb 18 09:22:12 cpu-6257 lxd[3179]: t=2022-02-18T09:22:12+0100 lvl=warn msg="Transaction timed out. Retrying once" err="failed to begin transaction: context deadline exceeded" member=1
@stgraber any idea on this
tomp
(Thomas Parrott)
February 18, 2022, 10:07am
13
Then this strongly suggests some sort of load on your CPU or storage subsystem causing the database to not respond quickly enough.