Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapcraft raises an internal error if there is a file called snap #5167

Open
mr-cal opened this issue Dec 5, 2024 · 1 comment
Open

Snapcraft raises an internal error if there is a file called snap #5167

mr-cal opened this issue Dec 5, 2024 · 1 comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged

Comments

@mr-cal
Copy link
Collaborator

mr-cal commented Dec 5, 2024

Bug Description

Running a snapcraft command fail if there is a file called snap in the pwd.

To Reproduce

touch snap
snapcraft login

Environment

Snapcraft 8.6.0

snapcraft.yaml

n/a

Relevant log output

phelps@arch ~/f/tmp> ls
phelps@arch ~/f/tmp> touch snap
phelps@arch ~/f/tmp> snapcraft login
Traceback (most recent call last):
  File "/snap/snapcraft/13008/bin/snapcraft", line 8, in <module>
    sys.exit(main())
  File "/var/lib/snapd/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/application.py", line 479, in main
    app = create_app()
  File "/var/lib/snapd/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/application.py", line 455, in create_app
    app = Snapcraft(
  File "/var/lib/snapd/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/application.py", line 104, in __init__
    self._snapcraft_yaml_path: pathlib.Path | None = self._resolve_project_path(
  File "/var/lib/snapd/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/application.py", line 160, in _resolve_project_path
    return super()._resolve_project_path(project_dir / "snap")
  File "/var/lib/snapd/snap/snapcraft/13008/lib/python3.10/site-packages/craft_application/application.py", line 325, in _resolve_project_path
    return (project_dir / f"{self.app.name}.yaml").resolve(strict=True)
  File "/var/lib/snapd/snap/snapcraft/13008/usr/lib/python3.10/pathlib.py", line 1077, in resolve
    s = self._accessor.realpath(self, strict=strict)
  File "/var/lib/snapd/snap/snapcraft/13008/bin/../usr/lib/python3.10/posixpath.py", line 396, in realpath
    path, ok = _joinrealpath(filename[:0], filename, strict, {})
  File "/var/lib/snapd/snap/snapcraft/13008/bin/../usr/lib/python3.10/posixpath.py", line 431, in _joinrealpath
    st = os.lstat(newpath)
NotADirectoryError: [Errno 20] Not a directory: '/home/phelps/files/tmp/snap/snapcraft.yaml'
phelps@arch ~/f/tmp [1]> rm snap
phelps@arch ~/f/tmp> snapcraft login
Enter your Ubuntu One e-mail address and password.
If you do not have an Ubuntu One account, you can create one at https://snapcraft.io/accountz

Additional context

No response

@mr-cal mr-cal added bug Actual bad behavior that don't fall into maintenance or documentation triaged labels Dec 5, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3773.

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged
Projects
None yet
Development

No branches or pull requests

1 participant