Ubuntu 14.04's Debmirror broken?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Ubuntu 14.04's Debmirror broken?

Robert Heller
I have been using debmirror (1:2.16ubuntu1.1) on an Ubuntu 14.04 server to
maintain a local mirror of Ubuntu 14.04, but in the past week it is failing:

Use of uninitialized value $l in chop at /usr/share/perl5/LockFile/Simple.pm line 438.
Use of uninitialized value $l in string eq at /usr/share/perl5/LockFile/Simple.pm line 439.
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
WARNING: waiting for /Mirror/ubuntu lock since 20 seconds
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
WARNING: still waiting for /Mirror/ubuntu lock after 50 seconds
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
WARNING: still waiting for /Mirror/ubuntu lock after 80 seconds
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
WARNING: still waiting for /Mirror/ubuntu lock after 110 seconds
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
Use of uninitialized value $stamp in chop at /usr/share/perl5/LockFile/Simple.pm line 570.
Use of uninitialized value $stamp in pattern match (m//) at /usr/share/perl5/LockFile/Simple.pm line 576.
Use of uninitialized value $hostname in string ne at /usr/share/perl5/LockFile/Simple.pm line 578.
Archive-Update-in-Progress-ub140464.wendellfreelibrary.org exists or you lack proper permissions; aborting at /usr/bin/debmirror line 867.

The fragment of /usr/share/perl5/LockFile/Simple.pm where this error is
occuring is this:

#
# _acs_lock -- private
#
# Internal locking routine.
#
# If $try is true, don't wait if the file is already locked.
# Returns true if the file was locked.
#
sub _acs_lock { ## private
        my $self = shift;
        my ($file, $format, $try) = @_;
        my $max = $self->max;
        my $delay = $self->delay;
        my $stamp = $$;

        # For NFS, we need something more unique than the process's PID
        $stamp .= ':' . hostname if $self->nfs;

        # Compute locking file name -- hardwired default format is "%f.lock"
        my $lockfile = $file . $self->ext;
        $format = $self->format unless defined $format;
        $lockfile = $self->lockfile($file, $format) if defined $format;

        # Detect stale locks or break lock if held for too long
        $self->_acs_stale($file, $lockfile) if $self->stale;
        $self->_acs_check($file, $lockfile) if $self->hold;

        my $waited = 0; # Amount of time spent sleeping
        my $lastwarn = 0; # Last time we warned them...
        my $warn = $self->warn;
        my ($wmin, $wafter, $wfunc);
        ($wmin, $wafter, $wfunc) =
                ($self->wmin, $self->wafter, $self->wfunc) if $warn;
        my $locked = 0;
        my $mask = umask(0333); # No write permission
        local *FILE;

        while ($max-- > 0) {
                if (-f $lockfile) {
                        next unless $try;
                        umask($mask);
                        return 0; # Already locked
                }

                # Attempt to create lock
                if (open(FILE, ">$lockfile")) {
                        local $\ = undef;
                        my $buf = "$stamp\n";
                        if (!syswrite(FILE, $buf, length($buf))) {
                                &$wfunc("writing to $lockfile: $!\n");
                                close(FILE);
                                if (!unlink($lockfile)) {
                                        &$wfunc("removing $lockfile: $!");
                                }
                                umask($mask);
                                return 0;  # Couldn't write to file
                        }
                        close FILE;
                        open(FILE, $lockfile); # Check lock
                        my $l;
                        chop($l = <FILE>);
                        $locked = $l eq $stamp;
                        $l = <FILE>; # Must be EOF
                        $locked = 0 if defined $l;
                        close FILE;
                        last if $locked; # Lock seems to be ours
                } elsif ($try) {
                        umask($mask);
                        return 0; # Already locked, or cannot create lock
                }
        } continue {
                sleep($delay); # Busy: wait
                $waited += $delay;

                # Warn them once after $wmin seconds and then every $wafter seconds
                if (
                        $warn &&
                                ((!$lastwarn && $waited > $wmin) ||
                                ($waited - $lastwarn) > $wafter)
                ) {
                        my $waiting  = $lastwarn ? 'still waiting' : 'waiting';
                        my $after  = $lastwarn ? 'after' : 'since';
                        my $s = $waited == 1 ? '' : 's';
                        &$wfunc("$waiting for $file lock $after $waited second$s");
                        $lastwarn = $waited;
                }

                # While we wait, existing lockfile may become stale or too old
                $self->_acs_stale($file, $lockfile) if $self->stale;
                $self->_acs_check($file, $lockfile) if $self->hold;
        }

        umask($mask);
        return $locked;
}

Line 438 is the "my $l;", just after the 'open(FILE, $lockfile);  # Check
lock' line.  I don't know Perl well enough to know what the problem is.

My ~/.debmirror file contains:

# Default config for debmirror

# The config file is a perl script so take care to follow perl syntax.
# Any setting in /etc/debmirror.conf overrides these defaults and
# ~/.debmirror.conf overrides those again. Take only what you need.
#
# The syntax is the same as on the command line and variable names
# loosely match option names. If you don't recognize something here
# then just stick to the command line.
#
# Options specified on the command line override settings in the config
# files.

# Location of the local mirror (use with care)
$mirrordir="/Mirror/ubuntu";

# Output options
$verbose=0;
$progress=0;
$debug=0;

# Download options
$host="us.archive.ubuntu.com";
$user="anonymous";
$passwd="anonymous@";
$remoteroot="ubuntu";
$download_method="http";
#@dists="precise,precise-updates,precise-security,precise-backports,trusty,trusty-updates,trusty-security,trusty-backports";
@dists="trusty,trusty-updates,trusty-security,trusty-backports";
@sections="main,universe,restricted,multiverse,debian-installer";
@arches="i386,amd64";
#@di_dists="dists";
#@di_archs="archs";
# @ignores="";
# @excludes="";
# @includes="";
# @excludes_deb_section="";
# @limit_priority="";
$omit_suite_symlinks=0;
$skippackages=0;
# @rsync_extra="doc,tools";
$i18n=0;
$getcontents=0;
$do_source=0;
$max_batch=0;

@di_dists="trusty";
@di_archs="i386,amd64";

# Save mirror state between runs; value sets validity of cache in days
$state_cache_days=0;

# Security/Sanity options
$ignore_release_gpg=0;
$ignore_release=0;
$check_md5sums=0;
$ignore_small_errors=0;

# Cleanup
$cleanup=1;
$post_cleanup=1;
$pre_cleanup=1;

# Locking options
$timeout=300;

# Rsync options
$rsync_batch=200;
$rsync_options="-aIL --partial";

# FTP/HTTP options
$passive=0;
# $proxy="<a href="http://proxy:port/">http://proxy:port/";

# Dry run
$dry_run=0;

# Don't keep diff files but use them
$diff_mode="use";

# The config file must return true or perl complains.
# Always copy this.
1;


--
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
[hidden email]       -- Webhosting Services
                                                     

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu 14.04's Debmirror broken?

Oliver Grawert
hi,
Am Samstag, den 12.05.2018, 13:44 -0400 schrieb Robert Heller:
> Archive-Update-in-Progress-ub140464.wendellfreelibrary.org exists or
> you lack proper permissions; aborting at /usr/bin/debmirror line 867.

with such a message my first look would go towards a former run of the
tool hanging or having died in a way that didnt clean up the lockfile
...

next: is the diskspace sufficient, does the user running it have the
correct permissions, if the mirror dir is a mountpoint, were there
filesystem errors that caused it to go into readonly state ... 


and last ... when did the debmirror package change last and could this
be related: https://launchpad.net/ubuntu/+source/debmirror (seemingly
not)

