Borg backup : '2"' is not an integer

Support intro

Hello everyone,

I’ve been using and enjoying Nextcloud AIO for quite a while now. I find it excellent. That aside, I need help with the backup process.

Recently, I’ve been getting errors in Borg when it comes to pruning all snapshots / images. It has been working fine for over a year, and I believe what triggered this issue was an integrity check (from the AIO panel). While the check went well, and did not find any problems, I’m now getting every day a “failed backup”, meaning that I do have the backup, but it fails deleting the old ones.

This is the end of a backup log :

----------------------------------------------------------------------
2024-10-02T16:27:20.387964508Z Repository: /mnt/borgbackup/borg
2024-10-02T16:27:20.388047192Z Archive name: 20241002_154803-nextcloud-aio
2024-10-02T16:27:20.388062206Z Archive fingerprint: 9b628407189c6abd7bcafbb0263ce6f950a78cc8f19d064e0b8e3c02d986aef0
2024-10-02T16:27:20.388065794Z Time (start): Wed, 2024-10-02 15:48:04
2024-10-02T16:27:20.388068513Z Time (end):   Wed, 2024-10-02 16:27:17
2024-10-02T16:27:20.388071061Z Duration: 39 minutes 13.40 seconds
2024-10-02T16:27:20.388144306Z Number of files: 122766
2024-10-02T16:27:20.388160588Z Utilization of max. archive size: 0%
2024-10-02T16:27:20.388163994Z ------------------------------------------------------------------------------
2024-10-02T16:27:20.388166835Z                        Original size      Compressed size    Deduplicated size
2024-10-02T16:27:20.388169358Z This archive:              183.11 GB            158.09 GB            117.28 GB
2024-10-02T16:27:20.388171789Z All archives:              183.11 GB            158.09 GB            117.28 GB
2024-10-02T16:27:20.388174249Z 
2024-10-02T16:27:20.388181546Z                        Unique chunks         Total chunks
2024-10-02T16:27:20.388184330Z Chunk index:                  132867               186334
2024-10-02T16:27:20.388188295Z ------------------------------------------------------------------------------
2024-10-02T16:27:20.480808400Z BORG_PRUNE_OPTS are "--keep-within=7d --keep-weekly=4 --keep-monthly=2"
2024-10-02T16:27:20.480841571Z Pruning the archives...
2024-10-02T16:27:21.157154097Z usage: borg prune [-h] [--critical] [--error] [--warning] [--info] [--debug]
2024-10-02T16:27:21.157197691Z                   [--debug-topic TOPIC] [-p] [--iec] [--log-json]
2024-10-02T16:27:21.157357830Z                   [--lock-wait SECONDS] [--bypass-lock] [--show-version]
2024-10-02T16:27:21.157366019Z                   [--show-rc] [--umask M] [--remote-path PATH]
2024-10-02T16:27:21.157369311Z                   [--remote-ratelimit RATE] [--upload-ratelimit RATE]
2024-10-02T16:27:21.157372077Z                   [--remote-buffer UPLOAD_BUFFER]
2024-10-02T16:27:21.157374825Z                   [--upload-buffer UPLOAD_BUFFER] [--consider-part-files]
2024-10-02T16:27:21.157377386Z                   [--debug-profile FILE] [--rsh RSH] [-n] [--force] [-s]
2024-10-02T16:27:21.157380045Z                   [--list] [--keep-within INTERVAL] [--keep-last SECONDLY]
2024-10-02T16:27:21.157382486Z                   [--keep-minutely MINUTELY] [-H HOURLY] [-d DAILY]
2024-10-02T16:27:21.157384906Z                   [-w WEEKLY] [-m MONTHLY] [-y YEARLY] [-P PREFIX | -a GLOB]
2024-10-02T16:27:21.157400760Z                   [--save-space] [-c SECONDS]
2024-10-02T16:27:21.157404174Z                   [REPOSITORY]
2024-10-02T16:27:21.157408016Z borg prune: error: argument -m/--keep-monthly: invalid int value: '2"'
2024-10-02T16:27:21.201609938Z Failed to prune archives!

Nextcloud version : 29.0.6
Operating system and version : Debian 12 Bookworm
Apache or nginx version : 2.4.62-1~deb12u1
PHP version : 8.2.23 (AIO version).

The issue you are facing:

Is this the first time you’ve seen this error? : Yes, it started appearing a month ago, but I never saw anything like this in my prior experience with Nextcloud or Nextcloud AIO.

Steps to replicate it :
WARNING: THIS IS MY BEST GUESS AND MIGHT NOT ACTUALLY BE THAT.

  1. Take a backup
  2. Verify the integrity of the backups
  3. Every subsequent backup will softly fail.

My docker compose file :

services:
  nextcloud:
    image: nextcloud/all-in-one:latest
    restart: always
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 8080:8080    #For the web interface
    environment:
      - APACHE_PORT=11000           #IMPORTANT! For the reverse proxy
      - APACHE_IP_BINDING=127.0.0.1
      - NEXTCLOUD_DATADIR=/data/current/nextcloud    #IMPORTANT! The directory containing the data
      - NEXTCLOUD_UPLOAD_LIMIT=10G
      - NEXTCLOUD_MAX_TIME=3600
      - SKIP_DOMAIN_VALIDATION=true
