Which naturally fails because at this point, apt-mirror hasn't created anything yet. Basically a race condition. Also, it's pointless to run chown here until after apt-mirror completes anyway.
I've got a patch that addresses this, testing now to see how it fares, so far so good.
It seems that the root cause is that we kick off apt-mirror in the background but then nearly immediately run the chown line:
chown -R www-data:www-data $ARCHIVE_ MIRROR/ mirror/ *
Which naturally fails because at this point, apt-mirror hasn't created anything yet. Basically a race condition. Also, it's pointless to run chown here until after apt-mirror completes anyway.
I've got a patch that addresses this, testing now to see how it fares, so far so good.