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

download with curl fails #236

Closed
John-Colvin opened this issue Feb 7, 2014 · 3 comments
Closed

download with curl fails #236

John-Colvin opened this issue Feb 7, 2014 · 3 comments

Comments

@John-Colvin
Copy link
Contributor

dub version: git HEAD
dmd etc. version: git HEAD

Trying to get any package, whether as a dependency or via fetch, I get errors like this:
Error executing command fetch: No package dstep was found matching the dependency ~master

I modified dub.dub.fetch to print the exceptions from getPackageDescription instead of swallowing them and I find that this traces back to dub.internal.utils.setupHTTPClient

Here's the output:

$ dub fetch dstep --vverbose
Using dub registry url 'http://code.dlang.org/'
Looking for local package map at /var/lib/dub/packages/local-packages.json
Looking for local package map at /home/space/phujfj/.dub/packages/local-packages.json
Looking for local package map at /var/lib/dub/packages/local-packages.json
Looking for local package map at /home/space/phujfj/.dub/packages/local-packages.json
Determined package version using GIT: dub ~master
Downloading metadata for dstep
Getting from http://code.dlang.org/packages/dstep.json
std.net.curl.CurlException@std/net/curl.d(3589): A libcurl function was given a bad argument on handle null
----------------
dub(void std.net.curl.Curl._check(int)+0x85) [0x73e831]
dub(void std.net.curl.Curl.set(etc.c.curl.CurlOption, long)+0x39) [0x7126ed]
dub(@property void std.net.curl.HTTP.__mixin38.verifyPeer(bool)+0x30) [0x711894]
dub(void dub.internal.utils.setupHTTPClient(ref std.net.curl.HTTP)+0x1f) [0x64631b]
dub(char[] dub.internal.utils.download(immutable(char)[])+0x3a) [0x645e4e]
dub(char[] dub.internal.utils.download(dub.internal.vibecompat.inet.url.Url)+0x18) [0x645fec]
dub(dub.internal.vibecompat.data.json.Json dub.packagesupplier.RegistryPackageSupplier.getMetadata(immutable(char)[])+0x161) [0x60ee6d]
dub(dub.internal.vibecompat.data.json.Json dub.packagesupplier.RegistryPackageSupplier.getBestPackage(immutable(char)[], dub.dependency.Dependency, bool)+0x39) [0x60efbd]
dub(dub.internal.vibecompat.data.json.Json dub.packagesupplier.RegistryPackageSupplier.getPackageDescription(immutable(char)[], dub.dependency.Dependency, bool)+0x9f) [0x60eceb]
dub(dub.package_.Package dub.dub.Dub.fetch(immutable(char)[], const(dub.dependency.Dependency), dub.project.PlacementLocation, bool, bool)+0x15b) [0x6001e7]
dub(int dub.commandline.FetchCommand.execute(dub.dub.Dub, immutable(char)[][], immutable(char)[][])+0x2d2) [0x5f4246]
dub(int dub.commandline.runDubCommandLine(immutable(char)[][])+0x11e8) [0x5f0e4c]
dub(_Dmain+0x20) [0x5ef61c]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll().void __lambda1()+0x18) [0x6e2d04]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x6e2c5e]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x30) [0x6e2cc4]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x6e2c5e]
dub(_d_run_main+0x1a3) [0x6e2bdf]
dub(main+0x25) [0x5efc61]
/lib64/libc.so.6(__libc_start_main+0xe6) [0x7fb57aa73c36]
Getting a release version failed: No package dstep was found matching the dependency >=0.0.0
Retry with ~master...
Downloading metadata for dstep
Getting from http://code.dlang.org/packages/dstep.json
std.net.curl.CurlException@std/net/curl.d(3589): A libcurl function was given a bad argument on handle null
----------------
dub(void std.net.curl.Curl._check(int)+0x85) [0x73e831]
dub(void std.net.curl.Curl.set(etc.c.curl.CurlOption, long)+0x39) [0x7126ed]
dub(@property void std.net.curl.HTTP.__mixin38.verifyPeer(bool)+0x30) [0x711894]
dub(void dub.internal.utils.setupHTTPClient(ref std.net.curl.HTTP)+0x1f) [0x64631b]
dub(char[] dub.internal.utils.download(immutable(char)[])+0x3a) [0x645e4e]
dub(char[] dub.internal.utils.download(dub.internal.vibecompat.inet.url.Url)+0x18) [0x645fec]
dub(dub.internal.vibecompat.data.json.Json dub.packagesupplier.RegistryPackageSupplier.getMetadata(immutable(char)[])+0x161) [0x60ee6d]
dub(dub.internal.vibecompat.data.json.Json dub.packagesupplier.RegistryPackageSupplier.getBestPackage(immutable(char)[], dub.dependency.Dependency, bool)+0x39) [0x60efbd]
dub(dub.internal.vibecompat.data.json.Json dub.packagesupplier.RegistryPackageSupplier.getPackageDescription(immutable(char)[], dub.dependency.Dependency, bool)+0x9f) [0x60eceb]
dub(dub.package_.Package dub.dub.Dub.fetch(immutable(char)[], const(dub.dependency.Dependency), dub.project.PlacementLocation, bool, bool)+0x15b) [0x6001e7]
dub(int dub.commandline.FetchCommand.execute(dub.dub.Dub, immutable(char)[][], immutable(char)[][])+0x3bc) [0x5f4330]
dub(int dub.commandline.runDubCommandLine(immutable(char)[][])+0x11e8) [0x5f0e4c]
dub(_Dmain+0x20) [0x5ef61c]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll().void __lambda1()+0x18) [0x6e2d04]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x6e2c5e]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x30) [0x6e2cc4]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x6e2c5e]
dub(_d_run_main+0x1a3) [0x6e2bdf]
dub(main+0x25) [0x5efc61]
/lib64/libc.so.6(__libc_start_main+0xe6) [0x7fb57aa73c36]
Error executing command fetch: No package dstep was found matching the dependency ~master

Full exception: object.Exception@source/dub/dub.d(339): No package dstep was found matching the dependency ~master
----------------
dub(pure @safe bool std.exception.enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong)+0x6b) [0x683b6f]
dub(dub.package_.Package dub.dub.Dub.fetch(immutable(char)[], const(dub.dependency.Dependency), dub.project.PlacementLocation, bool, bool)+0x1f4) [0x600280]
dub(int dub.commandline.FetchCommand.execute(dub.dub.Dub, immutable(char)[][], immutable(char)[][])+0x3bc) [0x5f4330]
dub(int dub.commandline.runDubCommandLine(immutable(char)[][])+0x11e8) [0x5f0e4c]
dub(_Dmain+0x20) [0x5ef61c]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll().void __lambda1()+0x18) [0x6e2d04]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x6e2c5e]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x30) [0x6e2cc4]
dub(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x6e2c5e]
dub(_d_run_main+0x1a3) [0x6e2bdf]
dub(main+0x25) [0x5efc61]
/lib64/libc.so.6(__libc_start_main+0xe6) [0x7fb57aa73c36]
s-ludwig added a commit that referenced this issue Feb 7, 2014
@s-ludwig
Copy link
Member

s-ludwig commented Feb 7, 2014

Can you check what happens if the HTTP variables are initialized with HTTP(url) instead of HTTP()? Not sure if this is to blame on wrong usage or if this is a regression in Phobos.

@yazd
Copy link

yazd commented Feb 7, 2014

This has been reported by bearophile:
https://d.puremagic.com/issues/show_bug.cgi?id=12098
It's a Phobos regression as far as I can tell.

@John-Colvin
Copy link
Contributor Author

Fixed (for me at least) now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants