bzr refused to commit systemd-escaped filenames

Bug #1035045 reported by Stani
42
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Bazaar
Opinion
Undecided
Unassigned
Breezy
Fix Released
Wishlist
Jelmer Vernooij
bzr (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

Former titile: 'bzr refused to commit the filename "C:\nppdf32Log\debuglog.txt"'

To reproduce on an ubuntu system (oineiric, i386):
1) create a new folder repo and repo\log
2) Copy the file C:\nppdf32Log\debuglog.txt into the log folder
2) start a bzr repository (bzr init) in repo
3) bzr add log

$ bzr add log/
adding log
adding log/C:\nppdf32Log\debuglog.txt
bzr: ERROR: bzrlib.errors.InvalidEntryName: Invalid entry name: C:\nppdf32Log\debuglog.txt

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 946, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1150, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 699, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 721, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 716, in run
    no_recurse, action=action, save=not dry_run)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 51, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 452, in smart_add
    adder.add(file_list, recurse=recurse)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 744, in add
    this_ie = self._add_one_and_parent(parent_ie, directory, kind, inv_path)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 615, in _add_one_and_parent
    file_id=file_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/inventory.py", line 2263, in make_entry
    return factory(file_id, name, parent_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/inventory.py", line 420, in __init__
    super(InventoryFile, self).__init__(file_id, name, parent_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/inventory.py", line 220, in __init__
    raise errors.InvalidEntryName(name=name)
InvalidEntryName: Invalid entry name: C:\nppdf32Log\debuglog.txt

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: bzr 2.4.1-1ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-23.39-generic-pae 3.0.36
Uname: Linux 3.0.0-23-generic-pae i686
ApportVersion: 1.23-0ubuntu4
Architecture: i386
BzrDebugFlags: set()
BzrVersion: 2.4.1
CommandLine: ['/usr/bin/bzr', 'add', 'auctions/']
CrashDb: bzr
Date: Thu Aug 9 21:12:09 2012
ExecutablePath: /usr/bin/bzr
FileSystemEncoding: UTF-8
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
InterpreterPath: /usr/bin/python2.7
Locale: nl_NL.UTF-8
PackageArchitecture: all
Platform: Linux-3.0.0-23-generic-pae-i686-with-Ubuntu-11.10-oneiric
ProcCmdline: /usr/bin/python /usr/bin/bzr add auctions/
PythonVersion: 2.7.2
SourcePackage: bzr
Title: bzr crashed with InvalidEntryName in __init__(): Invalid entry name: C:\nppdf32Log\debuglog.txt
UpgradeStatus: Upgraded to oneiric on 2012-02-01 (190 days ago)
UserEncoding: UTF-8
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
Stani (stani) wrote :
tags: removed: need-duplicate-check
Changed in bzr (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This is now happening when using etckeeper on 16.04 with snappy. Eg:

$ sudo -H bzr add .
adding systemd/system/snaps-cap\x2dtest.sideload-LSXRFfhCCLCY.mount
bzr: ERROR: bzrlib.errors.InvalidEntryName: Invalid entry name: snaps-cap\x2dtest.sideload-LSXRFfhCCLCY.mount

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 842, in run
    no_recurse, action=action, save=not dry_run)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 52, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 453, in smart_add
    adder.add(file_list, recurse=recurse)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 764, in add
    inv_path)
  File "/usr/lib/python2.7/dist-packages/bzrlib/mutabletree.py", line 628, in _add_one_and_parent
    file_id=file_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/inventory.py", line 2234, in make_entry
    return factory(file_id, name, parent_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/inventory.py", line 422, in __init__
    super(InventoryFile, self).__init__(file_id, name, parent_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/inventory.py", line 222, in __init__
    raise errors.InvalidEntryName(name=name)
InvalidEntryName: Invalid entry name: snaps-cap\x2dtest.sideload-LSXRFfhCCLCY.mount

information type: Private → Public
description: updated
summary: - bzr refused to commit the filename "C:\nppdf32Log\debuglog.txt"
+ bzr refused to commit systemd-escaped filenames
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

To work around this, do:
$ cd /etc
$ sudo -H bzr ignore 'systemd/system/snaps-*' 'systemd/system/multi-user.target.wants/snaps-*'

Revision history for this message
Vincent Ladeuil (vila) wrote :

bzr refuses to handle files containing '/' or '\'.

For the "C:\nppdf32Log\debuglog.txt" case, on ubuntu, that seems legit, this is a windows path and attempting to checkout that file on a windows system will be problematic.

For the "systemd/system/snaps-cap\x2dtest.sideload-LSXRFfhCCLCY.mount" case... bzr, arguably, should accept the path as valid though...

Paul Collins (pjdc)
Changed in bzr (Ubuntu):
status: New → Confirmed
Revision history for this message
Stuart Bishop (stub) wrote :

Setting this to WONTFIX, since allowing this sort of filename would break Windows support.

Changed in bzr:
status: New → Opinion
Changed in bzr (Ubuntu):
status: Confirmed → Won't Fix
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
JP Vossen (jp-jpsdomain) wrote :

The hack-around in https://bugs.launchpad.net/ubuntu/+source/bzr/+bug/1035045/comments/3 "worked" for me with `etckeeper` + BZR on Mint-18, in that it stopped the error messages. I don't actually know or care what omitting the affected snap files in `/etc/` might do later.

Note I needed 2 lines in `/etc/.bzrignore` and was confused when the first line failed to work. And you probably also need to:
```
# Be root
cd /etc
sudo vi .bzrignore
 systemd/system/snap*
 systemd/system/multi-user.target.wants/snap*
bzr rm --keep systemd/system/snap* systemd/system/multi-user.target.wants/snap*
etckeeper commit 'Ugly hack-around for bzr/etckeeper errors for snapd use of backslash in file names'
```

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

FWIW this should work fine on versions of Mint that ship Breezy, rather than Bazaar.

Changed in brz:
status: Triaged → Fix Released
assignee: nobody → Jelmer Vernooij (jelmer)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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