Skip to content

netrc file causes 401 download error #3120

Description

@Dariqq

I guess this is a similar issue to #2899

In my $HOME i have a netrc file for ftp setting a default user and password.

dub sets

conn.handle.set(CurlOption.netrc, CURL_NETRC_OPTIONAL)

github.com is rejecting the connection.

dub fetch urld --vverbose
Downloading metadata for urld
Getting https://code.dlang.org/api/packages/infos?packages=%5B%22urld%22%5D&include_dependencies=true&minimize=true..
.
adding urld to metadata cache
    Fetching urld 3.0.1
Acquiring package zip file
Getting https://code.dlang.org/packages/urld/3.0.1.zip...
Failed to download https://code.dlang.org/packages/urld/3.0.1.zip (Attempt 1 of 3): HTTP request returned status code
 401 ()
Getting https://code.dlang.org/packages/urld/3.0.1.zip...
Failed to download https://code.dlang.org/packages/urld/3.0.1.zip (Attempt 2 of 3): HTTP request returned status code
 401 ()
Getting https://code.dlang.org/packages/urld/3.0.1.zip...
Failed to download https://code.dlang.org/packages/urld/3.0.1.zip (Attempt 3 of 3): HTTP request returned status code
 401 ()
Failed to download package urld from https://code.dlang.org/packages/urld/3.0.1.zip
Package supplier registry at https://code.dlang.org/ failed with 'Failed to download package urld from https://code.d
lang.org/packages/urld/3.0.1.zip', trying fallbacks.
Downloading metadata for urld
Getting https://codemirror.dlang.org/api/packages/infos?packages=%5B%22urld%22%5D&include_dependencies=true&minimize=
true...
adding urld to metadata cache
Getting https://codemirror.dlang.org/packages/urld/3.0.1.zip...
Failed to download https://codemirror.dlang.org/packages/urld/3.0.1.zip (Attempt 1 of 3): HTTP request returned statu
s code 401 ()
Getting https://codemirror.dlang.org/packages/urld/3.0.1.zip...
Failed to download https://codemirror.dlang.org/packages/urld/3.0.1.zip (Attempt 2 of 3): HTTP request returned statu
s code 401 ()
Getting https://codemirror.dlang.org/packages/urld/3.0.1.zip...
Failed to download https://codemirror.dlang.org/packages/urld/3.0.1.zip (Attempt 3 of 3): HTTP request returned statu
s code 401 ()
Failed to download package urld from https://codemirror.dlang.org/packages/urld/3.0.1.zip
Fallback package supplier registry at https://codemirror.dlang.org/ failed with 'Failed to download package urld from
 https://codemirror.dlang.org/packages/urld/3.0.1.zip'.
       Error Fetching urld failed: Failed to download package urld from https://code.dlang.org/packages/urld/3.0.1.zip

Running curl manually

curl -L --netrc-optional https://code.dlang.org/packages/urld/3.0.1.zip 

Deprecated authentication method. Create a Personal Access Token to access: https://github.com/settings/tokens

with -f

curl: (22) The requested URL returned error: 401

I think it would be better to have netrc support opt in instead of enabing it by default as tracking down why dub was unable to download anything was not great.

The default dub setup does need any credentials do I dont think there is a use case for having netrc enabled by default.

Adapting my netrc just because of this is a workaround and not a solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions