Snapcraft crashes when uploading snap file

Dear all,

I have difficulties when I try to upload my snap to the snap store. I generate the snap locally, and after confirming that I runs fine, I try to upload with the command:

snapcraft upload /home/kebekus/Software/projects/enroute/build-linux-debug/packaging/snap/enroute-flight-navigation_2.7.0_amd64.snap --release stable

The command crashes with the message below. Is there anything I can do? Any help is greatly appreciated.



Preparing to upload ‘enroute-flight-navigation_2.7.0_amd64.snap’.
After uploading, the resulting snap revision will be released to ‘stable’ when it passes the Snap Store review.
Running the review tools before pushing this snap to the Snap Store.
Sorry, an error occurred in Snapcraft:
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File “/snap/snapcraft/6466/bin/snapcraft”, line 33, in
sys.exit(load_entry_point(‘snapcraft==4.7.1’, ‘console_scripts’, ‘snapcraft’)())
File “/snap/snapcraft/6466/lib/python3.6/site-packages/click/”, line 829, in call
return self.main(*args, **kwargs)
File “/snap/snapcraft/6466/lib/python3.6/site-packages/click/”, line 782, in main
rv = self.invoke(ctx)
File “/snap/snapcraft/6466/lib/python3.6/site-packages/click/”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/snap/snapcraft/6466/lib/python3.6/site-packages/click/”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/snap/snapcraft/6466/lib/python3.6/site-packages/click/”, line 610, in invoke
return callback(*args, **kwargs)
File “/snap/snapcraft/6466/lib/python3.6/site-packages/snapcraft/cli/”, line 175, in upload
File “/snap/snapcraft/6466/lib/python3.6/site-packages/snapcraft/cli/”, line 34, in review_snap
File “/snap/snapcraft/6466/lib/python3.6/site-packages/snapcraft/internal/review_tools/”, line 47, in common_decorator
File “/snap/snapcraft/6466/lib/python3.6/site-packages/snapcraft/internal/review_tools/”, line 79, in run
raise errors.ReviewError(review_json=json.loads(call_error.output.decode()))
File “/var/lib/snapd/snap/snapcraft/6466/usr/lib/python3.6/json/”, line 354, in loads
return _default_decoder.decode(s)
File “/var/lib/snapd/snap/snapcraft/6466/usr/lib/python3.6/json/”, line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/var/lib/snapd/snap/snapcraft/6466/usr/lib/python3.6/json/”, line 357, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Sending an error report because ALWAYS was selected in a past prompt.
This behavior can be changed by changing the always_send entry in /home/kebekus/.config/snapcraft/cli.cfg.

You might find that this was a transient issue with the server. Give it another shot now that a few hours have passed, and any problem on the server could be resolved now.

It looks like the upload resulted in a not-JSON response, which is why I’m thinking you hit a server issue.

Dear Daniel,

the problem persists when I tried a few minutes ago (=19h after your message). Even though I believe that the program should not crash a all, I wonder if something is wrong with my snapcraft.yaml file? I insert a copy of the file below. Any help is greatly appreciated.



name: enroute-flight-navigation # you probably want to 'snapcraft register ’
base: core20 # the base snap is the execution environment for this snap
adopt-info: enroute
grade: stable # must be ‘stable’ to release into candidate/stable channels
confinement: strict # use ‘strict’ once you have the right plugs and slots
license: GPL-3.0

command: usr/bin/enroute
common-id: de.akaflieg_freiburg.enroute
desktop: usr/share/applications/de.akaflieg_freiburg.enroute.desktop
- kde-neon
- kde-frameworks-5-plug
- desktop
- network
- network-bind
- opengl
- process-control
- wayland
- x11

- usr/share/metainfo/de.akaflieg_freiburg.enroute.appdata.xml
plugin: cmake
source: .
- kde-frameworks-5-qt-5-15-core20-sdk
- git
- doxygen
- “-DCMAKE_FIND_ROOT_PATH=/usr\;/root/stage\;/snap/kde-frameworks-5-qt-5-15-core20-sdk/current”
override-build: |
snapcraftctl build
sed -i.bak -e ‘s|Icon=de.akaflieg_freiburg.enroute|Icon=usr/share/icons/hicolor/scalable/apps/de.akaflieg_freiburg.enroute.svg|g’ $SNAPCRAFT_PART_INSTALL/usr/share/applications/de.akaflieg_freiburg.enroute.desktop

This part removes all the files in this snap which already exist in

connected content and base snaps. Since these files will be available

at runtime from the content and base snaps, they do not need to be

included in this snap itself.

More info: Reducing the size of desktop snaps

after: # Make this part run last; list all your other parts here
- enroute
plugin: nil
build-snaps: # List all content-snaps and base snaps you’re using here
- kde-frameworks-5-qt-5-15-core20-sdk
override-prime: |
set -eux
for snap in “kde-frameworks-5-qt-5-15-core20-sdk”; do # List all content-snaps and base snaps you’re using here
cd “/snap/$snap/current” && find . -type f,l -exec rm -f “$SNAPCRAFT_PRIME/{}” ;

The above shows it’s not an issue with the snap store service. Things fail when trying to run the locally-installed review tool prior to the upload.

Dear roadmr,

understood. But what can I possibly do then?



i’d start with trying to remove the local review-tools copy so the review runs on the server (which it does by default when you do not have review-tools installed locally)…

tbh to me it looked more like a corrupt json file on disk … could it be that your disk is full or some such ?

Thank you! Removing the locally installed review-tools did indeed solve the issue.



1 Like