Further analysis shows that this problem is due to a fun interaction
between lighttpd an ACNG. We use lighttpd to serve a local Debian/Ubuntu
package repository. In about half the cases where we run 'apt update',
it will fail with error 503 on the 'Release' file of such a repository.

What happens is:

1) Client asks ACNG for a new file. ACNG downloads it, serves it to the
client, adds it to /var/cache/apt-cacher-ng/<somewhere>

2) Subsequent requests for this file will work as expected

3) If the file hasn't been requested for a while, ACNG will run
'fileitem::DoDelayedUnregAndCheck'

4) The file is still in /var/cache/apt-cacher-ng/<somewhere>, but ACNG
has forgotten about it. A new request will fail with error 503 because
ACNG detects the file being in the cache ('Inconsistent File State').
ACNG deletes the file in question, and the next request will work.

This only happens if there is no 'Last Modified' HTTP header sent by
lighttpd. I've modified the lighttpd.conf to add this header, and ACNG
no longer gives the '503 Inconsistent File State' error.

Lighttpd.conf addition (from https://www.anexia-it.com/blog/en/the-tale-
of-lighttpd-not-sending-the-last-modified-header/ ):

mimetype.assign += ("" => "application/octet-stream" )

This still seems like a bug in ACNG, but this work-around might be
useful for some.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1826405

Title:
  Repeatedly "storage error [503 Inconsistent file state], last errno:
  File exists

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt-cacher-ng/+bug/1826405/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to