Pub: `pub global activate <package>` hangs on Ubuntu 18.04 for WSL

Created on 16 May 2019  路  4Comments  路  Source: dart-lang/pub

Environment

pub version 2.3.0
OS: Ubuntu 18.04.1 running on Windows Subsystem for Linux (WSL) for Windows 10

Problem

pub global activate aqueduct hangs indefinitely, thought it works fine for me on Windows or macOS or in a Docker container.

Here's my pubspec.yaml file

name: fcc
description: 
version: 0.0.1
author: Nicholas Manning

environment:
  sdk: ">=2.0.0 <3.0.0"

dependencies:
  aqueduct: ^3.2.1
  json_annotation: ^1.2.0
  intl: ^0.15.7
  crypto: ^2.0.6
  mailer: ^2.0.2
  uuid: ^1.0.3
  csv: ^4.0.1

dev_dependencies:
  test: ^1.0.0
  aqueduct_test: ^1.0.0
  build_runner: any
  json_serializable: any
  mustache: ^1.0.2
  html_unescape: ^1.0.1

Expected behavior

Ability to run aqueduct as a command.

Actual behavior

The pub command simply hangs indefinitely (> 3mins and counting).

Note that I'm not using a VPN or proxy but I do have my DNS set to Google's (8.8.8.8, etc) though that shouldn't matter.

--trace output

pub global activate aqueduct -v
FINE: Pub 2.3.0
MSG : Resolving dependencies...
SLVR: fact: pub global activate is 0.0.0
SLVR: derived: pub global activate
SLVR: fact: pub global activate depends on aqueduct any
SLVR:   selecting pub global activate
SLVR:   derived: aqueduct any
IO  : Get versions from https://pub.dartlang.org/api/packages/aqueduct.
IO  : HTTP GET https://pub.dartlang.org/api/packages/aqueduct
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: linux
    | X-Pub-Command: global activate
    | X-Pub-Session-ID: 32434C69-C9F9-466B-B288-9E24D8D5B794
    | user-agent: Dart pub 2.3.0
IO  : HTTP response 200 OK for GET https://pub.dartlang.org/api/packages/aqueduct
    | took 0:00:00.302904
    | transfer-encoding: chunked
    | date: Thu, 16 May 2019 20:39:37 GMT
    | content-encoding: gzip
    | vary: Accept-Encoding
    | strict-transport-security: max-age=900; preload
    | via: 1.1 google
    | content-type: application/json
    | x-frame-options: SAMEORIGIN
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
SLVR:   fact: aqueduct >=3.2.1 depends on analyzer >=0.32.0 <0.36.0
SLVR:   fact: aqueduct >=3.0.0 depends on args ^1.5.0
SLVR:   fact: aqueduct >=3.0.0 depends on crypto ^2.0.6
SLVR:   fact: aqueduct >=3.0.0 depends on isolate_executor ^2.0.0
SLVR:   fact: aqueduct >=3.0.0-beta.1 depends on logging ^0.11.3
SLVR:   fact: aqueduct >=3.0.0-beta.1 depends on meta ^1.1.5
SLVR:   fact: aqueduct >=3.0.2 depends on open_api ^2.0.1
SLVR:   fact: aqueduct >=3.0.0 depends on password_hash ^2.0.0
SLVR:   fact: aqueduct >=3.0.0 depends on path ^1.6.1
SLVR:   fact: aqueduct >=3.0.0 depends on postgres ^1.0.0
SLVR:   fact: aqueduct >=3.0.0-beta.1 depends on pub_cache ^0.2.0
SLVR:   fact: aqueduct >=3.0.0 depends on pub_semver ^1.4.0
SLVR:   fact: aqueduct >=3.0.0 depends on safe_config ^2.0.0
SLVR:   fact: aqueduct >=3.0.0 depends on yaml ^2.1.15
SLVR:     selecting aqueduct 3.2.1
SLVR:     derived: yaml ^2.1.15
SLVR:     derived: safe_config ^2.0.0
SLVR:     derived: pub_semver ^1.4.0
SLVR:     derived: pub_cache ^0.2.0
SLVR:     derived: postgres ^1.0.0
SLVR:     derived: path ^1.6.1
SLVR:     derived: password_hash ^2.0.0
SLVR:     derived: open_api ^2.0.1
SLVR:     derived: meta ^1.1.5
SLVR:     derived: logging ^0.11.3
SLVR:     derived: isolate_executor ^2.0.0
SLVR:     derived: crypto ^2.0.6
SLVR:     derived: args ^1.5.0
SLVR:     derived: analyzer >=0.32.0 <0.36.0
IO  : Get versions from https://pub.dartlang.org/api/packages/yaml.
IO  : HTTP GET https://pub.dartlang.org/api/packages/yaml
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: linux
    | X-Pub-Command: global activate
    | X-Pub-Session-ID: 32434C69-C9F9-466B-B288-9E24D8D5B794
    | user-agent: Dart pub 2.3.0
