/root/project is Multipass mount inaccessible when the project dir path contains Chinese characters

Bug #1891851 reported by 林博仁(Buo-ren, Lin)
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Confirmed
Undecided
Unassigned

Bug Description

## bug reproducing instructions ##
1. cd ~
2. mkdir snapcraft-bug-root-project-unicode-problem-中文
3. cd snapcraft-bug-root-project-unicode-problem-中文
4. snapcraft init
5. snapcraft clean # for cleaning previous instances with the same _snap_name_
6. snapcraft

## terminal output(tail) ##
### variant 1 ###
```
Priming main
The command 'bin/bfg-launch' was not found in the prime directory, it has been changed to '/bin/bash'.
A shell wrapper will be generated for command '/bin/bash $SNAP/bin/bfg-launch' as it does not conform with the command pattern expected by the runtime. Commands must be relative to the prime directory and can only consist of alphanumeric characters, spaces, and the following special characters: / . _ # : $ -
Snapping |
Failed to create snap, snap command failed:
stdout:

stderr:
error: cannot pack "/root/prime": mksquashfs call failed: Could not create destination file: Operation not permitted
```

### variant 2 ###
```
snapcraft 4.1.5 from Canonical✓ installed
"snapcraft" switched to the "latest/stable" channel

Running with 'sudo' may cause permission errors and is discouraged. Use 'sudo' when cleaning.
[Errno 1] Operation not permitted: 'snap/snapcraft.yaml'
```

## traceback ##
### variant 1 ###
```
Traceback (most recent call last):
  File "/snap/snapcraft/5308/bin/snapcraft", line 33, in <module>
    sys.exit(load_entry_point('snapcraft==4.1.5', 'console_scripts', 'snapcraft')())
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/_command.py", line 88, in invoke
    return super().invoke(ctx)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 354, in snap
    _execute(steps.PRIME, parts=tuple(), pack_project=True, output=output, **kwargs)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 96, in _execute
    output=output,
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 220, in _pack
    snap_filename = _run_pack(command)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 189, in _run_pack
    f"Failed to create snap, snap command failed:\nstdout:\n{stdout}\nstderr:\n{stderr}"
RuntimeError: Failed to create snap, snap command failed:
stdout:

stderr:
error: cannot pack "/root/prime": mksquashfs call failed: Could not create destination file: Operation not permitted
```

### variant 2 ###
```
Traceback (most recent call last):
  File "/snap/snapcraft/5308/bin/snapcraft", line 33, in <module>
    sys.exit(load_entry_point('snapcraft==4.1.5', 'console_scripts', 'snapcraft')())
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/_command.py", line 88, in invoke
    return super().invoke(ctx)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 354, in snap
    _execute(steps.PRIME, parts=tuple(), pack_project=True, output=output, **kwargs)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 86, in _execute
    project = get_project(is_managed_host=is_managed_host, **kwargs)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/cli/_options.py", line 340, in get_project
    is_managed_host=is_managed_host,
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/project/_project.py", line 57, in __init__
    self.info = ProjectInfo(snapcraft_yaml_file_path=snapcraft_yaml_file_path)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/project/_project_info.py", line 29, in __init__
    self.__raw_snapcraft = yaml_utils.load_yaml_file(snapcraft_yaml_file_path)
  File "/snap/snapcraft/5308/lib/python3.6/site-packages/snapcraft/yaml_utils.py", line 35, in load_yaml_file
    with open(yaml_file_path, "rb") as fp:
PermissionError: [Errno 1] Operation not permitted: 'snap/snapcraft.yaml'
```

description: updated
Changed in snapcraft:
status: New → Confirmed
Revision history for this message
Chris Patterson (cjp256) wrote :
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.