[SOLVED] Snapcraft is failing with "IndentationError: expected an indented block"

Since yesterday, without any (I hope so!) modifications on our side, the snapcraft build of Remmina is failing, and I don’t know how to debug this issue.

$ snapcraft --destructive-mode
Traceback (most recent call last):
  File "/snap/snapcraft/current/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==3.5.1', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/current/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/snap/snapcraft/current/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/snap/snapcraft/current/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/snap/snapcraft/current/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/snap/snapcraft/current/lib/python3.5/site-packages/snapcraft/cli/__main__.py", line 23, in <module>
    from ._runner import run
  File "/snap/snapcraft/current/lib/python3.5/site-packages/snapcraft/cli/_runner.py", line 30, in <module>
    from .lifecycle import lifecyclecli
  File "/snap/snapcraft/current/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 32, in <module>
    from snapcraft.internal import (
  File "/snap/snapcraft/current/lib/python3.5/site-packages/snapcraft/internal/lifecycle/__init__.py", line 19, in <module>
    from ._runner import execute  # noqa: F401
  File "/snap/snapcraft/current/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 22, in <module>
    from snapcraft.internal import (
  File "/snap/snapcraft/current/lib/python3.5/site-packages/snapcraft/internal/meta/__init__.py", line 17, in <module>
    from snapcraft.internal.meta._snap_packaging import create_snap_packaging  # noqa
  File "/snap/snapcraft/current/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 34, in <module>
    from snapcraft.internal.project_loader import _config
  File "/snap/snapcraft/current/lib/python3.5/site-packages/snapcraft/internal/project_loader/_config.py", line 233
    (project.info.base)
    ^
IndentationError: expected an indented block

Can I have some help to debug this?

https://gitlab.com/Remmina/Remmina/blob/master/snap/snapcraft.yaml

Thanks in advance!!!

You might try yamllint:

sudo apt install -y yamllint
yamllint snap/snapcraft.yaml

Might be available as a snap, not sure. I use it all the time. It’s very picky (you can customize to make it less picky), but it works quite well.

I use it.
We didin’t touch the yaml since many months, when suddenly I got that error

Heh, I guess I should go check my snaps for this issue . . .

It seems that snapcraft itself is crashing on indentation error. It is the python code that is the problem, not the yaml. CC @sergiusens

I’ve submitted a bug report

2 Likes

The problem has been identified and fixed, it was the ubuntu/gnome docker image, they have rebuilt it and now it’s fine.
thanks for the help.

1 Like