TypeError: load() missing 1 required positional argument: 'Loader'

Bug #1948597 reported by Kenneth Loafman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
High
Unassigned
Snapcraft
Incomplete
Undecided
Unassigned
snapcraft (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Bad ending while trying to build duplicity snap on GitLab.

Sorry, an error occurred in Snapcraft:
We would appreciate it if you created a bug report at
https://launchpad.net/snapcraft/+filebug with the above text included.
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.43.1+18.4.1', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 136, in snap
    project = _execute(steps.PRIME, parts=[], **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 35, in _execute
    lifecycle.execute(step, project_config, parts)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 90, in execute
    executor.run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 196, in run
    self._create_meta(step, processed_part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 354, in _create_meta
    common.env = self.config.snap_env()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/project_loader/_config.py", line 289, in snap_env
    dependency_paths |= part.get_primed_dependency_paths()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 885, in get_primed_dependency_paths
    state = self.get_prime_state()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 144, in get_prime_state
    self._prime_state = cast(states.PrimeState, self.get_state(steps.PRIME))
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 148, in get_state
    return states.get_state(self.plugin.statedir, step)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/states/_state.py", line 96, in get_state
    state = yaml.load(f.read())
TypeError: load() missing 1 required positional argument: 'Loader'

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Any workaround for this? It's important to me.

tags: added: fatal snapcraft
description: updated
description: updated
Changed in duplicity:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Is there a reason for using snapcraft from the deb for 18.04 instead of the snap?

Changed in snapcraft:
status: New → Incomplete
Changed in snapcraft (Ubuntu):
status: New → Won't Fix
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Because snapcraft from deb is available on GitLab and should be kept up-to-date by Ubuntu.

I tried on 20.04 with the following GitLab job:

build_snap:
    stage: deploy
    when: manual
    image: ubuntu:20.04
    only: [master]
    script:
        - apt-get update
        - apt-get upgrade -y
        - apt-get install -y snapd snapcraft
        - snap install snapd classic
        - snap install snapcraft classic
        - VERSION=`./setup.py --version`
        - echo "make snap of ${VERSION}"
        - ./setup.py sdist --dist-dir=.
        - rm -rf build
        - mkdir -p build
        - tar xf duplicity-${VERSION}.tar.gz -C build
        - rm -f duplicity-${VERSION}.tar.gz
        - cd build/duplicity-${VERSION}
        - head -2 snap/snapcraft.yaml | tail -1
        - echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > snaplogin
        - snapcraft login --with snaplogin
        - rm snaplogin
        - snapcraft snap
        - snapcraft push duplicity_*.snap --release edge

It gets to the 3rd step, successfully installs snapd and hangs on installing snapcraft. I need snapd and snapcraft so I can bootstrap snapd and snapcraft snaps from the store.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

This bug was due to the Docker core18 being used and needs a Docker image with Snapcraft installed.

Changed in duplicity:
status: Confirmed → Fix Released
milestone: none → 0.8.22
Changed in duplicity:
status: Fix Released → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
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.