Skip to content

GET returned 401 Unauthorized for rules_python #10998

Closed

Description

@etsangsplk

ATTENTION! Please read and follow:

  • if this is a question about how to build / test / query / deploy using Bazel, or a discussion starter, send it to [email protected]
  • if this is a bug or feature request, fill the form below as best as you can.

Description of the problem / feature request:

Any attempt to run bazel build even as simple as "bazel build" will cause An error occurred during the fetch of repository 'rules_python'
Turning on client_debug does not show anything that is useful to see what are the actual http requests being sent. If it shows what's going on, it will at least offer some clue.
bazel --client_debug build

Feature requests: what underlying problem are you trying to solve with this feature?

Replace this line with your answer.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

I already have .netrc file setup as in ~/.netrc and tested with those credentials to make sure they work.

Any attempt to run bazel build even as simple as "bazel build" will cause An error occurred during the fetch of repository 'rules_python'

WARNING: Download from https://github.com/bazelbuild/rules_python/archive/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 401 Unauthorized

ERROR: An error occurred during the fetch of repository 'rules_python':
   java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_python/archive/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz] to /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/rules_python/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz: GET returned 401 Unauthorized
INFO: Call stack for the definition of repository 'bazel_gazelle' which is a http_archive (rule definition at /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
 - /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/io_bazel_rules_docker/repositories/repositories.bzl:140:9

What operating system are you running Bazel on?

macos Mojave Version 10.14.6

What's the output of bazel info release?

2.0

If bazel info release returns "development version" or "(@Non-Git)", tell us how you built Bazel.

Replace this line with your answer.

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

Replace this line with your answer.

Have you found anything relevant by searching the web?

no

Any other information, logs, or outputs that you want to share?

Invoke `bazel help build` for full description of usage and options.
Your request is correct, but requested an empty set of targets. Nothing will be built.
INFO: Call stack for the definition of repository 'rules_python' which is a http_archive (rule definition at /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
 - /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/io_bazel_rules_docker/repositories/repositories.bzl:89:9
 - /Users/etsang/dev/src/cd.splunkdev.com/streamlio/streamlio/WORKSPACE:187:1
WARNING: Download from https://github.com/bazelbuild/rules_python/archive/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 401 Unauthorized
ERROR: An error occurred during the fetch of repository 'rules_python':
   java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_python/archive/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz] to /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/rules_python/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz: GET returned 401 Unauthorized
INFO: Call stack for the definition of repository 'bazel_gazelle' which is a http_archive (rule definition at /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
 - /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/io_bazel_rules_docker/repositories/repositories.bzl:140:9
 - /Users/etsang/dev/src/cd.splunkdev.com/streamlio/streamlio/WORKSPACE:187:1
ERROR: no such package '@rules_python//python': java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_python/archive/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz] to /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/rules_python/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz: GET returned 401 Unauthorized
ERROR: no such package '@rules_python//python': java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_python/archive/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz] to /private/var/tmp/_bazel_etsang/1c934e33649dc402e585a9ee332986e2/external/rules_python/38f86fb55b698c51e8510c807489c9f4e047480e.tar.gz: GET returned 401 Unauthorized```

Activity

  1. etsangsplk commented on Mar 22, 2020

    @etsangsplk
    Author

    It is personal token. github deprecated auth via login and password via rest api. That is why

  2. added
    team-ExternalDeps
    untriaged
    on Mar 24, 2020
  3. electrofelix commented on Mar 24, 2020

    @electrofelix

    I'm running into this as well, and as I run in the build in a docker image I could have a look at what was going on.

    I tried exporting a token into the docker build env, upgrading the base docker env, switching versions of bazel, nothing seemed to work.

    So when I did a curl from within the docker build of one of the files I saw the following output:

    curl https://github.com/bazelbuild/bazel-gazelle/releases/download/0.17.0/bazel-gazelle-0.17.0.tar.gz
    <!DOCTYPE html>
    <html>
      <head>
        <title>401 UNAUTHORIZED</title>
      </head>
      <body>
        <h1>Error 401 UNAUTHORIZED</h1>
        <p>UNAUTHORIZED</p>
        <h3>Guru Meditation:</h3>
        <p>XID: 299731509</p>
        <hr>
        <p>Varnish cache server</p>
      </body>
    </html>
    

    So I suspect there was something broken on Github's end for hosting packages, and they removed the broken varnish cache because it started working again with a fresh docker build locally for me.

  4. etsangsplk commented on Mar 24, 2020

    @etsangsplk
    Author

    And how did you remove the varnish cache? This is the first time I use bazel.

  5. electrofelix commented on Mar 26, 2020

    @electrofelix

    @etsangsplk I didn't, seems Github removed it, did your errors go away at all?

  6. etsangsplk commented on Mar 26, 2020

    @etsangsplk
    Author

    yup. since github deprecatrf login/password for rest access.. I just need to change .netrc to use personal token to make the error go away.

  7. added
    team-OSS
    on Jun 15, 2020
  8. removed
    team-OSS
    on Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-ExternalDepsuntriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions