Zero byte successful merge after error from dpkg-mergechangelogs

Bug #893495 reported by Marcin Juszkiewicz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bzr-builddeb
Fix Released
Undecided
Martin Packman
dpkg
Fix Released
Unknown
bzr-builddeb (Ubuntu)
Fix Released
Medium
Jelmer Vernooij

Bug Description

I was merging lp:ubuntu/gcc-4.6 into my lp:~hrw/ubuntu/precise/gcc-4.6/cross-fixes branch and as result I got debian/changelog dropped to 0 size:

09:29 hrw@puchatek:gcc-4.6-my-cross-fixes$ bzr merge lp:ubuntu/gcc-4.6
Most recent Ubuntu version: 4.6.2-5ubuntu1
Packaging branch status: CURRENT
Traceback (most recent call last):e merge 1/16
  File "/usr/lib/python2.7/logging/__init__.py", line 865, in emit
    stream.write(fs % msg.encode("UTF-8"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 23: ordinal not in range(128)
Logged from file merge_changelog.py, line 73
+N debian/patches/gcc-multilib64-multiarch-trunk.diff
+N debian/patches/gcc-powerpc-nof-trunk.diff
+N debian/patches/libffi-powerpc-sysv-without-string-ops.diff
 M debian/changelog
 M debian/control
 M debian/control.m4
-D debian/patches/arm-unbreak-eabi-armv4t.diff
 M debian/patches/armhf-triplet-trunk.diff
 M debian/patches/gcc-multiarch.diff
 M debian/patches/svn-updates-linaro.diff
 M debian/patches/svn-updates.diff
 M debian/rules.conf
 M debian/rules.defs
 M debian/rules.parameters
 M debian/rules.patch
 M debian/rules2
Text conflict in debian/control.m4
Text conflict in debian/rules2
2 conflicts encountered.

09:54 hrw@puchatek:debian$ bzr diff|diffstat
 changelog |10138 --------------------

According to mgz from #bzr bug is in a way how bzr-builddeb/merge_changelog.py uses logger. After changing code I got:

10:08 hrw@puchatek:debian$ LC_ALL=C bzr remerge changelog
debian/changelog is not conflicted
dpkg-mergechangelogs: warning: /tmp/tmpiGP5_Sdeb_changelog_merge/changelog.this(l0): found eof where expected first heading
dpkg-mergechangelogs: error: ss-970814-1 is not a valid version

All changes applied successfully.

And changelog file was still empty.

Change was in/usr/share/pyshared/bzrlib/plugins/builddeb/merge_changelog.py file (line 73):

- _logger.warning('%s', stderr)
+ _logger.warning('%s', stderr.decode("utf-8", "replace"))

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: bzr-builddeb 2.7.9ubuntu1
ProcVersionSignature: Ubuntu 3.1.0-2.3-generic 3.1.0
Uname: Linux 3.1.0-2-generic x86_64
ApportVersion: 1.26-0ubuntu1
Architecture: amd64
Date: Tue Nov 22 09:52:45 2011
InstallationMedia: Kubuntu 10.04 "Lucid Lynx" - Release Candidate amd64 (20100419.1)
PackageArchitecture: all
SourcePackage: bzr-builddeb
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Bug happened because of Polish error message was UTF-8:

debian/changelog is not conflicted
dpkg-mergechangelogs: ostrzeżenie: /tmp/tmpKJKi6cdeb_changelog_merge/changelog.this(l0): oczekiwano first heading, a znaleziono koniec pliku
dpkg-mergechangelogs: błąd: ss-970814-1 is not a valid version

All changes applied successfully.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

lp:~hrw/ubuntu/precise/gcc-4.6/cross-fixes branch was at r71 before merge

Martin Packman (gz)
description: updated
summary: - UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 23:
- ordinal not in range(128)
+ Zero byte successful merge after error from dpkg-mergechangelogs
Revision history for this message
Martin Packman (gz) wrote :

Okay, I think the logging issue is best handled upstream in bzrlib, see bug 714449 for that.

What I understand about the underlying problem from builddeb.merge_changelog from the output is:

* Running `bzr --no-plugins remerge debian/changelog` avoids the issue by disabling the changelog merge hook

* Despite stderr output, the merge hook returns "successful" but produces an empty debian/changelog

* The meaning of the errors is:

    dpkg-mergechangelogs: warning: /tmp/tmpiGP5_Sdeb_changelog_merge/changelog.this(l0): found eof where expected first heading

^ The hook is creating an empty changelog.this

    dpkg-mergechangelogs: error: ss-970814-1 is not a valid version

^ An early entry in the changelog has a bad version:

    egcs (ss-970814-1) experimental; urgency=low

      * Initial packaging (of initial snapshot!)

     -- Galen Hazelwood <email address hidden> Wed, 20 Aug 1997 00:36:28 +0000

* Merging the attached files here with dpkg-mergechangelogs works, without "not a valid version" appearing

* Merging the attached files with an empty changelog.this results in *some* output

Trying the same merge locally to work out where the hook is going wrong seems like a good next step, though some of this code has changed in more recent bzr-builddeb versions.

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

Seems the bug is confirmed, so setting it as such. Chose an importance of Medium.

Changed in bzr-builddeb (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Martin Packman (gz) wrote :

So, the problem is that newer versions of dpkg-mergechangelogs abort given a the 'ss-970814-1' package version, and builddeb doesn't correctly detect that case. Have sent a patch upstream to dpkg, and have a branch fixing both the log encoding handling and this error case for builddeb.

Changed in bzr-builddeb:
assignee: nobody → Martin Packman (gz)
status: New → In Progress
Martin Packman (gz)
Changed in bzr-builddeb:
status: In Progress → Fix Committed
Changed in dpkg:
status: Unknown → New
Jelmer Vernooij (jelmer)
Changed in bzr-builddeb:
status: Fix Committed → Fix Released
Changed in bzr-builddeb (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Jelmer Vernooij (jelmer)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr-builddeb - 2.8.0

---------------
bzr-builddeb (2.8.0) unstable; urgency=low

  [ Jonathan Riddell ]
  * Add get-orig-source command which will get the upstream tar file.
    LP: #862188
  * Change "bd-do" command to "builddeb-do" and alias "bd-do".
  * Add commit-message-from-changelog option for those who do not
    want commit message set automatically

  [ Jelmer Vernooij ]
  * Support importing and building packages with multiple upstream
    tarballs. LP: #653757, LP: #664834
  * Move .bzr-builddeb/default.conf to debian/bzr-builddeb.conf.
    LP: #793137
  * Fix test suite on Lucid, where dpkg-mergechangelogs is not available.

  [ Martin Packman ]
  * Fix test_utf8_changelog when run with older versions of python-debian.

  [ Jelmer Vernooij ]
  * Support svn-buildpackage tag names to find upstream versions.
    LP: #874263
  * Support --revision argument to merge-package. LP: #888590
  * By default, don't override the commit message from debian/changelog
    unless 'commit-message-from-changelog' is explicitly set to True. LP: #812749
  * Support running dep3-patch against remote repositories, and with
    open-ended revision ranges. LP: #893608
  * Fix finding orig tarballs in directories also containing filenames
    with non-utf8 characters. LP: #865753
  * bzr-builddeb now prefers the 'get-packaged-orig-source' rule to
    retrieve the packaged upstream source, and warns about
    'get-orig-source'. LP: #409862
  * Support translations.

  [ Martin Packman ]
  * Deal with invalid versions and bad encoding in the changelog merge
    hook. LP: #893495

 -- Jelmer Vernooij <email address hidden> Fri, 16 Dec 2011 19:58:57 +0100

Changed in bzr-builddeb (Ubuntu):
status: In Progress → Fix Released
Changed in dpkg:
status: New → Fix Committed
Changed in dpkg:
status: Fix Committed → Fix Released
Changed in dpkg:
status: Fix Released → New
Changed in dpkg:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.