Something is wrong with the backup: ERROR 23

Upgraded our box to latest version and now have this error sent to my email:

Something is wrong with the backup: ERROR 23 . Another instance is already running with this archive directory . If you are sure that this is the only instance running you may delete . the following lockfile and run the command again :
. /home/user-data/backup/cache/6a5c5177c8263a9fb337605b1b1fd49a/lockfile.lock

Is there any way to confirm multiple instances are not running?

using htop or top to confirm, you can also check log files and such, but most reliable way is top.

I am having same issue.

Something is wrong with the backup: ERROR 23
. Another instance is already running with this archive directory
. If you are sure that this is the only instance running you may delete
. the following lockfile and run the command again :
. /home/user-data/backup/cache/77bb3fb2afb5975d26aa819871b4bd44/lockfile.lock

What is process I should take to correct issue? I am not sure what @murgero means by the following: [quote=ā€œmurgero, post:2, topic:1284ā€]
htop or top to confirm
[/quote]

Plus, what am I looking for and what do I do after?

PID should be stored in the Lock file quoted about.

I appreciate the quick reply.

Can you dumb it down for meā€¦? I have no idea what pid htop or anything else is. Assuming I should nano into the lock file and look for something? Should I delete something? Run some command? Iā€™m lostā€¦

pid means Process ID
htop and top are tools that show you what processes are running (they also give information about what is using the most CPU and memory, for example)

Simply type ā€œtopā€ into a command prompt. The first column you see is a Process ID. This is the list of processes youā€™d need to inspect.

In the lock file, if you see a Process ID and you use top to confirm it is not running, then you can delete the lockfile.lock and then backups should proceed as normal.

When I have trouble with my backups, because I only have a few mailboxes, I simply delete the entire backups folder and run:

mailinabox/management/backup.py

This of course deletes any of the lockfiles mentioned. This script kicks off the backups and will regenerate them for you in full if you do indeed delete the entire folder.

Hopefully this helps you some?

1 Like

I also get this when first logging into server.
/usr/bin/xauth: error in locking authority file /root/.Xauthority

additionally, I have had periodic: ā€œsomething went wrongā€ when running status check from web interface.

this is result of running ā€œtopā€:

top - 07:43:38 up 10:04, 1 user, load average: 0.00, 0.01, 0.05
Tasks: 122 total, 1 running, 121 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.2 us, 0.2 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3081988 total, 685444 used, 2396544 free, 59576 buffers
KiB Swap: 0 total, 0 used, 0 free. 226524 cached Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1286 root 20 0 996872 41776 5752 S 0.3 1.4 0:07.51 mailinabox-daem
1 root 20 0 33496 2836 1444 S 0.0 0.1 0:01.66 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
7 root 20 0 0 0 0 S 0.0 0.0 0:01.07 rcu_sched
8 root 20 0 0 0 0 S 0.0 0.0 0:00.71 rcuos/0
9 root 20 0 0 0 0 S 0.0 0.0 0:00.49 rcuos/1
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/0
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/1
13 root rt 0 0 0 0 S 0.0 0.0 0:00.06 migration/0
14 root rt 0 0 0 0 S 0.0 0.0 0:00.19 watchdog/0
15 root rt 0 0 0 0 S 0.0 0.0 0:00.16 watchdog/1
16 root rt 0 0 0 0 S 0.0 0.0 0:00.05 migration/1
17 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/1
18 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0
19 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H
20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 khelper
21 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
22 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
23 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback
24 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd
25 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
26 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u5:0
27 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
28 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff
29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khubd
30 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 md
31 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 devfreq_wq
32 root 20 0 0 0 0 S 0.0 0.0 0:03.56 kworker/0:1
34 root 20 0 0 0 0 S 0.0 0.0 0:00.04 khungtaskd
35 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0
36 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 vmstat
37 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd
38 root 39 19 0 0 0 S 0.0 0.0 0:00.31 khugepaged
39 root 20 0 0 0 0 S 0.0 0.0 0:00.00 fsnotify_mark
40 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ecryptfs-kthrea
41 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto
53 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kthrotld
55 root 20 0 0 0 0 S 0.0 0.0 0:00.00 vballoon
56 root 20 0 0 0 0 S 0.0 0.0 0:00.73 kworker/1:1
57 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
58 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
79 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 deferwq
80 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 charger_manager
125 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
128 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:2
141 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u5:2
142 root 20 0 0 0 0 S 0.0 0.0 0:00.00 jbd2/vda1-8
143 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ext4-rsv-conver
319 root 20 0 19472 660 472 S 0.0 0.0 0:00.11 upstart-udev-br
333 root 20 0 51460 1780 1004 S 0.0 0.1 0:00.07 systemd-udevd

