crash creating a new package

Bug #1881287 reported by somekool
60
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Breezy
Fix Released
Medium
Jelmer Vernooij
Ubuntu Packaging Guide
New
Undecided
Unassigned
breezy-debian (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I am trying to my first ubuntu package.

and push it to my own PPA

I am following this guide.

https://packaging.ubuntu.com/html/packaging-new-software.html

I have followed all the steps up to this point.

but bzr is crashing

here is the output
```
$ bzr dh-make imlib 1.9.15 imlib-1.9.15.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 26, in _get_tree
    tree = workingtree.WorkingTree.open(".")
  File "/usr/lib/python3/dist-packages/breezy/workingtree.py", line 201, in open
    control = controldir.ControlDir.open(path, _unsupported=_unsupported)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 706, in open
    return klass.open_from_transport(t, probers=probers,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 736, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 724, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 1166, in find_format
    raise errors.NotBranchError(path=transport.base)
breezy.errors.NotBranchError: Not a branch: "/home/mathieu/projects/opensource/e13/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 37, in _get_tree
    a_controldir = controldir.ControlDir.open_from_transport(
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 736, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 724, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 1166, in find_format
    raise errors.NotBranchError(path=transport.base)
breezy.errors.NotBranchError: Not a branch: "/home/mathieu/projects/opensource/e13/imlib/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 136, in run_simple
    return _do_with_cleanups(
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/cmds.py", line 1385, in run
    tree = dh_make.import_upstream(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 83, in import_upstream
    tree = _get_tree(package_name)
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 42, in _get_tree
    branch = create_branch(to_transport.base,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 660, in create_branch_convenience
    controldir = klass.create(base, format, possible_transports)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 859, in create
    return format.initialize_on_transport(t)
AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'

brz 3.0.2 on python 3.8.2 (Linux-5.4.0-33-generic-x86_64-with-glibc2.29)
arguments: ['/usr/bin/bzr', 'dh-make', 'imlib', '1.9.15',
    'imlib-1.9.15.tar.gz']
plugins: bash_completion[3.0.2], changelog_merge[3.0.2],
    commitfromnews[3.0.2], cvs[3.0.2], darcs[3.0.2], debian[3.0.0],
    email[3.0.2], fastimport[3.0.2], launchpad[3.0.2], mtn[3.0.2],
    netrc_credential_store[3.0.2], news_merge[3.0.2], po_merge[3.0.2],
    propose[3.0.2], repodebug[3.0.2], stats[3.0.2], upload[3.0.2],
    weave_fmt[3.0.2]
encoding: 'utf-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/brz/+filebug
    including this traceback and a description of the problem.

```

Jelmer Vernooij (jelmer)
affects: brz → brz-debian
Changed in brz-debian:
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
affects: brz-debian → brz
Changed in brz:
status: Triaged → Fix Released
milestone: none → 3.1.0
Revision history for this message
somekool (somekool) wrote :

awesome
thanks for the quick fix.

do you think I can except a package for Ubuntu 20.04 ?
I will for sure test it as soon as available

Revision history for this message
somekool (somekool) wrote :

since 20.04 is LTS, unless Breezy 3.1 is scheduled to be released soon, it seems this bug fixed should be backported to 3.0

my two cents

somekool (somekool)
Changed in brz:
status: Fix Released → Fix Committed
Revision history for this message
somekool (somekool) wrote :

I confirm, I checkout the 3.1 branch locally and I could proceed with the command without errors

Revision history for this message
somekool (somekool) wrote :

I am getting a different error now

```
mathieu:e13 :-) (lifebook-wu2) $ brz dh-make imlib1 1.9.15 imlib-1.9.15.tar.gz
Fetching tarball
Looking for a way to retrieve the upstream tarball
Upstream tarball already exists in build directory, using that
brz: ERROR: TypeError: can only concatenate str (not "bytes") to str

Traceback (most recent call last):
  File "/home/mathieu/projects/opensource/e13/3.1/breezy/commands.py", line 1022, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/mathieu/projects/opensource/e13/3.1/breezy/commands.py", line 1208, in run_bzr
    ret = run(*run_argv)
  File "/home/mathieu/projects/opensource/e13/3.1/breezy/commands.py", line 762, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/mathieu/projects/opensource/e13/3.1/breezy/commands.py", line 787, in run
    return class_run(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/cmds.py", line 1385, in run
    tree = dh_make.import_upstream(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 94, in import_upstream
    db.import_upstream_tarballs(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/import_dsc.py", line 910, in import_upstream_tarballs
    return self.import_upstream(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/import_dsc.py", line 881, in import_upstream
    (tag, revid) = self.pristine_upstream_source.import_component_tarball(
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/upstream/pristinetar.py", line 444, in import_component_tarball
    tag_name = self.tag_name(version, component=component)
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/upstream/pristinetar.py", line 326, in tag_name
    name = "upstream-" + version
TypeError: can only concatenate str (not "bytes") to str

You can report this problem to Bazaar's developers by running
    apport-bug /var/crash/brz.1000.2020-06-01T08:27.crash
if a bug-reporting window does not automatically appear.
brz: warning: some compiled extensions could not be loaded; see ``brz help missing-extensions``
```

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

You also need the trunk version of lp:brz-debian.

Jelmer Vernooij (jelmer)
Changed in brz:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in breezy-debian (Ubuntu):
status: New → Confirmed
Revision history for this message
Talha Asghar (iamtalhaasghar) wrote :
Download full text (4.8 KiB)

Unfortunately, I am still having the same issue.
Here is the version details of Breezy on my computer.

Breezy (brz) 3.0.2
  Python interpreter: python3 3.8.5
  Python standard library: python3.8
  Platform: Linux-5.4.0-54-generic-x86_64-with-glibc2.29

And here is the bug log:
~$ bzr dh-make hello 2.10 hello-2.10.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 26, in _get_tree
    tree = workingtree.WorkingTree.open(".")
  File "/usr/lib/python3/dist-packages/breezy/workingtree.py", line 201, in open
    control = controldir.ControlDir.open(path, _unsupported=_unsupported)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 706, in open
    return klass.open_from_transport(t, probers=probers,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 736, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 724, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 1166, in find_format
    raise errors.NotBranchError(path=transport.base)
breezy.errors.NotBranchError: Not a branch: "/home/talha/Downloads/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 37, in _get_tree
    a_controldir = controldir.ControlDir.open_from_transport(
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 736, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 724, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 1166, in find_format
    raise errors.NotBranchError(path=transport.base)
breezy.errors.NotBranchError: Not a branch: "/home/talha/Downloads/hello/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 136, in run_simple
    return _do_with_cleanups(
  File "/us...

Read more...

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This is fixed in breezy/breezy-debian, but Ubuntu still has an old version of those packages.

Revision history for this message
Michael Martins (michaelfm21) wrote :
Download full text (4.0 KiB)

Same error here.
Ubuntu 20.04.3

bzr dh-make hello 2.10 hello-2.10.tar.gz
brz: ERROR: AttributeError: 'NoneType' object has no attribute 'initialize_on_transport'

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 26, in _get_tree
    tree = workingtree.WorkingTree.open(".")
  File "/usr/lib/python3/dist-packages/breezy/workingtree.py", line 201, in open
    control = controldir.ControlDir.open(path, _unsupported=_unsupported)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 706, in open
    return klass.open_from_transport(t, probers=probers,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 736, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 724, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 1166, in find_format
    raise errors.NotBranchError(path=transport.base)
breezy.errors.NotBranchError: Not a branch: "/home/michael/projetos/empacota_deb/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/dh_make.py", line 37, in _get_tree
    a_controldir = controldir.ControlDir.open_from_transport(
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 736, in open_from_transport
    transport, format = _mod_transport.do_catching_redirections(
  File "/usr/lib/python3/dist-packages/breezy/transport/__init__.py", line 1613, in do_catching_redirections
    return action(transport)
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 724, in find_format
    return transport, ControlDirFormat.find_format(transport,
  File "/usr/lib/python3/dist-packages/breezy/controldir.py", line 1166, in find_format
    raise errors.NotBranchError(path=transport.base)
breezy.errors.NotBranchError: Not a branch: "/home/michael/projetos/empacota_deb/hello/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1016, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 1202, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 759, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python3/dist-packages/breezy/commands.py", line 784, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 136, in run_simple
    return _do_with_cleanups(
  File "/usr/lib/python3/dist-packages/breezy/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/breezy/plugins/debian/cmds.py", line 1385, in run
    tree = dh_make...

Read more...

Revision history for this message
Sam Varshavchik (mrsam) wrote :

It would be useful if someone were to post the exact steps to work around this bug, so that someone who is trying to learn how to create packages and is following the published Ubuntu packaging guide documentation can, well, follow it.

As noted in bug 1897385, someone who's trying to learn how to create Ubuntu packages is not going to have any idea how to manually update to 3.1.0 where this is fixed, since it's not been published for 20.

Revision history for this message
Zakhar (alainb06) wrote :

Indeed mrsam!

My current workaround is to use 16.04 that I still have, and bazaar and how it is used in the Ubuntu documentation is still working there.

The limitation of doing so is that some libraries I need on my projects have since changed, and it does not "build" with 16.04. This is not an issue since I don't use locally built packages, but those from the launchpad.

With 16.04 you can still make the "source package" and post it to launchpad (dput last command) so it is unfortunately not a "blocker" for me. It might also work with 18.04 but I don't have it on my PCs, never really liked that version!

Crossing fingers that it would be solved for 22.04...

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Not a breezy-debian bug

Please file a bug against the packaging guide rather than breezy-debian.

This issue has been addressed upstream
in breezy-debian (which is not ubuntu-specific), where the dh-make wrapper
in breezy has been removed. This means than even if Ubuntu updates the
version of breezy-debian the guide will be incorrect.

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.