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 internal error: AttributeError("'NoneType' object has no attribute 'get'") on empty app #5112

Open
Saviq opened this issue Oct 12, 2024 · 2 comments
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged

Comments

@Saviq
Copy link
Contributor

Saviq commented Oct 12, 2024

Bug Description

Snapcraft fails with an internal error when any of apps.* are None

To Reproduce

snapcraft --verbose

Environment

N/A

snapcraft.yaml

# ... usual snap details
apps:
  foo:
  bar:

Relevant log output

Starting snapcraft, version 8.4.3
Log verbosity level set to BRIEF
Preparing application...
Configuring application...
Setting up ConfigService
Build plan: platform=None, build_for=None
Loading project file '/home/michal/dev/canonical/mesa-2404/snap/snapcraft.yaml'
snapcraft internal error: AttributeError("'NoneType' object has no attribute 'get'")
Traceback (most recent call last):
  File "/snap/snapcraft/12823/lib/python3.10/site-packages/craft_application/application.py", line 568, in run
    return_code = self._run_inner()
  File "/snap/snapcraft/12823/lib/python3.10/site-packages/snapcraft/application.py", line 215, in _run_inner
    return_code = super()._run_inner()
  File "/snap/snapcraft/12823/lib/python3.10/site-packages/craft_application/application.py", line 539, in _run_inner
    self.services.project = self.get_project(
  File "/snap/snapcraft/12823/lib/python3.10/site-packages/craft_application/application.py", line 315, in get_project
    yaml_data = self._transform_project_yaml(yaml_data, build_on, build_for)
  File "/snap/snapcraft/12823/lib/python3.10/site-packages/craft_application/application.py", line 630, in _transform_project_yaml
    yaml_data = self._extra_yaml_transform(
  File "/snap/snapcraft/12823/lib/python3.10/site-packages/snapcraft/application.py", line 262, in _extra_yaml_transform
    new_yaml_data = apply_extensions(yaml_data, arch=arch, target_arch=target_arch)
  File "/snap/snapcraft/12823/lib/python3.10/site-packages/snapcraft/extensions/_utils.py", line 48, in apply_extensions
    extension_names = app_definition.get("extensions", [])
AttributeError: 'NoneType' object has no attribute 'get'
Full execution log: '/home/michal/.local/state/snapcraft/log/snapcraft-20241012-132238.968481.log'

Additional context

No response

@lengau lengau added bug Actual bad behavior that don't fall into maintenance or documentation triaged labels Oct 16, 2024
Copy link

Thank you for reporting us your feedback!

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

This message was autogenerated

@lengau
Copy link
Contributor

lengau commented Oct 16, 2024

Just a note to whoever fixes this that this error occurs when applying extensions:

  File "/snap/snapcraft/12823/lib/python3.10/site-packages/snapcraft/extensions/_utils.py", line 48, in apply_extensions
    extension_names = app_definition.get("extensions", [])

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

2 participants