root@box:/home/user-data/backup/cache/77bb3fb2afb5975d26aa819871b4bd44# ls -al
total 1195840
drwxr-xr-x 2 root root 24576 Aug 11 03:04 .
drwxr-xr-x 3 root root 4096 Jan 22 2016 ā€¦
-rw-rā€“r-- 2 root root 0 Aug 11 03:00 box.fwla.com.MainThread-5426
-rw------- 1 root root 78866 Jul 11 05:48 duplicity-full.20160711T100007Z.manifest
-rw------- 1 root root 57342 Aug 11 14:15 duplicity-full.20160811T100022Z.manifest.part
-rw------- 1 root root 576148140 Jul 11 05:49 duplicity-full-signatures.20160711T100007Z.sigtar.gz
-rw------- 1 root root 568795136 Aug 11 14:15 duplicity-full-signatures.20160811T100022Z.sigtar.part
-rw------- 1 root root 233 Jul 12 03:01 duplicity-inc.20160711T100007Z.to.20160712T100014Z.manifest
-rw------- 1 root root 233 Jul 13 03:00 duplicity-inc.20160712T100014Z.to.20160713T100021Z.manifest
-rw------- 1 root root 233 Jul 14 03:01 duplicity-inc.20160713T100021Z.to.20160714T100007Z.manifest
-rw------- 1 root root 203 Jul 15 03:00 duplicity-inc.20160714T100007Z.to.20160715T100001Z.manifest
-rw------- 1 root root 203 Jul 16 03:00 duplicity-inc.20160715T100001Z.to.20160716T100009Z.manifest
-rw------- 1 root root 229 Jul 17 03:00 duplicity-inc.20160716T100009Z.to.20160717T100002Z.manifest
-rw------- 1 root root 203 Jul 18 03:00 duplicity-inc.20160717T100002Z.to.20160718T100006Z.manifest
-rw------- 1 root root 538 Jul 19 03:00 duplicity-inc.20160718T100006Z.to.20160719T100002Z.manifest
-rw------- 1 root root 181 Jul 20 03:00 duplicity-inc.20160719T100002Z.to.20160720T100007Z.manifest
-rw------- 1 root root 485 Jul 21 03:02 duplicity-inc.20160720T100007Z.to.20160721T100008Z.manifest
-rw------- 1 root root 203 Jul 22 03:01 duplicity-inc.20160721T100008Z.to.20160722T100004Z.manifest
-rw------- 1 root root 229 Jul 23 03:01 duplicity-inc.20160722T100004Z.to.20160723T100008Z.manifest
-rw------- 1 root root 229 Jul 24 03:00 duplicity-inc.20160723T100008Z.to.20160724T100002Z.manifest
-rw------- 1 root root 177 Jul 25 03:00 duplicity-inc.20160724T100002Z.to.20160725T100006Z.manifest
-rw------- 1 root root 443 Jul 26 03:01 duplicity-inc.20160725T100006Z.to.20160726T100012Z.manifest
-rw------- 1 root root 202 Jul 27 03:00 duplicity-inc.20160726T100012Z.to.20160727T100007Z.manifest
-rw------- 1 root root 206 Jul 28 03:00 duplicity-inc.20160727T100007Z.to.20160728T100009Z.manifest
-rw------- 1 root root 203 Jul 29 03:01 duplicity-inc.20160728T100009Z.to.20160729T100003Z.manifest
-rw------- 1 root root 2304 Jul 30 03:08 duplicity-inc.20160729T100003Z.to.20160730T100008Z.manifest
-rw------- 1 root root 206 Jul 31 03:03 duplicity-inc.20160730T100008Z.to.20160731T100003Z.manifest
-rw------- 1 root root 210 Aug 1 03:00 duplicity-inc.20160731T100003Z.to.20160801T100002Z.manifest
-rw------- 1 root root 209 Aug 2 03:00 duplicity-inc.20160801T100002Z.to.20160802T100002Z.manifest
-rw------- 1 root root 207 Aug 3 03:00 duplicity-inc.20160802T100002Z.to.20160803T100010Z.manifest
-rw------- 1 root root 209 Aug 4 03:02 duplicity-inc.20160803T100010Z.to.20160804T100021Z.manifest
-rw------- 1 root root 203 Aug 5 03:03 duplicity-inc.20160804T100021Z.to.20160805T100005Z.manifest
-rw------- 1 root root 202 Aug 6 03:01 duplicity-inc.20160805T100005Z.to.20160806T100005Z.manifest
-rw------- 1 root root 229 Aug 7 03:00 duplicity-inc.20160806T100005Z.to.20160807T100002Z.manifest
-rw------- 1 root root 229 Aug 8 03:00 duplicity-inc.20160807T100002Z.to.20160808T100003Z.manifest
-rw------- 1 root root 202 Aug 9 03:01 duplicity-inc.20160808T100003Z.to.20160809T100003Z.manifest
-rw------- 1 root root 203 Aug 10 03:01 duplicity-inc.20160809T100003Z.to.20160810T100008Z.manifest
-rw------- 1 root root 2469870 Jul 12 03:01 duplicity-new-signatures.20160711T100007Z.to.20160712T100014Z.sigtar.gz
-rw------- 1 root root 1388971 Jul 13 03:00 duplicity-new-signatures.20160712T100014Z.to.20160713T100021Z.sigtar.gz
-rw------- 1 root root 2542983 Jul 14 03:01 duplicity-new-signatures.20160713T100021Z.to.20160714T100007Z.sigtar.gz
-rw------- 1 root root 1350048 Jul 15 03:00 duplicity-new-signatures.20160714T100007Z.to.20160715T100001Z.sigtar.gz
-rw------- 1 root root 922540 Jul 16 03:00 duplicity-new-signatures.20160715T100001Z.to.20160716T100009Z.sigtar.gz
-rw------- 1 root root 968370 Jul 17 03:00 duplicity-new-signatures.20160716T100009Z.to.20160717T100002Z.sigtar.gz
-rw------- 1 root root 909569 Jul 18 03:00 duplicity-new-signatures.20160717T100002Z.to.20160718T100006Z.sigtar.gz
-rw------- 1 root root 3281179 Jul 19 03:00 duplicity-new-signatures.20160718T100006Z.to.20160719T100002Z.sigtar.gz
-rw------- 1 root root 2547417 Jul 20 03:00 duplicity-new-signatures.20160719T100002Z.to.20160720T100007Z.sigtar.gz
-rw------- 1 root root 4342028 Jul 21 03:02 duplicity-new-signatures.20160720T100007Z.to.20160721T100008Z.sigtar.gz
-rw------- 1 root root 2445527 Jul 22 03:01 duplicity-new-signatures.20160721T100008Z.to.20160722T100004Z.sigtar.gz
-rw------- 1 root root 1477613 Jul 23 03:01 duplicity-new-signatures.20160722T100004Z.to.20160723T100008Z.sigtar.gz
-rw------- 1 root root 637662 Jul 24 03:00 duplicity-new-signatures.20160723T100008Z.to.20160724T100002Z.sigtar.gz
-rw------- 1 root root 1560200 Jul 25 03:00 duplicity-new-signatures.20160724T100002Z.to.20160725T100006Z.sigtar.gz
-rw------- 1 root root 4187877 Jul 26 03:01 duplicity-new-signatures.20160725T100006Z.to.20160726T100012Z.sigtar.gz
-rw------- 1 root root 2807757 Jul 27 03:00 duplicity-new-signatures.20160726T100012Z.to.20160727T100007Z.sigtar.gz
-rw------- 1 root root 1572580 Jul 28 03:00 duplicity-new-signatures.20160727T100007Z.to.20160728T100009Z.sigtar.gz
-rw------- 1 root root 1283203 Jul 29 03:01 duplicity-new-signatures.20160728T100009Z.to.20160729T100003Z.sigtar.gz
-rw------- 1 root root 22335405 Jul 30 03:08 duplicity-new-signatures.20160729T100003Z.to.20160730T100008Z.sigtar.gz
-rw------- 1 root root 1416534 Jul 31 03:03 duplicity-new-signatures.20160730T100008Z.to.20160731T100003Z.sigtar.gz
-rw------- 1 root root 962065 Aug 1 03:00 duplicity-new-signatures.20160731T100003Z.to.20160801T100002Z.sigtar.gz
-rw------- 1 root root 2838050 Aug 2 03:00 duplicity-new-signatures.20160801T100002Z.to.20160802T100002Z.sigtar.gz
-rw------- 1 root root 3177783 Aug 3 03:00 duplicity-new-signatures.20160802T100002Z.to.20160803T100010Z.sigtar.gz
-rw------- 1 root root 3166266 Aug 4 03:02 duplicity-new-signatures.20160803T100010Z.to.20160804T100021Z.sigtar.gz
-rw------- 1 root root 2080753 Aug 5 03:03 duplicity-new-signatures.20160804T100021Z.to.20160805T100005Z.sigtar.gz
-rw------- 1 root root 1613118 Aug 6 03:01 duplicity-new-signatures.20160805T100005Z.to.20160806T100005Z.sigtar.gz
-rw------- 1 root root 745701 Aug 7 03:00 duplicity-new-signatures.20160806T100005Z.to.20160807T100002Z.sigtar.gz
-rw------- 1 root root 663356 Aug 8 03:00 duplicity-new-signatures.20160807T100002Z.to.20160808T100003Z.sigtar.gz
-rw------- 1 root root 1970060 Aug 9 03:01 duplicity-new-signatures.20160808T100003Z.to.20160809T100003Z.sigtar.gz
-rw------- 1 root root 1567085 Aug 10 03:01 duplicity-new-signatures.20160809T100003Z.to.20160810T100008Z.sigtar.gz
-rw-rā€“r-- 2 root root 0 Aug 11 03:00 lockfile.lock
root@box:/home/user-data/backup/cache/77bb3fb2afb5975d26aa819871b4bd44# rm lockfile.lock
rm: cannot remove ā€˜lockfile.lockā€™: Read-only file system