IO  : HTTP response 200 OK for GET https://pub.dartlang.org/api/packages/yaml
    | took 0:00:00.087743
    | transfer-encoding: chunked
    | date: Thu, 16 May 2019 20:39:38 GMT
    | content-encoding: gzip
    | vary: Accept-Encoding
    | strict-transport-security: max-age=900; preload
    | via: 1.1 google
    | content-type: application/json
    | x-frame-options: SAMEORIGIN
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
IO  : Get versions from https://pub.dartlang.org/api/packages/safe_config.
IO  : HTTP GET https://pub.dartlang.org/api/packages/safe_config
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: linux
    | X-Pub-Command: global activate
    | X-Pub-Session-ID: 32434C69-C9F9-466B-B288-9E24D8D5B794
    | user-agent: Dart pub 2.3.0
IO  : HTTP response 200 OK for GET https://pub.dartlang.org/api/packages/safe_config
    | took 0:00:00.090129
    | transfer-encoding: chunked
    | date: Thu, 16 May 2019 20:39:38 GMT
    | content-encoding: gzip
    | vary: Accept-Encoding
    | strict-transport-security: max-age=900; preload
    | via: 1.1 google
    | content-type: application/json
    | x-frame-options: SAMEORIGIN
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
IO  : Get versions from https://pub.dartlang.org/api/packages/pub_semver.
IO  : HTTP GET https://pub.dartlang.org/api/packages/pub_semver
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: linux
    | X-Pub-Command: global activate
    | X-Pub-Session-ID: 32434C69-C9F9-466B-B288-9E24D8D5B794
    | user-agent: Dart pub 2.3.0
IO  : HTTP response 200 OK for GET https://pub.dartlang.org/api/packages/pub_semver
    | took 0:00:00.087602
    | transfer-encoding: chunked
    | date: Thu, 16 May 2019 20:39:38 GMT
    | content-encoding: gzip
    | vary: Accept-Encoding
    | strict-transport-security: max-age=900; preload
    | via: 1.1 google
    | content-type: application/json
    | x-frame-options: SAMEORIGIN
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
IO  : Get versions from https://pub.dartlang.org/api/packages/pub_cache.
IO  : HTTP GET https://pub.dartlang.org/api/packages/pub_cache
    | Accept: application/vnd.pub.v2+json
    | X-Pub-OS: linux
    | X-Pub-Command: global activate
    | X-Pub-Session-ID: 32434C69-C9F9-466B-B288-9E24D8D5B794
    | user-agent: Dart pub 2.3.0
IO  : HTTP response 200 OK for GET https://pub.dartlang.org/api/packages/pub_cache
    | took 0:00:00.119000
    | transfer-encoding: chunked
    | date: Thu, 16 May 2019 20:39:38 GMT
    | content-encoding: gzip
    | vary: Accept-Encoding
    | strict-transport-security: max-age=900; preload
    | via: 1.1 google
    | content-type: application/json
    | x-frame-options: SAMEORIGIN
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
bug

Most helpful comment

I opened an issue in the WSL repo about this (there have been similar issues in other languages in the past that were fixed, so I'm sure it's a WSL issue): https://github.com/microsoft/WSL/issues/4031.

All 4 comments

Are you able to do pub get in a folder that contains a pubspec.yaml with a dependency in it?

I'm wondering if this is a WSL bug related to downloading files...

I opened an issue in the WSL repo about this (there have been similar issues in other languages in the past that were fixed, so I'm sure it's a WSL issue): https://github.com/microsoft/WSL/issues/4031.

Yeah @jonasfj I'm not able to do a pub get. Great, thanks @DanTup

Was this page helpful?
0 / 5 - 0 ratings