ciao
        oli
--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu 14.04's Debmirror broken?

Robert Heller
At Sun, 13 May 2018 10:29:47 +0200 "Ubuntu user technical support,  not for general discussions" <[hidden email]> wrote:

>
>
>
> hi,
> Am Samstag, den 12.05.2018, 13:44 -0400 schrieb Robert Heller:
> > Archive-Update-in-Progress-ub140464.wendellfreelibrary.org exists or
> > you lack proper permissions; aborting at /usr/bin/debmirror line 867.
>
> with such a message my first look would go towards a former run of the
> tool hanging or having died in a way that didnt clean up the lockfile
The lockfile was cleaned up -- I have a cronjob to take care of that.

> ...
>
> next: is the diskspace sufficient, does the user running it have the
> correct permissions, if the mirror dir is a mountpoint, were there
> filesystem errors that caused it to go into readonly state ... 

OK, the disk is full.  :-(.

It would be nice if debmirror handled this and gave a useful error message...

>
>
> and last ... when did the debmirror package change last and could this
> be related: https://launchpad.net/ubuntu/+source/debmirror (seemingly
> not)
>
> ciao
> oliContent-Description: This is a digitally signed message part
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iEYEABEKAAYFAlr393sACgkQSsOT+6LQaTY+KQCggVrRTixDQO5MNtK6XTBiGjHw
> 7ssAniD2IB1xi+zAQsUTS9wf0Bz50dxm
> =FmcD
> -----END PGP SIGNATURE-----
>
> MIME-Version: 1.0
>
--
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
[hidden email]       -- Webhosting Services
                                                                                                                   


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users