So, I tried to delete lockfile.lock (nano shows it is blank). I am not positive about earlier replies but it seems that I should/can delete ALL the above files (.gz) in this cache folder and they will rebuild.

or should I rm: /home/user-data/backup/
drwxr-xr-x 4 root root 4096 Jan 22 2016 .
drwxr-xr-x 8 user-data user-data 4096 Jan 21 2016 ā€¦
drwxr-xr-x 3 root root 4096 Jan 22 2016 cache
drwxr-xr-x 2 user-data root 86016 Aug 11 14:15 encrypted
-rw------- 1 root root 2775 Jan 21 2016 secret_key.txt

I am a bit lost, even with the previous comments.

here is me trying to run apt-get upgrade/update and a response Iā€™ve never seen before.
root@box:/# sudo su -
root@box:~# apt-get upgrade
W: Not using locking for read only lock file /var/lib/dpkg/lock
E: Unable to write to /var/cache/apt/
E: The package lists or status file could not be parsed or opened.
root@box:~# cd /
root@box:/# apt-get update
Ign http://archive.ubuntu.com trusty InRelease
Ign http://ppa.launchpad.net trusty InRelease
Ign http://ppa.launchpad.net trusty Release.gpg
Hit http://ppa.launchpad.net trusty Release
W: Not using locking for read only lock file /var/lib/apt/lists/lock
E: Couldnā€™t create temporary file to work with /var/lib/apt/lists/ppa.launchpad.net_mail-in-a-box_ppa_ubuntu_dists_trusty_Release - mkstemp (30: Read-only file system)
W: Not using locking for read only lock file /var/lib/dpkg/lock

