Bug#943374: dgit push-source fails and loses a package version number without retries

2019-10-25 Thread Russ Allbery
Ian Jackson  writes:

> The DNS resolver library used by ssh *does* retry.  See resolv.conf(5)
> `attempts:'.  But it defaults to 2 which seems far too little!

Oh, thank you.  This may be a better solution to my problem than changes
to dgit.  I think I mostly filed this bug because I was surprised there
was a possibility to fail past a point of no return in allocating the
version number, although in retrospect it makes sense there would be such
a point.

In retrospect, I probably should just run a caching DNS server on my
laptop so that I have more control over things like this.

> This is not so easy; not all of the commands are idempotent (because of
> the underlying protocols).  Also dgit does some things itself with (eg)
> a built-in http client.  I will consider your suggestion but if I do
> this it will probably be a long-term thing.

Good point, that makes sense.  Prompting is also kind of a pain.  Maybe
just the ssh commands, since they may be the most prone to failure?
Although that's just an assumption; maybe the internal HTTP client could
have just as easily had the same failure.

> It might also be possible to try to do the generation of signed
> artefacts in a single batch, and provide a way to retry the delivery of
> the objects to remote places.  That would also make it more convenient
> to work around a dput failure.

That sounds like an even better fix if it's possible.

-- 
Russ Allbery (r...@debian.org)  



Bug#943374: dgit push-source fails and loses a package version number without retries

2019-10-24 Thread Ian Jackson
Russ Allbery writes ("Bug#943374: dgit push-source fails and loses a package 
version number without retries"):
> Package: dgit
> Version: 9.9
> Severity: normal
> 
> This was unpleasant:

How annoying.

> The network from which I was trying to do dgit push-source had 20% packet
> loss.  If the DNS query had been retried, it probably would have worked.

The DNS resolver library used by ssh *does* retry.  See resolv.conf(5)
`attempts:'.  But it defaults to 2 which seems far too little!

> In general, this bug is to request that all dgit commands that may fail
> transiently after dgit has committed to consuming a version number be
> wrapped in something that will prompt whether I want to abort or retry the
> command if the command fails.

This is not so easy; not all of the commands are idempotent (because
of the underlying protocols).  Also dgit does some things itself with
(eg) a built-in http client.  I will consider your suggestion but if I
do this it will probably be a long-term thing.

It might also be possible to try to do the generation of signed
artefacts in a single batch, and provide a way to retry the delivery
of the objects to remote places.  That would also make it more
convenient to work around a dput failure.

Ian.



Bug#943374: dgit push-source fails and loses a package version number without retries

2019-10-23 Thread Russ Allbery
Package: dgit
Version: 9.9
Severity: normal

This was unpleasant:

wanderer:~/dvl/debian/gnubg$ dgit --gbp push-source
Format `3.0 (quilt)', need to check/update patch stack
canonical suite name for unstable is sid
gzip: warning: GZIP environment variable is deprecated; use an alias or script
dgit: split brain (separate dgit view) may be needed (--quilt=gbp).
dgit view: found cached (commit id a9bc802bb3fcc29b3250bcd79d06861cd1136a3c)
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building gnubg using existing ./gnubg_1.06.002.orig.tar.gz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: building gnubg in gnubg_1.06.002-3.debian.tar.xz
dpkg-source: info: building gnubg in gnubg_1.06.002-3.dsc
changelog will contain changes since 1.06.002-2
dpkg-genchanges: info: not including original source code in upload
Warning: Permanently added the ED25519 host key for IP address '82.195.75.78' 
to the list of known hosts.
last upload to archive: specified git info (debian)
warning: ignoring broken ref refs/remotes/origin/HEAD
warning: ignoring broken ref refs/remotes/origin/HEAD
using existing gnubg_1.06.002.orig.tar.gz
warning: ignoring broken ref refs/remotes/origin/HEAD
warning: ignoring broken ref refs/remotes/origin/HEAD
gzip: warning: GZIP environment variable is deprecated; use an alias or script
dgit: split brain (separate dgit view) may be needed (--quilt=gbp).
dgit view: found cached (commit id a9bc802bb3fcc29b3250bcd79d06861cd1136a3c)
Checking that HEAD includes all changes in archive...
Declaring that HEAD includes all changes in 1.06.002-2...
Made pseudo-merge of 1.06.002-2 into dgit view.
warning: ignoring broken ref refs/remotes/origin/HEAD
checking that gnubg_1.06.002-3.dsc corresponds to HEAD
dpkg-source: warning: extracting unsigned source package 
(/home/eagle/dvl/debian/gnubg/../gnubg_1.06.002-3.dsc)
dpkg-source: info: extracting gnubg in gnubg-1.06.002
dpkg-source: info: unpacking gnubg_1.06.002.orig.tar.gz
dpkg-source: info: unpacking gnubg_1.06.002-3.debian.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying 
0001-Support-finding-databases-in-var-as-well-as-usr.patch
dpkg-source: info: applying 0002-Expand-size-of-buffers-for-eval-messages.patch
../gnubg_1.06.002-3_source.changes already has appropriate .orig(s) (if any)
gpg: Signature made Wed 23 Oct 2019 05:24:46 PM PDT
gpg:using RSA key D73934B49674CF5CCD9AC2787D80315C5736DE75
gpg: Good signature from "Russ Allbery " [ultimate]
gpg: aka "Russ Allbery " [ultimate]
gpg: aka "Russ Allbery " [ultimate]
gpg: aka "Russ Allbery " [ultimate]
gpg: Signature made Wed 23 Oct 2019 05:24:56 PM PDT
gpg:using RSA key D73934B49674CF5CCD9AC2787D80315C5736DE75
gpg: Good signature from "Russ Allbery " [ultimate]
gpg: aka "Russ Allbery " [ultimate]
gpg: aka "Russ Allbery " [ultimate]
gpg: aka "Russ Allbery " [ultimate]
ssh: Could not resolve hostname push.dgit.debian.org: Temporary failure in name 
resolution
dgit: failed command: ssh 'd...@push.dgit.debian.org' ': dgit debian git-check 
gnubg ; set -e; cd /dgit/debian/repos; if test -d gnubg.git; then echo 1; else 
echo 0; fi'

dgit: error: subprocess failed with error exit status 255
! Push failed, while updating the remote git repository - see messages above.
! If you want to try again, you should use a new version number.

The network from which I was trying to do dgit push-source had 20% packet
loss.  If the DNS query had been retried, it probably would have worked.
What I ideally would have liked would be for dgit to pause and prompt me
whether to retry the command or to fail.

In general, this bug is to request that all dgit commands that may fail
transiently after dgit has committed to consuming a version number be
wrapped in something that will prompt whether I want to abort or retry the
command if the command fails.  That will allow me to take steps to fix the
local network, wait for a period of packet loss to pass, retry repeatedly,
etc., rather than having to change the source package and rebuild and then
upload again and hope the same thing doesn't happen.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'unstable-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.2.0-3-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dgit depends on:
ii  apt1.8.4
ii  ca-certificates20190110
ii  coreutils  8.30-3+b1
ii  curl   7.66.0-1
ii  devscript