#      - BORG_RETENTION_POLICY="--keep-within=7d --keep-weekly=4 --keep-monthly=2"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

Steps tried :

  • Commenting out my custom retention policy in the compose file (didn’t work)
  • Removing the Borg config inside the mastercontainer, resetting the backup location to a new one and starting over, with sudo docker exec nextcloud-aio-mastercontainer rm /mnt/docker-aio-config/data/borg.config and a new folder on the backup disk. (didn’t work)

I’m not sure why I’m having this problem, as I didn’t change my configuration in a while. My best current guess would be the integrity check as it checks out with the timeline, but then again it’s just a guess.

I tried to google it, but it seems that it’s not a widespread issue. Let me know if you have any clues :slight_smile:

This is the log of the first full backup on a new location. Without the middle section (for files). As said above, this backup was triggered on a new folder, and the borg.config file was deleted in the mastercontainer.

2024-10-02T15:48:00.157867669Z Initializing repository...
2024-10-02T15:48:00.852513485Z using builtin fallback logging configuration
2024-10-02T15:48:01.072965894Z 33 self tests completed in 0.22 seconds
2024-10-02T15:48:01.086504491Z Initializing repository at "/mnt/borgbackup/borg"
2024-10-02T15:48:01.217623037Z Key in "<Repository /mnt/borgbackup/borg>" created.
2024-10-02T15:48:01.217655422Z Keep this key safe. Your data will be inaccessible without it.
2024-10-02T15:48:01.246012452Z check_free_space: few segments, not requiring a full free segment
2024-10-02T15:48:01.246053768Z check_free_space: calculated working space for compact as 0 bytes
2024-10-02T15:48:01.246060553Z check_free_space: required bytes 169138, free bytes 275441213440
2024-10-02T15:48:01.301953830Z security: previous location file /root/.config/borg/security/bde879ed385f0b20352b8d88dbc0b257894304db3ef0cc59edfbf27f77a717e4/location not found
2024-10-02T15:48:01.302002745Z security: manifest timestamp file /root/.config/borg/security/bde879ed385f0b20352b8d88dbc0b257894304db3ef0cc59edfbf27f77a717e4/manifest-timestamp not found
2024-10-02T15:48:01.302009276Z security: determined newest manifest timestamp as 
2024-10-02T15:48:01.302013259Z security: remembering previously unknown repository
2024-10-02T15:48:01.302027000Z security: saving state for bde879ed385f0b20352b8d88dbc0b257894304db3ef0cc59edfbf27f77a717e4 to /root/.config/borg/security/bde879ed385f0b20352b8d88dbc0b257894304db3ef0cc59edfbf27f77a717e4
2024-10-02T15:48:01.302032653Z security: current location   /mnt/borgbackup/borg
2024-10-02T15:48:01.302036460Z security: key type           5
2024-10-02T15:48:01.302040181Z security: manifest timestamp 2024-10-02T15:48:01.215998
2024-10-02T15:48:01.322132762Z security: repository checks ok, allowing access
2024-10-02T15:48:01.324255080Z Synchronizing chunks cache...
2024-10-02T15:48:01.324301310Z Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0.
2024-10-02T15:48:01.325603287Z Verified integrity of /mnt/borgbackup/borg/index.1
2024-10-02T15:48:01.325753757Z Done.
2024-10-02T15:48:01.325867948Z security: saving state for bde879ed385f0b20352b8d88dbc0b257894304db3ef0cc59edfbf27f77a717e4 to /root/.config/borg/security/bde879ed385f0b20352b8d88dbc0b257894304db3ef0cc59edfbf27f77a717e4
2024-10-02T15:48:01.325951187Z security: current location   /mnt/borgbackup/borg
2024-10-02T15:48:01.326006267Z security: key type           5
2024-10-02T15:48:01.326017212Z security: manifest timestamp 2024-10-02T15:48:01.215998
2024-10-02T15:48:01.357382379Z 
2024-10-02T15:48:01.357482245Z By default repositories initialized with this version will produce security
2024-10-02T15:48:01.357513166Z errors if written to with an older version (up to and including Borg 1.0.8).
2024-10-02T15:48:01.357517563Z 
2024-10-02T15:48:01.357520290Z If you want to use these older versions, you can disable the check by running:
2024-10-02T15:48:01.357565315Z borg upgrade --disable-tam /mnt/borgbackup/borg
2024-10-02T15:48:01.357570569Z 
2024-10-02T15:48:01.357574486Z See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
2024-10-02T15:48:01.357578576Z 
2024-10-02T15:48:01.357580989Z IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
2024-10-02T15:48:01.357583568Z If you used a repokey mode, the key is stored in the repo, but you should back it up separately.
2024-10-02T15:48:01.357586337Z Use "borg key export" to export the key, optionally in printable format.
2024-10-02T15:48:01.357589073Z Write down the passphrase. Store both at safe place(s).
2024-10-02T15:48:01.357592049Z 
2024-10-02T15:48:03.284358947Z Repository successfully initialized.
2024-10-02T15:48:03.284498181Z Performing backup...
2024-10-02T15:48:03.284809682Z Starting the backup...
2024-10-02T15:48:04.302769366Z Creating archive at "/mnt/borgbackup/borg::20241002_154803-nextcloud-aio"
2024-10-02T15:48:52.571487873Z 0 B O 0 B C 0 B D 0 N nextcloud_aio_volumes                                     
zing cache transaction: Reading config
zing cache transaction: Reading chunks
zing cache transaction: Reading files
O 6.18 MB C 6.18 MB D 26 N nextcloud_aio_volum... brochure 2021 - EN.pdf