In this mess of an issue, I do-upgrade-blah-blah command and it upgraded me to ubuntu 16. OOPS. FML. - I have since, created a new server instance (this time on digitalocean instead of vultr) and am in the process of rsync -asv IN WHICH, I am noticing it is sending the user-data/backup/encrypted/duplicityā€¦ and lockfile that is in the cache folder. assuming it will send with it the same problems as i had on the old server.

If it were me with this issue, I would delete the backup folder:
rm -rf /home/user-data/backup/

Then I would rerun the mailinabox command:
sudo mailinabox

To get your first full backup, assuming you have backups configured to store on the box, you can then run:
sudo mailinabox/management/backup.py

This command will rebuild the .gz files you reference and hopefully having deleted the entire backup folder, your locking issue will be resolved. Keep in mind you will also have a new secret_key.txt in /home/user-data/backup which you need to backup to a safe location in order to use the encrypted backups youā€™ve just regenerated.

1 Like

I havenā€™t been able to create backups because of an error, so I tried what you suggested, deleted backup folder, re-ran sudo mailinabox, but when I do ā€œsudo mailinabox/management/backup.pyā€, I get:

root@box:/# sudo mailinabox/management/backup.py
sudo: mailinabox/management/backup.py: command not found

And if I save backup settings in the admin, then I get an alert stating " Backup configuration" OK, but then nothing happens, and I have no backup in the encrypted folder, nor the list below the admin config area.

