Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hosted dependencies problem in 1.14.0 #1386

Closed
nex3 opened this issue Feb 1, 2016 · 6 comments

Comments

@nex3
Copy link
Member

commented Feb 1, 2016

From @fromlabs on January 30, 2016 11:37

I'm using hosted dependencies in my pubspec.yaml file running an instance of pub_server server but after 1.14.0 version pub commands stop working.
I reproduced the problem with this pubspec.yaml (my_pub_server:9091 is just an example):

name: hosted_error
version: 0.0.1
description: A simple console application.
dependencies:
  sqlbuilder:
    hosted:
      name: sqlbuilder
      url: http://my_pub_server:9091

If I run pub --trace -v update with 1.13.2 version, the dependency is resolved correctly:

hanselmo:hosted_error hans$ pub --trace -v update
FINE: Pub 1.13.2
MSG : Resolving dependencies...
SLVR: Solving dependencies:
    | - sqlbuilder any from hosted ({url: http://my_pub_server:9091, name: sqlbuilder})
IO  : Get versions from http://my_pub_server:9091/api/packages/sqlbuilder.
FINE: HTTP GET http://my_pub_server:9091/api/packages/sqlbuilder
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.13.2
FINE: HTTP response 200 OK for GET http://my_pub_server:9091/api/packages/sqlbuilder
    | took 0:00:00.141494
    | transfer-encoding: chunked
    | date: Sat, 30 Jan 2016 11:05:41 GMT
    | x-frame-options: SAMEORIGIN
    | content-type: application/json
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
SLVR: * start at root
SLVR: | * select sqlbuilder 1.3.4 from hosted
SLVR: BacktrackingSolver took 0:00:00.363698 seconds.
    | - Requested 1 version lists
    | - Looked up 1 cached version lists
    | - Requested 0 pubspecs
    | - Looked up 4 cached pubspecs
    | 
FINE: Resolving dependencies finished (0.378s).
MSG :   sqlbuilder 1.3.4
IO  : Deleting directory ./packages.
FINE: Creating link for package 'sqlbuilder'.
FINE: Creating ./packages/sqlbuilder pointing to /Users/hans/.pub-cache/hosted/my_pub_server%589091/sqlbuilder-1.3.4/lib
IO  : Writing 221 characters to text file ./pubspec.lock.
FINE: Contents:
    | # Generated by pub
    | # See http://pub.dartlang.org/doc/glossary.html#lockfile
    | packages:
    |   sqlbuilder:
    |     description:
    |       name: sqlbuilder
    |       url: "http://my_pub_server:9091"
    |     source: hosted
    |     version: "1.3.4"
IO  : Deleting link ./bin/packages.
FINE: Creating ./bin/packages pointing to ../packages
MSG : No dependencies changed.
IO  : Writing 160 characters to text file ./.packages.
FINE: Contents:
    | # Generated by pub on 2016-01-30 12:05:41.631.
    | sqlbuilder:file:///Users/hans/.pub-cache/hosted/my_pub_server%25589091/sqlbuilder-1.3.4/lib/
    | hosted_error:lib/

instead if I run with the pub command with the 1.14.0 version, pub resolves correctly:

http://my_pub_server:9091/api/packages/sqlbuilder

but then downloads the package from the wrong server:

https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz

Below is the error output of pub --trace -v update with 1.14.0 version:

hanselmo:hosted_error hans$ pub --trace -v update
FINE: Pub 1.14.0
MSG : Resolving dependencies...
SLVR: Solving dependencies:
    | - sqlbuilder any from hosted ({url: http://my_pub_server:9091, name: sqlbuilder})
IO  : Get versions from http://my_pub_server:9091/api/packages/sqlbuilder.
FINE: HTTP GET http://my_pub_server:9091/api/packages/sqlbuilder
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.14.0
FINE: HTTP response 200 OK for GET http://my_pub_server:9091/api/packages/sqlbuilder
    | took 0:00:00.143820
    | transfer-encoding: chunked
    | date: Sat, 30 Jan 2016 11:05:24 GMT
    | x-frame-options: SAMEORIGIN
    | content-type: application/json
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
SLVR: * start at root
SLVR: | * select sqlbuilder 1.3.4 from hosted
SLVR: BacktrackingSolver took 0:00:00.289536 seconds.
    | - Requested 1 version lists
    | - Looked up 1 cached version lists
    | 
FINE: Resolving dependencies finished (0.364s).
MSG : * sqlbuilder 1.3.4 (was 1.3.4)
IO  : Deleting directory ./packages.
IO  : Get package from https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz.
MSG : Downloading sqlbuilder 1.3.4...
IO  : Created temp directory /Users/hans/.pub-cache/_temp/dirxZPzTn
FINE: HTTP GET https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz
    | user-agent: Dart pub 1.14.0
FINE: HTTP response 404 Not Found for GET https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz
    | took 0:00:01.576794
    | alt-svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
    | cache-control: private, max-age=0
    | date: Sat, 30 Jan 2016 11:05:26 GMT
    | content-length: 127
    | x-guploader-uploadid: AEnB2UoPnVsIb6c4DmDys2VerKLRy9HsAnBZ43nqx70xKaql_T6bTlwbifycns8mrYdbPACe_VnGjluPlG43C2XuNxF94MJHVg
    | content-type: application/xml; charset=UTF-8
    | server: UploadServer
    | alternate-protocol: 443:quic,p=1
    | expires: Sat, 30 Jan 2016 11:05:26 GMT
ERR : HTTP error 404: Not Found
FINE: Exception type: PubHttpException
ERR : package:pub/src/http.dart 105                        _PubHttpClient.send.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _Completer.completeError
    | package:pub/src/http.dart 110                        _PubHttpClient.send.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _asyncThenWrapperHelper
    | package:pub/src/http.dart                            _PubHttpClient.send
    | package:http_throttle/http_throttle.dart 32          ThrottleClient.send.<fn>
    | ===== asynchronous gap ===========================
    | dart:async                                           _Future.then
    | package:http_throttle/http_throttle.dart 31          ThrottleClient.send
    | package:pub/src/source/hosted.dart 219               HostedSource._download.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/source/hosted.dart                   HostedSource._download
    | package:pub/src/source/hosted.dart 120               HostedSource.downloadToSystemCache.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/source/hosted.dart                   HostedSource.downloadToSystemCache
    | package:pub/src/source/cached.dart 50                CachedSource.get
    | package:pub/src/entrypoint.dart 409                  Entrypoint._get.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/entrypoint.dart                      Entrypoint._get
    | dart:async                                           Future.wait
    | package:pub/src/entrypoint.dart 178                  Entrypoint.acquireDependencies.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/solver/backtracking_solver.dart 178  BacktrackingSolver.solve.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/solver/backtracking_solver.dart 612  BacktrackingSolver._getPubspec.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/source.dart 139                      Source.describe.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _asyncThenWrapperHelper
    | package:pub/src/entrypoint.dart                      Entrypoint.acquireDependencies
    | package:pub/src/command/upgrade.dart 34              UpgradeCommand.run.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/command/upgrade.dart                 UpgradeCommand.run
    | package:args/command_runner.dart 178                 CommandRunner.runCommand.<fn>
    | dart:async                                           Future.Future.sync
    | package:args/command_runner.dart 131                 CommandRunner.runCommand
    | package:pub/src/command_runner.dart 130              PubCommandRunner.runCommand.<async>.<fn>
    | dart:async                                           Future.Future.sync
    | package:pub/src/utils.dart 111                       captureErrors.<fn>
    | package:stack_trace                                  Chain.capture
    | package:pub/src/utils.dart 125                       captureErrors
    | package:pub/src/command_runner.dart 130              PubCommandRunner.runCommand.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/command_runner.dart 216              PubCommandRunner._validatePlatform.<async>
---- Log transcript ----
FINE: Pub 1.14.0
MSG : Resolving dependencies...
SLVR: Solving dependencies:
    | - sqlbuilder any from hosted ({url: http://my_pub_server:9091, name: sqlbuilder})
IO  : Get versions from http://my_pub_server:9091/api/packages/sqlbuilder.
FINE: HTTP GET http://my_pub_server:9091/api/packages/sqlbuilder
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.14.0
FINE: HTTP response 200 OK for GET http://my_pub_server:9091/api/packages/sqlbuilder
    | took 0:00:00.143820
    | transfer-encoding: chunked
    | date: Sat, 30 Jan 2016 11:05:24 GMT
    | x-frame-options: SAMEORIGIN
    | content-type: application/json
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
SLVR: * start at root
SLVR: | * select sqlbuilder 1.3.4 from hosted
SLVR: BacktrackingSolver took 0:00:00.289536 seconds.
    | - Requested 1 version lists
    | - Looked up 1 cached version lists
    | 
FINE: Resolving dependencies finished (0.364s).
MSG : * sqlbuilder 1.3.4 (was 1.3.4)
IO  : Deleting directory ./packages.
IO  : Get package from https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz.
MSG : Downloading sqlbuilder 1.3.4...
IO  : Created temp directory /Users/hans/.pub-cache/_temp/dirxZPzTn
FINE: HTTP GET https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz
    | user-agent: Dart pub 1.14.0
FINE: HTTP response 404 Not Found for GET https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz
    | took 0:00:01.576794
    | alt-svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
    | cache-control: private, max-age=0
    | date: Sat, 30 Jan 2016 11:05:26 GMT
    | content-length: 127
    | x-guploader-uploadid: AEnB2UoPnVsIb6c4DmDys2VerKLRy9HsAnBZ43nqx70xKaql_T6bTlwbifycns8mrYdbPACe_VnGjluPlG43C2XuNxF94MJHVg
    | content-type: application/xml; charset=UTF-8
    | server: UploadServer
    | alternate-protocol: 443:quic,p=1
    | expires: Sat, 30 Jan 2016 11:05:26 GMT
ERR : HTTP error 404: Not Found
FINE: Exception type: PubHttpException
ERR : package:pub/src/http.dart 105                        _PubHttpClient.send.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _Completer.completeError
    | package:pub/src/http.dart 110                        _PubHttpClient.send.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _asyncThenWrapperHelper
    | package:pub/src/http.dart                            _PubHttpClient.send
    | package:http_throttle/http_throttle.dart 32          ThrottleClient.send.<fn>
    | ===== asynchronous gap ===========================
    | dart:async                                           _Future.then
    | package:http_throttle/http_throttle.dart 31          ThrottleClient.send
    | package:pub/src/source/hosted.dart 219               HostedSource._download.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/source/hosted.dart                   HostedSource._download
    | package:pub/src/source/hosted.dart 120               HostedSource.downloadToSystemCache.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/source/hosted.dart                   HostedSource.downloadToSystemCache
    | package:pub/src/source/cached.dart 50                CachedSource.get
    | package:pub/src/entrypoint.dart 409                  Entrypoint._get.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/entrypoint.dart                      Entrypoint._get
    | dart:async                                           Future.wait
    | package:pub/src/entrypoint.dart 178                  Entrypoint.acquireDependencies.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/solver/backtracking_solver.dart 178  BacktrackingSolver.solve.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/solver/backtracking_solver.dart 612  BacktrackingSolver._getPubspec.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/source.dart 139                      Source.describe.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _asyncThenWrapperHelper
    | package:pub/src/entrypoint.dart                      Entrypoint.acquireDependencies
    | package:pub/src/command/upgrade.dart 34              UpgradeCommand.run.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/command/upgrade.dart                 UpgradeCommand.run
    | package:args/command_runner.dart 178                 CommandRunner.runCommand.<fn>
    | dart:async                                           Future.Future.sync
    | package:args/command_runner.dart 131                 CommandRunner.runCommand
    | package:pub/src/command_runner.dart 130              PubCommandRunner.runCommand.<async>.<fn>
    | dart:async                                           Future.Future.sync
    | package:pub/src/utils.dart 111                       captureErrors.<fn>
    | package:stack_trace                                  Chain.capture
    | package:pub/src/utils.dart 125                       captureErrors
    | package:pub/src/command_runner.dart 130              PubCommandRunner.runCommand.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/command_runner.dart 216              PubCommandRunner._validatePlatform.<async>
---- End log transcript ----

Copied from original issue: dart-lang/sdk#25621

@nex3

This comment has been minimized.

Copy link
Member Author

commented Feb 1, 2016

From @kevmoo on February 1, 2016 18:25

@nex3 Did pub change anything in how it works with the server in 1.14?
@mkustermann Could this point to an issue with pub_server?

@mkustermann

This comment has been minimized.

Copy link
Member

commented Feb 2, 2016

@nex3 @kevmoo
We haven't changed much in package:pub_server or package:pub_dartlang_org for a while. So I suspect that this might be a pub client issue (package:pub_server is unaware of the hostname pub.dartlang.org whereas the client has this hostname baked in, so seems very likely to me that something goes wrong)

One thing to note in the original bug report is that the first example with the old version of pub is actually not downloading anything, it uses a cached version of the package, whereas the second version is downloading something.

Let me know if I should help debugging this.

@fromlabs

This comment has been minimized.

Copy link

commented Feb 2, 2016

@mkustermann @nex3 @kevmoo

These are the outputs of both 1.13.2 and 1.14.0 after a pub cache cleaning.
Hope it helps, let me know if you need more info...

1.13.2

hanselmo:hosted_error hans$ pub --trace -v update
FINE: Pub 1.13.2
MSG : Resolving dependencies...
SLVR: Solving dependencies:
    | - sqlbuilder any from hosted ({url: http://my_pub_server:9091, name: sqlbuilder})
IO  : Get versions from http://my_pub_server:9091/api/packages/sqlbuilder.
FINE: HTTP GET http://my_pub_server:9091/api/packages/sqlbuilder
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.13.2
FINE: HTTP response 200 OK for GET http://my_pub_server:9091/api/packages/sqlbuilder
    | took 0:00:00.177743
    | transfer-encoding: chunked
    | date: Tue, 02 Feb 2016 13:38:55 GMT
    | x-frame-options: SAMEORIGIN
    | content-type: application/json
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
SLVR: * start at root
SLVR: | * select sqlbuilder 1.3.4 from hosted
SLVR: BacktrackingSolver took 0:00:00.420613 seconds.
    | - Requested 1 version lists
    | - Looked up 1 cached version lists
    | - Requested 0 pubspecs
    | - Looked up 4 cached pubspecs
    | 
FINE: Resolving dependencies finished (0.435s).
MSG :   sqlbuilder 1.3.4
IO  : Deleting directory ./packages.
IO  : Get package from http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.4.tar.gz.
MSG : Downloading sqlbuilder 1.3.4...
IO  : Created temp directory cache/_temp/dirIiAErI
FINE: HTTP GET http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.4.tar.gz
    | user-agent: Dart pub 1.13.2
FINE: HTTP response 200 OK for GET http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.4.tar.gz
    | took 0:00:00.065487
    | transfer-encoding: chunked
    | date: Tue, 02 Feb 2016 13:38:55 GMT
    | x-frame-options: SAMEORIGIN
    | content-type: text/plain; charset=utf-8
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
FINE: Extracting .tar.gz stream to cache/_temp/dirIiAErI.
IO  : Spawning "tar --extract --gunzip --directory cache/_temp/dirIiAErI" in /Users/hans/Documents/Sviluppo/workspaces/hosted_error/.
FINE: Extracted .tar.gz stream to cache/_temp/dirIiAErI. Exit code 0.
IO  : Renaming directory cache/_temp/dirIiAErI to cache/hosted/my_pub_server%589091/sqlbuilder-1.3.4.
FINE: Creating link for package 'sqlbuilder'.
FINE: Creating ./packages/sqlbuilder pointing to cache/hosted/my_pub_server%589091/sqlbuilder-1.3.4/lib
IO  : Writing 221 characters to text file ./pubspec.lock.
FINE: Contents:
    | # Generated by pub
    | # See http://pub.dartlang.org/doc/glossary.html#lockfile
    | packages:
    |   sqlbuilder:
    |     description:
    |       name: sqlbuilder
    |       url: "http://my_pub_server:9091"
    |     source: hosted
    |     version: "1.3.4"
IO  : Deleting link ./bin/packages.
FINE: Creating ./bin/packages pointing to ../packages
MSG : No dependencies changed.
IO  : Writing 136 characters to text file ./.packages.
FINE: Contents:
    | # Generated by pub on 2016-02-02 14:38:56.001.
    | sqlbuilder:cache/hosted/my_pub_server%25589091/sqlbuilder-1.3.4/lib/
    | hosted_error:lib/

1.14.0

hanselmo:hosted_error hans$ pub --trace -v update
FINE: Pub 1.14.0
MSG : Resolving dependencies...
SLVR: Solving dependencies:
    | - sqlbuilder any from hosted ({url: http://my_pub_server:9091, name: sqlbuilder})
IO  : Get versions from http://my_pub_server:9091/api/packages/sqlbuilder.
FINE: HTTP GET http://my_pub_server:9091/api/packages/sqlbuilder
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.14.0
FINE: HTTP response 200 OK for GET http://my_pub_server:9091/api/packages/sqlbuilder
    | took 0:00:00.161566
    | transfer-encoding: chunked
    | date: Tue, 02 Feb 2016 13:40:32 GMT
    | x-frame-options: SAMEORIGIN
    | content-type: application/json
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
SLVR: * start at root
SLVR: | * select sqlbuilder 1.3.4 from hosted
SLVR: BacktrackingSolver took 0:00:00.304829 seconds.
    | - Requested 1 version lists
    | - Looked up 1 cached version lists
    | 
FINE: Resolving dependencies finished (0.399s).
MSG : * sqlbuilder 1.3.4 (was 1.3.4)
IO  : Deleting directory ./packages.
IO  : Get package from https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz.
MSG : Downloading sqlbuilder 1.3.4...
IO  : Created temp directory cache2/_temp/dir1ovNj3
FINE: HTTP GET https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz
    | user-agent: Dart pub 1.14.0
FINE: HTTP response 404 Not Found for GET https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz
    | took 0:00:04.220164
    | alt-svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
    | cache-control: private, max-age=0
    | date: Tue, 02 Feb 2016 13:40:37 GMT
    | content-length: 127
    | x-guploader-uploadid: AEnB2Urs8SSbk16ipQyMmtDuouk5-hCaMAmOMSjq6-xFddNbHXt_kGyA8lTr1wH9TgDlRqH0nDlgLWptD2gpfUYaUyvYfj6TRg
    | content-type: application/xml; charset=UTF-8
    | server: UploadServer
    | alternate-protocol: 443:quic,p=1
    | expires: Tue, 02 Feb 2016 13:40:37 GMT
ERR : HTTP error 404: Not Found
FINE: Exception type: PubHttpException
ERR : package:pub/src/http.dart 105                        _PubHttpClient.send.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _Completer.completeError
    | package:pub/src/http.dart 110                        _PubHttpClient.send.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _asyncThenWrapperHelper
    | package:pub/src/http.dart                            _PubHttpClient.send
    | package:http_throttle/http_throttle.dart 32          ThrottleClient.send.<fn>
    | ===== asynchronous gap ===========================
    | dart:async                                           _Future.then
    | package:http_throttle/http_throttle.dart 31          ThrottleClient.send
    | package:pub/src/source/hosted.dart 219               HostedSource._download.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/source/hosted.dart                   HostedSource._download
    | package:pub/src/source/hosted.dart 120               HostedSource.downloadToSystemCache.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/source/hosted.dart                   HostedSource.downloadToSystemCache
    | package:pub/src/source/cached.dart 50                CachedSource.get
    | package:pub/src/entrypoint.dart 409                  Entrypoint._get.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/entrypoint.dart                      Entrypoint._get
    | dart:async                                           Future.wait
    | package:pub/src/entrypoint.dart 178                  Entrypoint.acquireDependencies.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/solver/backtracking_solver.dart 178  BacktrackingSolver.solve.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/solver/backtracking_solver.dart 612  BacktrackingSolver._getPubspec.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/source.dart 139                      Source.describe.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _asyncThenWrapperHelper
    | package:pub/src/entrypoint.dart                      Entrypoint.acquireDependencies
    | package:pub/src/command/upgrade.dart 34              UpgradeCommand.run.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/command/upgrade.dart                 UpgradeCommand.run
    | package:args/command_runner.dart 178                 CommandRunner.runCommand.<fn>
    | dart:async                                           Future.Future.sync
    | package:args/command_runner.dart 131                 CommandRunner.runCommand
    | package:pub/src/command_runner.dart 130              PubCommandRunner.runCommand.<async>.<fn>
    | dart:async                                           Future.Future.sync
    | package:pub/src/utils.dart 111                       captureErrors.<fn>
    | package:stack_trace                                  Chain.capture
    | package:pub/src/utils.dart 125                       captureErrors
    | package:pub/src/command_runner.dart 130              PubCommandRunner.runCommand.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/command_runner.dart 216              PubCommandRunner._validatePlatform.<async>
---- Log transcript ----
FINE: Pub 1.14.0
MSG : Resolving dependencies...
SLVR: Solving dependencies:
    | - sqlbuilder any from hosted ({url: http://my_pub_server:9091, name: sqlbuilder})
IO  : Get versions from http://my_pub_server:9091/api/packages/sqlbuilder.
FINE: HTTP GET http://my_pub_server:9091/api/packages/sqlbuilder
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.14.0
FINE: HTTP response 200 OK for GET http://my_pub_server:9091/api/packages/sqlbuilder
    | took 0:00:00.161566
    | transfer-encoding: chunked
    | date: Tue, 02 Feb 2016 13:40:32 GMT
    | x-frame-options: SAMEORIGIN
    | content-type: application/json
    | x-xss-protection: 1; mode=block
    | x-content-type-options: nosniff
    | server: dart:io with Shelf
SLVR: * start at root
SLVR: | * select sqlbuilder 1.3.4 from hosted
SLVR: BacktrackingSolver took 0:00:00.304829 seconds.
    | - Requested 1 version lists
    | - Looked up 1 cached version lists
    | 
FINE: Resolving dependencies finished (0.399s).
MSG : * sqlbuilder 1.3.4 (was 1.3.4)
IO  : Deleting directory ./packages.
IO  : Get package from https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz.
MSG : Downloading sqlbuilder 1.3.4...
IO  : Created temp directory cache2/_temp/dir1ovNj3
FINE: HTTP GET https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz
    | user-agent: Dart pub 1.14.0
FINE: HTTP response 404 Not Found for GET https://pub.dartlang.org/packages/sqlbuilder/versions/1.3.4.tar.gz
    | took 0:00:04.220164
    | alt-svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
    | cache-control: private, max-age=0
    | date: Tue, 02 Feb 2016 13:40:37 GMT
    | content-length: 127
    | x-guploader-uploadid: AEnB2Urs8SSbk16ipQyMmtDuouk5-hCaMAmOMSjq6-xFddNbHXt_kGyA8lTr1wH9TgDlRqH0nDlgLWptD2gpfUYaUyvYfj6TRg
    | content-type: application/xml; charset=UTF-8
    | server: UploadServer
    | alternate-protocol: 443:quic,p=1
    | expires: Tue, 02 Feb 2016 13:40:37 GMT
ERR : HTTP error 404: Not Found
FINE: Exception type: PubHttpException
ERR : package:pub/src/http.dart 105                        _PubHttpClient.send.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _Completer.completeError
    | package:pub/src/http.dart 110                        _PubHttpClient.send.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _asyncThenWrapperHelper
    | package:pub/src/http.dart                            _PubHttpClient.send
    | package:http_throttle/http_throttle.dart 32          ThrottleClient.send.<fn>
    | ===== asynchronous gap ===========================
    | dart:async                                           _Future.then
    | package:http_throttle/http_throttle.dart 31          ThrottleClient.send
    | package:pub/src/source/hosted.dart 219               HostedSource._download.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/source/hosted.dart                   HostedSource._download
    | package:pub/src/source/hosted.dart 120               HostedSource.downloadToSystemCache.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/source/hosted.dart                   HostedSource.downloadToSystemCache
    | package:pub/src/source/cached.dart 50                CachedSource.get
    | package:pub/src/entrypoint.dart 409                  Entrypoint._get.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/entrypoint.dart                      Entrypoint._get
    | dart:async                                           Future.wait
    | package:pub/src/entrypoint.dart 178                  Entrypoint.acquireDependencies.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/solver/backtracking_solver.dart 178  BacktrackingSolver.solve.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/solver/backtracking_solver.dart 612  BacktrackingSolver._getPubspec.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/source.dart 139                      Source.describe.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           _asyncThenWrapperHelper
    | package:pub/src/entrypoint.dart                      Entrypoint.acquireDependencies
    | package:pub/src/command/upgrade.dart 34              UpgradeCommand.run.<async>
    | ===== asynchronous gap ===========================
    | dart:async                                           Future.Future.microtask
    | package:pub/src/command/upgrade.dart                 UpgradeCommand.run
    | package:args/command_runner.dart 178                 CommandRunner.runCommand.<fn>
    | dart:async                                           Future.Future.sync
    | package:args/command_runner.dart 131                 CommandRunner.runCommand
    | package:pub/src/command_runner.dart 130              PubCommandRunner.runCommand.<async>.<fn>
    | dart:async                                           Future.Future.sync
    | package:pub/src/utils.dart 111                       captureErrors.<fn>
    | package:stack_trace                                  Chain.capture
    | package:pub/src/utils.dart 125                       captureErrors
    | package:pub/src/command_runner.dart 130              PubCommandRunner.runCommand.<async>
    | dart:async                                           _SyncCompleter.complete
    | package:pub/src/command_runner.dart 216              PubCommandRunner._validatePlatform.<async>
---- End log transcript ----
@nex3

This comment has been minimized.

Copy link
Member Author

commented Feb 2, 2016

I haven't had time to dive into this yet, but based on the difference in behavior between pub versions I suspect it's a bug in the pub client rather than the server.

@fromlabs Just in case, can you manually request http://my_pub_server:9091/api/packages/sqlbuilder and paste the output here?

@fromlabs

This comment has been minimized.

Copy link

commented Feb 2, 2016

{
    "name": "sqlbuilder",
    "latest": {
        "archive_url": "http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.4.tar.gz",
        "pubspec": {
            "environment": {
                "sdk": ">=1.12.0 <2.0.0"
            },
            "homepage": "https://bitbucket.org/rtassi/sqlbuilder",
            "version": "1.3.4",
            "name": "sqlbuilder",
            "author": "Roberto Tassi <roberto.tassi@primeapp.it>",
            "description": "A sample command-line application"
        },
        "version": "1.3.4"
    },
    "versions": [{
        "archive_url": "http://my_pub_server:9091/packages/sqlbuilder/versions/1.2.1.tar.gz",
        "pubspec": {
            "environment": {
                "sdk": ">=1.0.0 <2.0.0"
            },
            "homepage": "https://bitbucket.org/rtassi/sqlbuilder",
            "version": "1.2.1",
            "name": "sqlbuilder",
            "author": "Roberto Tassi <roberto.tassi@primeapp.it>",
            "description": "A sample command-line application"
        },
        "version": "1.2.1"
    }, {
        "archive_url": "http://my_pub_server:9091/packages/sqlbuilder/versions/1.2.2.tar.gz",
        "pubspec": {
            "environment": {
                "sdk": ">=1.0.0 <2.0.0"
            },
            "homepage": "https://bitbucket.org/rtassi/sqlbuilder",
            "version": "1.2.2",
            "name": "sqlbuilder",
            "author": "Roberto Tassi <roberto.tassi@primeapp.it>",
            "description": "A sample command-line application"
        },
        "version": "1.2.2"
    }, {
        "archive_url": "http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.0.tar.gz",
        "pubspec": {
            "environment": {
                "sdk": ">=1.0.0 <2.0.0"
            },
            "homepage": "https://bitbucket.org/rtassi/sqlbuilder",
            "version": "1.3.0",
            "name": "sqlbuilder",
            "author": "Roberto Tassi <roberto.tassi@primeapp.it>",
            "description": "A sample command-line application"
        },
        "version": "1.3.0"
    }, {
        "archive_url": "http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.1.tar.gz",
        "pubspec": {
            "environment": {
                "sdk": ">=1.0.0 <2.0.0"
            },
            "homepage": "https://bitbucket.org/rtassi/sqlbuilder",
            "version": "1.3.1",
            "name": "sqlbuilder",
            "author": "Roberto Tassi <roberto.tassi@primeapp.it>",
            "description": "A sample command-line application"
        },
        "version": "1.3.1"
    }, {
        "archive_url": "http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.2.tar.gz",
        "pubspec": {
            "environment": {
                "sdk": ">=1.0.0 <2.0.0"
            },
            "homepage": "https://bitbucket.org/rtassi/sqlbuilder",
            "version": "1.3.2",
            "name": "sqlbuilder",
            "author": "Roberto Tassi <roberto.tassi@primeapp.it>",
            "description": "A sample command-line application"
        },
        "version": "1.3.2"
    }, {
        "archive_url": "http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.3.tar.gz",
        "pubspec": {
            "environment": {
                "sdk": ">=1.12.0 <2.0.0"
            },
            "homepage": "https://bitbucket.org/rtassi/sqlbuilder",
            "version": "1.3.3",
            "name": "sqlbuilder",
            "author": "Roberto Tassi <roberto.tassi@primeapp.it>",
            "description": "A sample command-line application"
        },
        "version": "1.3.3"
    }, {
        "archive_url": "http://my_pub_server:9091/packages/sqlbuilder/versions/1.3.4.tar.gz",
        "pubspec": {
            "environment": {
                "sdk": ">=1.12.0 <2.0.0"
            },
            "homepage": "https://bitbucket.org/rtassi/sqlbuilder",
            "version": "1.3.4",
            "name": "sqlbuilder",
            "author": "Roberto Tassi <roberto.tassi@primeapp.it>",
            "description": "A sample command-line application"
        },
        "version": "1.3.4"
    }]
}
@nex3

This comment has been minimized.

Copy link
Member Author

commented Feb 2, 2016

I've tracked this down; it is indeed a bug in the pub client. I'll have a fix out today or tomorrow.

nex3 added a commit that referenced this issue Feb 3, 2016
Refactor test servers to make them less global.
This sets the stage for adding tests for #1386.

R=rnystrom@google.com

Review URL: https://codereview.chromium.org//1664563002 .

@nex3 nex3 closed this in c00b613 Feb 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.