[CUT USELESS LOGS]

B O 158.08 GB C 117.27 GB D 122693 N nextcloud_aio_...ase/16384/17873_vm
                                                                        
iles cache
hunks cache
ache config
----------------------------------------------------------------------
2024-10-02T16:27:20.387964508Z Repository: /mnt/borgbackup/borg
2024-10-02T16:27:20.388047192Z Archive name: 20241002_154803-nextcloud-aio
2024-10-02T16:27:20.388062206Z Archive fingerprint: 9b628407189c6abd7bcafbb0263ce6f950a78cc8f19d064e0b8e3c02d986aef0
2024-10-02T16:27:20.388065794Z Time (start): Wed, 2024-10-02 15:48:04
2024-10-02T16:27:20.388068513Z Time (end):   Wed, 2024-10-02 16:27:17
2024-10-02T16:27:20.388071061Z Duration: 39 minutes 13.40 seconds
2024-10-02T16:27:20.388144306Z Number of files: 122766
2024-10-02T16:27:20.388160588Z Utilization of max. archive size: 0%
2024-10-02T16:27:20.388163994Z ------------------------------------------------------------------------------
2024-10-02T16:27:20.388166835Z                        Original size      Compressed size    Deduplicated size
2024-10-02T16:27:20.388169358Z This archive:              183.11 GB            158.09 GB            117.28 GB
2024-10-02T16:27:20.388171789Z All archives:              183.11 GB            158.09 GB            117.28 GB
2024-10-02T16:27:20.388174249Z 
2024-10-02T16:27:20.388181546Z                        Unique chunks         Total chunks
2024-10-02T16:27:20.388184330Z Chunk index:                  132867               186334
2024-10-02T16:27:20.388188295Z ------------------------------------------------------------------------------
2024-10-02T16:27:20.480808400Z BORG_PRUNE_OPTS are "--keep-within=7d --keep-weekly=4 --keep-monthly=2"
2024-10-02T16:27:20.480841571Z Pruning the archives...
2024-10-02T16:27:21.157154097Z usage: borg prune [-h] [--critical] [--error] [--warning] [--info] [--debug]
2024-10-02T16:27:21.157197691Z                   [--debug-topic TOPIC] [-p] [--iec] [--log-json]
2024-10-02T16:27:21.157357830Z                   [--lock-wait SECONDS] [--bypass-lock] [--show-version]
2024-10-02T16:27:21.157366019Z                   [--show-rc] [--umask M] [--remote-path PATH]
2024-10-02T16:27:21.157369311Z                   [--remote-ratelimit RATE] [--upload-ratelimit RATE]
2024-10-02T16:27:21.157372077Z                   [--remote-buffer UPLOAD_BUFFER]
2024-10-02T16:27:21.157374825Z                   [--upload-buffer UPLOAD_BUFFER] [--consider-part-files]
2024-10-02T16:27:21.157377386Z                   [--debug-profile FILE] [--rsh RSH] [-n] [--force] [-s]
2024-10-02T16:27:21.157380045Z                   [--list] [--keep-within INTERVAL] [--keep-last SECONDLY]
2024-10-02T16:27:21.157382486Z                   [--keep-minutely MINUTELY] [-H HOURLY] [-d DAILY]
2024-10-02T16:27:21.157384906Z                   [-w WEEKLY] [-m MONTHLY] [-y YEARLY] [-P PREFIX | -a GLOB]
2024-10-02T16:27:21.157400760Z                   [--save-space] [-c SECONDS]
2024-10-02T16:27:21.157404174Z                   [REPOSITORY]
2024-10-02T16:27:21.157408016Z borg prune: error: argument -m/--keep-monthly: invalid int value: '2"'
2024-10-02T16:27:21.201609938Z Failed to prune archives!

Hi, see Borg prune error · nextcloud/all-in-one · Discussion #5248 · GitHub

Thanks for your quick answer ! It works !

Changed :

  • BORG_RETENTION_POLICY=“–keep-within=7d --keep-weekly=4 --keep-monthly=2”

To :

  • BORG_RETENTION_POLICY=–keep-within=7d --keep-weekly=4 --keep-monthly=2

Just a sanity check, it was always like this, or it got changed recently ?
Btw, google skill issue I guess on my side.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.