Sorry, I ran the command in the wrong directory :unamused:
The .gz files are now being generated in the encrypted folder!

And now, I finally have a line under available backups, thanks to your suggestion.
Thanks a lot!

Something happened to my ability to build backups. Iā€™ve switched MailInABox to make local backup files (to make it simpler). When I use the directions that @v60fan wrote in one of his messages, I get the following error in response to the ā€œbackup.pyā€ command:

usage: duplicity collection-status [-h] [ā€“archive-dir path] ā€¦
ā€¦
duplicity collection-status: error: argument --gpg-options: expected one argument
Something is wrong with the backup:

Best I can tell, itā€™s a matter of the script sending un-allowed arguments to the duplicity command. That package recently updated. I issued a --version argument and saw this:

~# duplicity --version
duplicity 2.0.0

aptitude reports 2.0.0-ppa202308071821~ubuntu22.04.1 for the version.

For the fun of it, I downgraded duplicity to the older version (0.8.21-1build1)ā€¦ and the backup generated properly!

I switched it back to the remote backup over rsync, and it continued to work. All I had to do was ā€œholdā€ the version of the duplicity package.

1 Like

You saved my life :slight_smile:
Due to duplicity update, backup is not working anymore
I did : apt install duplicity=0.8.21-1build1
And everything went back :slight_smile:

4 Likes

Cool! Iā€™m glad to hear that worked!

I have hit the same issue. I changed the MIAB backup today from using S3-compatible over to AWS S3 and it all stopped working. Running a full backup manually fails with that -gpg-options error. duplicity is v20. I deleted /home/user-data/backup and reinstalled the latest MIAB, did not help. Just found this thread so I downgraded duplicity to 0.8.21 and now my manual full backups get further - no module named ā€˜botoā€™. I have seen that somewhere in these threads, will chase that down.
Thanks for posting :slight_smile:

Update: ran apt install python3-boto and looks like backup is running. Clean install of boto, was not needed before??

Update #2 But now I cannot get the AWS S3 details to workā€¦ aargh

Hi @v60fan, what happens when I command

without deleting the entire backup folder?
I also get the message: Something is wrong with the backup:

Duplicity version was upgraded to v2.0.0 a couple of days ago and this new version has a problem. See this thread here: https://discourse.mailinabox.email/t/backup-script-failing/10734/8

There is a workaround in that thread to downgrade duplicity. Works for someā€¦
I am waiting for a duplicity fix, hoping they will fast track it