I am downloading a big snap (650mb), my internet is relatively slow but downloading from snap store is even slower (assuming slow servers is the cause).
What I see is that the download usually ends up being 504
om26er@IntelNUC:~$ snap download android-studio --candidate
Fetching snap "android-studio"
error: received an unexpected http response code (504) when trying to download https://068ed04f23.site.internapcdn.net/download-snap/VNTeIi51l6cIZ1gaWHwx0PoP7JaCb61c_30.snap?t=2018-02-01T18:00:00Z&h=7bbc109159855cb9f983f36856443d48abf7447f
I believe the Ubuntu store expires the download url due to whatever reason. So please increase the URL expiry time from the server side. This is pretty big of an issue.
In addition to increasing the expiry time, we may also be able to implement logic in the client side to retry the operation. The underlying transaction and task mechanism is already pretty good at supporting this… we’d just need to look into the specific error, and define how many times to attempt.
That said, yes, increasing the expiry time for the URL might be an easy first step. Can you please check how long that task took to error? You can find that information running snap changes.
om26er@IntelNUC:~$ snap change 7
Status Spawn Ready Summary
Done 2018-02-01T13:42:19Z 2018-02-01T14:41:58Z Ensure prerequisites for "android-studio" are available
Undone 2018-02-01T13:42:19Z 2018-02-01T14:41:58Z Download snap "android-studio" (30) from channel "candidate"
Done 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Fetch and check assertions for snap "android-studio" (30)
Error 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Mount snap "android-studio" (30)
Hold 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Copy snap "android-studio" data
Hold 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Setup snap "android-studio" (30) security profiles
Hold 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Make snap "android-studio" (30) available to the system
Hold 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Set automatic aliases for snap "android-studio"
Hold 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Setup snap "android-studio" aliases
Hold 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Run install hook of "android-studio" snap if present
Hold 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Start snap "android-studio" (30) services
Hold 2018-02-01T13:42:19Z 2018-02-01T14:41:57Z Run configure hook of "android-studio" snap if present
......................................................................
Mount snap "android-studio" (30)
2018-02-01T06:41:57-08:00 ERROR [start snap-android\x2dstudio-30.mount] failed with exit status 1: Job for snap-android\x2dstudio-30.mount failed.
See "systemctl status "snap-android\\x2dstudio-30.mount"" and "journalctl -xe" for details.
The interesting bit is that the download never succeeded and still snapd tried Fetch and check assertions for snap "android-studio"
Which feels like another bug.
I restarted my system since then and journalctl doesn’t seem to have anything related to that time. Though systemctl status suggests there was some success
om26er@IntelNUC:~$ systemctl status "snap-android\\x2dstudio-30.mount"
● snap-android\x2dstudio-30.mount - Mount unit for android-studio
Loaded: loaded (/etc/systemd/system/snap-android\x2dstudio-30.mount; enabled; vendor preset: enabled)
Active: active (mounted) since Thu 2018-02-01 06:48:47 PST; 2h 28min ago
Where: /snap/android-studio/30
What: /dev/loop0
Tasks: 0 (limit: 4915)
CGroup: /system.slice/snap-android\x2dstudio-30.mount
Feb 01 06:48:47 IntelNUC systemd[1]: Mounting Mount unit for android-studio...
Feb 01 06:48:47 IntelNUC systemd[1]: Mounted Mount unit for android-studio.
But snap list still does not show it as installed and neither does it appear in Gnome Shell’ apps list or in command line.
om26er@IntelNUC:/snap/android-studio$ snap list
Name Version Rev Developer Notes
core 16-2.30 3887 canonical core
lxd 2.21 5522 canonical -
skype 8.14.0.10 9 skype classic
But it seems the directory /snap/android-studio/30 exists and it does have the actual source and I can launch the app from there.
Now I am totally confused. This is probably a bug in snapd in 18.04.
We’ll have a look into this this code path to ensure we don’t have anything leaving the mount unit around in the error path of the mount operation. That said, this is not a reason for the failure we observe, and it’s also not the error you got in the first console output you report in the top message. Something else happened in your system which is not listed above.
What is the actual change corresponding to the error you reported earlier?
Sorry, I was not able to find the change related to the issue (Listed all changes and none had that error) that I reported initially. I am trying to emulate that scenario again, will comment back.
om26er@IntelNUC:~$ time snap install android-studio --classic --candidate
Download snap "android-studio" (30) from channel "candidate" 55% 227kB/s 22.6merror: cannot perform the following tasks:
- Download snap "android-studio" (30) from channel "candidate" (received an unexpected http response code (504) when trying to download https://068ed04f23.site.internapcdn.net/download-snap/VNTeIi51l6cIZ1gaWHwx0PoP7JaCb61c_30.snap?t=2018-02-01T19:00:00Z&h=ff83fb2dc692ff80a1e4614dcf57b0420b4a799c)
real 41m40.741s
user 0m27.726s
sys 0m10.506s
And the change is below
om26er@IntelNUC:~$ snap change 12
Status Spawn Ready Summary
Done 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Ensure prerequisites for "android-studio" are available
Error 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Download snap "android-studio" (30) from channel "candidate"
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Fetch and check assertions for snap "android-studio" (30)
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Mount snap "android-studio" (30)
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Copy snap "android-studio" data
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Setup snap "android-studio" (30) security profiles
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Make snap "android-studio" (30) available to the system
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Set automatic aliases for snap "android-studio"
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Setup snap "android-studio" aliases
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Run install hook of "android-studio" snap if present
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Start snap "android-studio" (30) services
Hold 2018-02-01T17:03:27Z 2018-02-01T17:45:07Z Run configure hook of "android-studio" snap if present
......................................................................
Download snap "android-studio" (30) from channel "candidate"
2018-02-01T09:45:07-08:00 ERROR received an unexpected http response code (504) when trying to download https://068ed04f23.site.internapcdn.net/download-snap/VNTeIi51l6cIZ1gaWHwx0PoP7JaCb61c_30.snap?t=2018-02-01T19:00:00Z&h=ff83fb2dc692ff80a1e4614dcf57b0420b4a799c
$ time snap install android-studio --classic --candidate
android-studio (candidate) 3.0.1.0 from 'snapcrafters' installed
real 4m16.708s
user 0m2.867s
sys 0m1.096s
I’m wondering if we we’ll see retries/etc if you attempt a full download w/wget. And the response headers will help if I need to raise a ticket w/the CDN provider.