request canceled (Client.Timeout exceeded while awaiting headers)

Bug #1639981 reported by Michael Nelson on 2016-11-08
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Click Package Index
Undecided
Unassigned
Snappy
High
Unassigned

Bug Description

We're getting reports of sporadic timeouts when using snap refresh.

popey says: """
error: cannot refresh []: Post https://search.apps.ubuntu.com/api/v1/snaps/metadata: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

I get it a _lot_
"""

Manik sees: """
2016-11-07T20:44:16Z ERROR Get https://assertions.ubuntu.com/v1/assertions/snap-revision/8KlxmAnVLkQ-ysEZUbHOUPR55bVmb7G6bYhfmK0kduEHGe337epeP5_lxwDe6cEH: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
"""

I was able to reproduce it once, before what seems like an unrelated issue: """
ubuntu@dev-xenial:~/golang/src/github.com/snapcore/snapd$ snap refresh
error: cannot refresh []: cannot refresh snap-declaration for "blr-says": Get https://assertions.ubuntu.com/v1/assertions/snap-declaration/16/hqfOKHESqlxD49VsxjZkkWtQHrSTmC5L?max-format=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

ubuntu@dev-xenial:~/golang/src/github.com/snapcore/snapd$ snap refresh
error: cannot communicate with server: Get http://localhost/v2/changes/202: dial unix /run/snapd.socket: connect: connection refused
"""

***NOTE*** If you are able to reproduce this, please install tcdump and run:

$ sudo tcpdump host search.apps.ubuntu.com and port 443 -i any -w store.pcap

in one terminal, while you reproduce in another terminal. Once reproduced, CTRL-C to stop tcpdump and then attach the store.pcap as a comment below.

Michael Nelson (michael.nelson) wrote :

We don't have any evidence of issues with the service(s) themselves, according to graphs, yet. Trying to see if there are related networking issues at the time, without any success yet.

Changed in click-package-index:
status: New → Confirmed
importance: Undecided → High
Michael Nelson (michael.nelson) wrote :

00:09 < wgrant> noodles: There was a slight dip in the PS4½ firewall graph around then, but it's difficult to establish significance.

Michael Nelson (michael.nelson) wrote :

This was reported again today on the snapcraft mailing list. Frontend server logs show only successful results:

http://paste.ubuntu.com/23602216/ (the IPs were from Mexico, China, China, then the last 3 were my IP from canonistack).

Not sure yet whether the request is not reaching Apache, or Apache has its hands tied at the time serving large updates from SCA for packages with many revisions (though nothing stands out on our graphs that I can see at the time).

Greg Lutostanski (lutostag) wrote :

I've seen this error myself, not in mainland China, but Austin. Happens when I first connect to the store over spotty-wifi (and with a few retries it goes away).

Any info I can gather client-side?

Greg Lutostanski (lutostag) wrote :

Adding snappy bug, so people can find it from that search too. (That is where I first looked)

affects: click-package-index → snappy
Changed in click-package-index:
status: New → Confirmed
Greg Lutostanski (lutostag) wrote :

(Sorry, changed rather than added new project), Apologies.

description: updated
description: updated
Oliver Grawert (ogra) wrote :

i just hit this as well today and it turned out that my canonical VPN connection did not let me through for whatever reason ... restarting the VPN competely resolved it.

dinamic (dinamic6661) wrote :

i get this error all the time LOL, i have this silly cheap tenda rounter, and from time to time the wifi just dies X-( and i have to restart the router to make the wifi work again. i have dynamic ip.
so after i restart the router i see this message

snap refresh ubuntu-app-platform --edge
error: cannot refresh "ubuntu-app-platform": cannot get refresh information for snap "ubuntu-app-platform": Post https://search.apps.ubuntu.com/api/v1/snaps/metadata: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

to fix this i just click on the network indicator with my mouse and disconect and reconnect my wired connection and then boom! no more errors.

i can reproduce this every time

Bret Barker (noise) wrote :

dinamic - since you are able to reproduce this, I wonder if you could provide more detail. First off, what version of snapd are you running (`snap version`)? Second, after you reset your wifi and before issuing the the `snap refresh` could you do a: `sudo netstat -pant | grep snap`

Thanks in advance.

Hassan (hsn-zamani) wrote :

I have the same issue here. Here are the details:

```
$ snap version
snap 2.24.1+17.04
snapd 2.24.1+17.04
series 16
ubuntu 17.04
kernel 4.10.0-20-generic

$ sudo netstat -pant | grep snap
# returns 1

$ sudo snap refresh
error: cannot refresh []: Post https://search.apps.ubuntu.com/api/v1/snaps/metadata: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
```

Same error on 2 nodes in the same LAN on

snap 2.25
Ubuntu 16.04
kernel 4.4.0-83-generic

One of the nodes is a VM, the other a physical machine, managed via MAAS / Juju. This breaks the install of the kubernetes-worker, but others nodes on the network are fine.

Very weird.

I was able to fix the issue with the following procedure:

1. Edit /etc/systemd/system/snapd.service.d/snap_layer_proxy.conf
2. Put the "no_proxy" Environment on the last line of the file instead of the first
  * on "working nodes", it was on the last line
  * on "failing nodes" it was on the first line
3. sudo systemctl daemon-reload
4. sudo systemctl restart snapd.service

and there you go. To be noted that my env has a proxy for http/https and apt.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers