bzr refused to commit systemd-escaped filenames

Bug #1035045 reported by Stani on 2012-08-09
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Bazaar
Undecided
Unassigned
Breezy
Wishlist
Unassigned
bzr (Ubuntu)
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

Stani (stani) wrote :
tags: removed: need-duplicate-check
Changed in bzr (Ubuntu):
importance: Undecided → Medium
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
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-*'

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) on 2017-01-27
Changed in bzr (Ubuntu):
status: New → Confirmed
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) on 2017-06-21
Changed in brz:
status: New → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers