Ubuntu mirror rsync read error: Connection reset by peer (104)

Asked by Pablo García

Hello, I am having problems synchronizing our Ubuntu repository (ubuntu.repo.cure.edu.uy), after about 40 minutes after starting the synchronization I get the following messages:

rsync: [receiver] read error: Connection reset by peer (104)
rsync error: error in socket IO (code 10) at io.c(784) [receiver=3.2.3]
rsync: connection unexpectedly closed (917409 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [generator=3.2.3]
First stage of sync failed.

The script we use is:

#/bin/dash

fatal() {
  echo "$1"
  exit 1
}

warn() {
  echo "$1"
}

# Find a source mirror near you which supports rsync on
# https://launchpad.net/ubuntu/+archivemirrors
# rsync://<iso-country-code>.rsync.archive.ubuntu.com/ubuntu should always work
RSYNCSOURCE=rsync://uy.rsync.archive.ubuntu.com/ubuntu

# Define where you want the mirror-data to be on your mirror
BASEDIR=/var/www/html/ubuntu/mirror/

if [ ! -d ${BASEDIR} ]; then
  warn "${BASEDIR} does not exist yet, trying to create it..."
  mkdir -p ${BASEDIR} || fatal "Creation of ${BASEDIR} failed."
fi

rsync --recursive --omit-dir-times \
  --links --hard-links \
  --stats \
  ${RSYNCSOURCE} ${BASEDIR} || fatal "First stage of sync failed."

rsync --recursive --times --links --hard-links \
  --stats --delete --delete-after \
  ${RSYNCSOURCE} ${BASEDIR} || fatal "Second stage of sync failed."

chmod -R g=rx,o=rx ${BASEDIR}/pool/*

date -u > ${BASEDIR}/project/trace/$(hostname -f)

We have been having problems for several weeks now, and although we have tested against other repositories, it continues to give us the same error.

I appreciate if you can help us with this.

Greetings,
Pablo

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Pablo García
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

see https://wiki.ubuntu.com/Mirrors#Communication for the recommended communication channels about mirrors.

Revision history for this message
Haw Loeung (hloeung) said :
#2

As I said in the RT ticket. It's likely due to the mirrors selected being too far resulting in various timeouts. Suggested to pick a closer ccTLD source to sync/rsync from - uy.rsync.archive.ubuntu.com points at Canonical's main ubuntu archives so scattered between the US and UK.

Revision history for this message
Pablo García (pgarcia-l) said :
#3

Hello, we had previously tested against a couple of servers in Brazil and the same thing had happened to us.
Now we switched to a repository in Argentina and it worked.

Thanks for the reply.
Greetings,
Pablo