npm install @scoped private modules hang intermittently. I can reproduce it using wget

registry
priority:medium
triaged

(Ca Pli) #1
wget --header 'authorization: Bearer 94abxxxxxx' https://registry.npmjs.org/@caradvice/livery/-/livery-1.0.153.tgz
--2018-12-04 13:50:55--  https://registry.npmjs.org/@caradvice/livery/-/livery-1.0.153.tgz
Resolving registry.npmjs.org (registry.npmjs.org)... 104.16.23.35, 104.16.24.35, 104.16.25.35, ...
Connecting to registry.npmjs.org (registry.npmjs.org)|104.16.23.35|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9398331 (9.0M) [application/octet-stream]
Saving to: ‘livery-1.0.153.tgz.5’

livery-1.0.153.tgz.5                      4%[==>                                                                          ] 421.60K  --.-KB/s    in 15m 1s  

2018-12-04 14:05:57 (479 B/s) - Read error at byte 431715/9398331 (Connection timed out). Retrying.

--2018-12-04 14:05:58--  (try: 2)  https://registry.npmjs.org/@caradvice/livery/-/livery-1.0.153.tgz
Connecting to registry.npmjs.org (registry.npmjs.org)|104.16.23.35|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 9398331 (9.0M), 8966616 (8.6M) remaining [application/octet-stream]
Saving to: ‘livery-1.0.153.tgz.5’

livery-1.0.153.tgz.5                    100%[+++=========================================================================>]   8.96M  4.85MB/s    in 1.8s    

2018-12-04 14:06:01 (4.85 MB/s) - ‘livery-1.0.153.tgz.5’ saved [9398331/9398331]

Notice that the download speed become --.-KB/s, and then a Read error happens after 15 minutes of “hanging”. It happens intermittently (50% chance, which is a lot). Does not seem to fail on other packages such as typescript-3.1.1.tgz and @angular/core/-/core-7.1.1.tgz on the same network.

The intermittent error happens in all 3 different networks: in AWS VPC, in Melbourne Office and using Optus mobile network.

This really affected our workflow and CI/CD. Please help.