#1091924 apt-cacher-ng fails due to simultaneous access

Package:
apt-cacher-ng
Source:
apt-cacher-ng
Description:
caching proxy server for software repositories
Submitter:
Scott Hovis
Date:
2025-01-23 17:15:02 UTC
Severity:
normal
#1091924#5
Date:
2025-01-02 15:20:35 UTC
From:
To:
When multiple systems attempt a package installation through apt-cacher-ng, some are returned a 503 error due to what appears to be a problem with simultaneous access. It appears that apt-cacher-ng is attempting to backup the repo index file multiple times with the same name. The problem does not happen when systems install packages at different times.

Relative apt-cacher-ng logs (NOTE: I have already checked file permissions as the log says):
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|I|5008|11.0.0.12|centos/7/os/x86_64/repodata/repomd.xml
1735621847|O|4008|11.0.0.12|centos/7/os/x86_64/repodata/repomd.xml
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!
1735621847|O|742|11.0.0.12|centos/7/centosplus/x86_64/repodata/repomd.xml
Tue Dec 31 05:10:47 2024|Failure to move file /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml out of the way or cannot create /var/cache/apt-cacher-ng/centos/7/centosplus/x86_64/repodata/repomd.xml.1735621847 - errno: File exists
Tue Dec 31 05:10:47 2024|Error creating file item for centos/7/centosplus/x86_64/repodata/repomd.xml -- check file permissions!

In our case, the simultaneous access is caused by execution via ansible and throttling those operations is highly undesirable due to environment scale and time considerations. Is there an option to disable this backup operation altogether and simply overwrite the index file or to pull the index only once despite multiple requests?

#1091924#10
Date:
2025-01-23 16:57:58 UTC
From:
To:
Hello Scott,

your problem can be fixed by applying the latest patch from Tim Woodall
in #1022043.

You can apply the patch to 3.7.5 and build it on a bookworm host to get
a backport for Bookworm.


Best Regards,

Arndt