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

Error: GetUserByName: "user redirect does not exist [name: astral-sh] #192

Open
my1e5 opened this issue Dec 12, 2024 · 16 comments
Open

Error: GetUserByName: "user redirect does not exist [name: astral-sh] #192

my1e5 opened this issue Dec 12, 2024 · 16 comments
Labels
help wanted Extra attention is needed

Comments

@my1e5
Copy link

my1e5 commented Dec 12, 2024

I've been using v3 for a while without any problems on my self-hosted runner. Just updated to v4 and ran into this GetUserByName error.

- name: Set up uv
  id: setup-uv
  uses: astral-sh/setup-uv@v4
  with:
    enable-cache: true
    prune-cache: false

Logs

2024-12-12 12:41:21 [ci/ci] ⭐ Run Main Set up uv
2024-12-12 12:41:21 [ci/ci] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
2024-12-12 12:41:21 [ci/ci] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
2024-12-12 12:41:21 [ci/ci] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
2024-12-12 12:41:21 [ci/ci] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
2024-12-12 12:41:21 [ci/ci] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
2024-12-12 12:41:21 [ci/ci] [DEBUG] Extracting content to '/var/run/act'
2024-12-12 12:41:21 [ci/ci] [DEBUG] expression '${{ github.token }}' rewritten to 'format('{0}', github.token)'
2024-12-12 12:41:21 [ci/ci] [DEBUG] evaluating expression 'format('{0}', github.token)'
2024-12-12 12:41:21 [ci/ci] [DEBUG] expression 'format('{0}', github.token)' evaluated to '%!t(string=***)'
2024-12-12 12:41:21 [ci/ci] [DEBUG] type=remote-action actionDir=/data/cache/actions/astral-sh-setup-uv@v4 actionPath= workdir=/workspace/Research/Python actionCacheDir=/data/cache/actions actionName=astral-sh-setup-uv@v4 containerActionDir=/var/run/act/actions/astral-sh-setup-uv@v4
2024-12-12 12:41:21 [ci/ci] [DEBUG] /var/run/act/actions/astral-sh-setup-uv@v4
2024-12-12 12:41:21 [ci/ci] [DEBUG] Removing /data/cache/actions/astral-sh-setup-uv@v4/.gitignore before docker cp
2024-12-12 12:41:21 [ci/ci]   🐳  docker cp src=/data/cache/actions/astral-sh-setup-uv@v4/ dst=/var/run/act/actions/astral-sh-setup-uv@v4/
2024-12-12 12:41:21 [ci/ci] [DEBUG] Writing tarball /tmp/act2175040455 from /data/cache/actions/astral-sh-setup-uv@v4/
2024-12-12 12:41:21 [ci/ci] [DEBUG] Stripping prefix:/data/cache/actions/astral-sh-setup-uv@v4/ src:/data/cache/actions/astral-sh-setup-uv@v4/
2024-12-12 12:41:21 [ci/ci] [DEBUG] Extracting content from '/tmp/act2175040455' to '/var/run/act/actions/astral-sh-setup-uv@v4/'
2024-12-12 12:41:21 [ci/ci] [DEBUG] executing remote job container: [node /var/run/act/actions/astral-sh-setup-uv@v4/dist/setup/index.js]
2024-12-12 12:41:21 [ci/ci]   🐳  docker exec cmd=[node /var/run/act/actions/astral-sh-setup-uv@v4/dist/setup/index.js] user= workdir=
2024-12-12 12:41:21 [ci/ci] [DEBUG] Exec command '[node /var/run/act/actions/astral-sh-setup-uv@v4/dist/setup/index.js]'
2024-12-12 12:41:21 [ci/ci] [DEBUG] Working directory '/workspace/Research/Python'
2024-12-12 12:41:22 [ci/ci] ::error::GetUserByName: "user redirect does not exist [name: astral-sh]"
2024-12-12 12:41:22 [ci/ci]   | ::error::GetUserByName: "user redirect does not exist [name: astral-sh]"
2024-12-12 12:41:22 [ci/ci]   ❌  Failure - Main Set up uv
2024-12-12 12:41:22 [ci/ci] exitcode '1': failure
@my1e5
Copy link
Author

my1e5 commented Dec 12, 2024

Just checked, and everything works as expected when I downgrade to v3.

- name: Set up uv
  id: setup-uv
  uses: astral-sh/setup-uv@v3
  with:
    enable-cache: true
    prune-cache: false

Logs

2024-12-12 12:57:17 [ci/ci] ⭐ Run Main Set up uv
2024-12-12 12:57:17 [ci/ci] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
2024-12-12 12:57:17 [ci/ci] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
2024-12-12 12:57:17 [ci/ci] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
2024-12-12 12:57:17 [ci/ci] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
2024-12-12 12:57:17 [ci/ci] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
2024-12-12 12:57:17 [ci/ci] [DEBUG] Extracting content to '/var/run/act'
2024-12-12 12:57:17 [ci/ci] [DEBUG] expression '${{ github.token }}' rewritten to 'format('{0}', github.token)'
2024-12-12 12:57:17 [ci/ci] [DEBUG] evaluating expression 'format('{0}', github.token)'
2024-12-12 12:57:17 [ci/ci] [DEBUG] expression 'format('{0}', github.token)' evaluated to '%!t(string=***)'
2024-12-12 12:57:17 [ci/ci] [DEBUG] type=remote-action actionDir=/data/cache/actions/astral-sh-setup-uv@v3 actionPath= workdir=/workspace/Research/Python actionCacheDir=/data/cache/actions actionName=astral-sh-setup-uv@v3 containerActionDir=/var/run/act/actions/astral-sh-setup-uv@v3
2024-12-12 12:57:17 [ci/ci] [DEBUG] /var/run/act/actions/astral-sh-setup-uv@v3
2024-12-12 12:57:17 [ci/ci] [DEBUG] Removing /data/cache/actions/astral-sh-setup-uv@v3/.gitignore before docker cp
2024-12-12 12:57:17 [ci/ci]   🐳  docker cp src=/data/cache/actions/astral-sh-setup-uv@v3/ dst=/var/run/act/actions/astral-sh-setup-uv@v3/
2024-12-12 12:57:17 [ci/ci] [DEBUG] Writing tarball /tmp/act1485610621 from /data/cache/actions/astral-sh-setup-uv@v3/
2024-12-12 12:57:17 [ci/ci] [DEBUG] Stripping prefix:/data/cache/actions/astral-sh-setup-uv@v3/ src:/data/cache/actions/astral-sh-setup-uv@v3/
2024-12-12 12:57:17 [ci/ci] [DEBUG] Extracting content from '/tmp/act1485610621' to '/var/run/act/actions/astral-sh-setup-uv@v3/'
2024-12-12 12:57:17 [ci/ci] [DEBUG] executing remote job container: [node /var/run/act/actions/astral-sh-setup-uv@v3/dist/setup/index.js]
2024-12-12 12:57:17 [ci/ci]   🐳  docker exec cmd=[node /var/run/act/actions/astral-sh-setup-uv@v3/dist/setup/index.js] user= workdir=
2024-12-12 12:57:17 [ci/ci] [DEBUG] Exec command '[node /var/run/act/actions/astral-sh-setup-uv@v3/dist/setup/index.js]'
2024-12-12 12:57:17 [ci/ci] [DEBUG] Working directory '/workspace/Research/Python'
2024-12-12 12:57:18 [ci/ci]   | Downloading uv from "https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz" ...
2024-12-12 12:57:18 [ci/ci] ::debug::Downloading https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz
2024-12-12 12:57:18 [ci/ci]   | ::debug::Downloading https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz
2024-12-12 12:57:18 [ci/ci] ::debug::Destination /tmp/a48aa2ac-e03e-4bb4-8359-3eed7e06ae76
2024-12-12 12:57:18 [ci/ci]   | ::debug::Destination /tmp/a48aa2ac-e03e-4bb4-8359-3eed7e06ae76
2024-12-12 12:57:18 [ci/ci] ::debug::set auth
2024-12-12 12:57:18 [ci/ci]   | ::debug::set auth
2024-12-12 12:57:19 [ci/ci] ::debug::download complete
2024-12-12 12:57:19 [ci/ci]   | ::debug::download complete
2024-12-12 12:57:19 [ci/ci] ::debug::Checking tar --version
2024-12-12 12:57:19 [ci/ci]   | ::debug::Checking tar --version
2024-12-12 12:57:19 [ci/ci] ::debug::tar (GNU tar) 1.34%0ACopyright (C) 2021 Free Software Foundation, Inc.%0ALicense GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.%0AThis is free software: you are free to change and redistribute it.%0AThere is NO WARRANTY, to the extent permitted by law.%0A%0AWritten by John Gilmore and Jay Fenlason.
2024-12-12 12:57:19 [ci/ci]   | ::debug::tar (GNU tar) 1.34%0ACopyright (C) 2021 Free Software Foundation, Inc.%0ALicense GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.%0AThis is free software: you are free to change and redistribute it.%0AThere is NO WARRANTY, to the extent permitted by law.%0A%0AWritten by John Gilmore and Jay Fenlason.
2024-12-12 12:57:19 [ci/ci]   | [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /tmp/130642ea-e700-40cb-9ec4-a0be17ec6741 -f /tmp/a48aa2ac-e03e-4bb4-8359-3eed7e06ae76
2024-12-12 12:57:19 [ci/ci] ::debug::Checksum not provided. Checking known checksums.
2024-12-12 12:57:19 [ci/ci]   | ::debug::Checksum not provided. Checking known checksums.
2024-12-12 12:57:19 [ci/ci] ::debug::No known checksum found for x86_64-unknown-linux-gnu-0.5.8.
2024-12-12 12:57:19 [ci/ci]   | ::debug::No known checksum found for x86_64-unknown-linux-gnu-0.5.8.
2024-12-12 12:57:19 [ci/ci] ::debug::Caching tool uv 0.5.8 x86_64
2024-12-12 12:57:19 [ci/ci]   | ::debug::Caching tool uv 0.5.8 x86_64
2024-12-12 12:57:19 [ci/ci] ::debug::source dir: /tmp/130642ea-e700-40cb-9ec4-a0be17ec6741/uv-x86_64-unknown-linux-gnu
2024-12-12 12:57:19 [ci/ci]   | ::debug::source dir: /tmp/130642ea-e700-40cb-9ec4-a0be17ec6741/uv-x86_64-unknown-linux-gnu
2024-12-12 12:57:19 [ci/ci] ::debug::destination /opt/hostedtoolcache/uv/0.5.8/x86_64
2024-12-12 12:57:19 [ci/ci]   | ::debug::destination /opt/hostedtoolcache/uv/0.5.8/x86_64
2024-12-12 12:57:19 [ci/ci] ::debug::finished caching tool
2024-12-12 12:57:19 [ci/ci]   | ::debug::finished caching tool
2024-12-12 12:57:19 [ci/ci]   | Added /opt/hostedtoolcache/uv/0.5.8/x86_64 to the path
2024-12-12 12:57:19 [ci/ci]   | Added /root/.local/bin to the path
2024-12-12 12:57:19 [ci/ci]   | Successfully installed uv version 0.5.8
2024-12-12 12:57:19 [ci/ci] ##[add-matcher]/run/act/actions/astral-sh-setup-uv@v3/.github/python.json
2024-12-12 12:57:19 [ci/ci]   | ##[add-matcher]/run/act/actions/astral-sh-setup-uv@v3/.github/python.json
2024-12-12 12:57:19 [ci/ci]   | Set UV_CACHE_DIR to /tmp/setup-uv-cache
2024-12-12 12:57:19 [ci/ci]   | Searching files using cache dependency glob: **/uv.lock
2024-12-12 12:57:19 [ci/ci] ::debug::followSymbolicLinks 'true'
2024-12-12 12:57:19 [ci/ci]   | ::debug::followSymbolicLinks 'true'
2024-12-12 12:57:19 [ci/ci] ::debug::implicitDescendants 'true'
2024-12-12 12:57:19 [ci/ci]   | ::debug::implicitDescendants 'true'
2024-12-12 12:57:19 [ci/ci] ::debug::matchDirectories 'true'
2024-12-12 12:57:19 [ci/ci]   | ::debug::matchDirectories 'true'
2024-12-12 12:57:19 [ci/ci] ::debug::omitBrokenSymbolicLinks 'true'
2024-12-12 12:57:19 [ci/ci]   | ::debug::omitBrokenSymbolicLinks 'true'
2024-12-12 12:57:19 [ci/ci] ::debug::excludeHiddenFiles 'false'
2024-12-12 12:57:19 [ci/ci]   | ::debug::excludeHiddenFiles 'false'
2024-12-12 12:57:19 [ci/ci] ::debug::Search path '/workspace/Research/Python'
2024-12-12 12:57:19 [ci/ci]   | ::debug::Search path '/workspace/Research/Python'
2024-12-12 12:57:19 [ci/ci]   | /workspace/Research/Python/uv.lock
2024-12-12 12:57:19 [ci/ci]   | Found 1 files to hash.
2024-12-12 12:57:19 [ci/ci]   | Trying to restore uv cache from GitHub Actions cache with key: setup-uv-1-x86_64-unknown-linux-gnu-0.5.8-c810688b01e2d3b254536d918e39d619edfa10f0b042d825d6ed67f7466c568c
2024-12-12 12:57:19 [ci/ci] ::debug::Resolved Keys:
2024-12-12 12:57:19 [ci/ci]   | ::debug::Resolved Keys:
2024-12-12 12:57:19 [ci/ci] ::debug::["setup-uv-1-x86_64-unknown-linux-gnu-0.5.8-c810688b01e2d3b254536d918e39d619edfa10f0b042d825d6ed67f7466c568c"]
2024-12-12 12:57:19 [ci/ci]   | ::debug::["setup-uv-1-x86_64-unknown-linux-gnu-0.5.8-c810688b01e2d3b254536d918e39d619edfa10f0b042d825d6ed67f7466c568c"]
2024-12-12 12:57:19 [ci/ci] ::debug::Checking zstd --quiet --version
2024-12-12 12:57:19 [ci/ci]   | ::debug::Checking zstd --quiet --version
2024-12-12 12:57:19 [ci/ci] ::debug::1.4.8
2024-12-12 12:57:19 [ci/ci]   | ::debug::1.4.8
2024-12-12 12:57:19 [ci/ci] ::debug::zstd version: 1.4.8
2024-12-12 12:57:19 [ci/ci]   | ::debug::zstd version: 1.4.8
2024-12-12 12:57:19 [ci/ci] ::debug::Resource Url: http://172.17.0.3:33397/_apis/artifactcache/cache?keys=setup-uv-1-x86_64-unknown-linux-gnu-0.5.8-c810688b01e2d3b254536d918e39d619edfa10f0b042d825d6ed67f7466c568c&version=6e889508a071e149524c7f1cee56d7c82e3b00f602cea4ebbb015bfa5f9f71bc
2024-12-12 12:57:19 [ci/ci]   | ::debug::Resource Url: http://172.17.0.3:33397/_apis/artifactcache/cache?keys=setup-uv-1-x86_64-unknown-linux-gnu-0.5.8-c810688b01e2d3b254536d918e39d619edfa10f0b042d825d6ed67f7466c568c&version=6e889508a071e149524c7f1cee56d7c82e3b00f602cea4ebbb015bfa5f9f71bc
2024-12-12 12:57:19 [ci/ci] ::debug::Failed to delete archive: Error: ENOENT: no such file or directory, unlink ''
2024-12-12 12:57:19 [ci/ci]   | ::debug::Failed to delete archive: Error: ENOENT: no such file or directory, unlink ''
2024-12-12 12:57:19 [ci/ci]   | No GitHub Actions cache found for key: setup-uv-1-x86_64-unknown-linux-gnu-0.5.8-c810688b01e2d3b254536d918e39d619edfa10f0b042d825d6ed67f7466c568c
2024-12-12 12:57:19 [ci/ci]   ✅  Success - Main Set up uv
2024-12-12 12:57:19 [ci/ci] ::set-env:: UV_CACHE_DIR=/tmp/setup-uv-cache
2024-12-12 12:57:19 [ci/ci] ::set-output:: cache-hit=false
2024-12-12 12:57:19 [ci/ci] ::set-output:: uv-version=0.5.8
2024-12-12 12:57:19 [ci/ci] ::add-path:: /opt/hostedtoolcache/uv/0.5.8/x86_64
2024-12-12 12:57:19 [ci/ci] ::add-path:: /root/.local/bin
2024-12-12 12:57:19 [ci/ci] [DEBUG] evaluating expression ''
2024-12-12 12:57:19 [ci/ci] [DEBUG] expression '' evaluated to 'true'

@eifinger
Copy link
Collaborator

eifinger commented Jan 7, 2025

As wrote in the other issue I do not see any changes which can explain this.

My current assumption is that Gitea has a problem that this action got renamed from eifinger/setup-uv to astral-sh/setup-uv

@eifinger eifinger added the help wanted Extra attention is needed label Jan 7, 2025
@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

@eifinger Thanks for having a look at this. I've spotted something when comparing v3.2.4 to v4.2.0, perhaps it was the changes in dist/setup/index.js? Maybe the removal of the downloadLatest function and the refactoring that was associated with that?

Interestingly, if I provide a GitHub token with v4 the error message is subtly different:

  • v4 without providing GitHub token
::error::GetUserByName: "user redirect does not exist [name: astral-sh]"
  • v4 with GitHub token
::error::user does not exist [uid: 0, name: , keyid: 0]

Anyway, now that v5 has been released, I think the priority can perhaps be issue #221

@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

I've just tested versions 4.0.0, 4.1.0 and 4.2.0 separately. And it seems that the breaking change happens between 4.1.0 and 4.2.0. Sorry, I should have checked this more explicitly at first, rather than just checking v4.

So presumably it must be the changes introduced in

@mordae
Copy link

mordae commented Jan 8, 2025

Perhaps getting latest release of uv doesn't really work outside github.com? It seems that on Gitea / Forgejo this ends up looking at code.example.com/astral-sh/..., which fails due to astral-sh not being present on that forge.

@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

So, I think the problem only happens when you set version: "latest" (which is the default). If you set a particular version, everything works.

  • Doesn't work

- name: Set up uv
      id: setup-uv
      uses: astral-sh/[email protected]
      with:
        enable-cache: true
        prune-cache: false
        version: "latest"
  • Works!

- name: Set up uv
      id: setup-uv
      uses: astral-sh/[email protected]
      with:
        enable-cache: true
        prune-cache: false
        version: "0.5.14"

Looking at the changes in PR #178, I believe it must be an error occurring in getLatestVersion in src/download/download-version.ts:

async function getLatestVersion(githubToken: string) {
const octokit = github.getOctokit(githubToken);
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({
owner: OWNER,
repo: REPO,
});
if (!latestRelease) {
throw new Error("Could not determine latest release.");
}

@eifinger
Copy link
Collaborator

eifinger commented Jan 8, 2025

Could you please also try with version: "0.5.x"?

@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

Could you please also try with version: "0.5.x"?

Interesting, this doesn't work.

- name: Set up uv
  id: setup-uv
  uses: astral-sh/[email protected]
  with:
    version: "0.5.x"
::error::GetUserByName: "user redirect does not exist [name: astral-sh]"

@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

I just did some experiments with setup-uv v4.1.0 (which is working with version: "latest"). If it can find a cached version then it works but if not then it gives the GetUserByName error?

  • Works because it found 0.5.15 cached?
- name: Set up uv
  id: setup-uv
  uses: astral-sh/[email protected]
  with:
    version: "0.5.x"
Found uv in tool-cache for 0.5.x
Added /opt/hostedtoolcache/uv/0.5.15/x86_64 to the path
Added /root/.local/bin to the path
##[add-matcher]/run/act/actions/1d9977fd83e0e1bed24507888d83db816fd6a5f9d16004dc18e435a9668c106d/.github/python.json
Set UV_CACHE_DIR to /tmp/setup-uv-cache
Successfully installed uv version 0.5.15
  • But if I try to get an older uv version e.g. version: "0.4.x"
- name: Set up uv
  id: setup-uv
  uses: astral-sh/[email protected]
  with:
    version: "0.4.x"
::error::GetUserByName: "user redirect does not exist [name: astral-sh]"

@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

I've just created a fresh runner (so no cached data) and I've just tested v3.2.4 with a wildcard version specifier and get the same GetUserByName bug.

- name: Set up uv
  id: setup-uv
  uses: astral-sh/[email protected]
  with:
    version: "0.5.x"
::error::GetUserByName: "user redirect does not exist [name: astral-sh]"

@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

And I've just tried setup-uv v5.1.0 (with a GitHub token) and that also doesn't work with a wildcard specifier. It gives a different error though.

- name: Set up uv
  id: setup-uv
  uses: astral-sh/[email protected]
  with:
    version: "0.5.x"
    github-token: ${{ secrets.MY_GITHUB_TOKEN }}
::error::Parameter token or opts.auth is required

@eifinger
Copy link
Collaborator

eifinger commented Jan 8, 2025

And I've just tried setup-uv v5.1.0 (with a GitHub token) and that also doesn't work with a wildcard specifier. It gives a different error though.

- name: Set up uv
  id: setup-uv
  uses: astral-sh/[email protected]
  with:
    version: "0.5.x"
    github-token: ${{ secrets.MY_GITHUB_TOKEN }}
::error::Parameter token or opts.auth is required

Is that a valid token? Can you try that with latest?

@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

Is that a valid token? Can you try that with latest?

Good spot. Sorry, I used the wrong secret name. v5.1.0 does work with a wildcard specifier in the version name when the token is valid.

@eifinger
Copy link
Collaborator

eifinger commented Jan 8, 2025

This action currently assumes that it is running in the GitHub ecosystem which makes sure that the env var GITHUB_TOKEN is always set and can be used to connect to the Github REST API.

If you are using e.g. Gitea please make sure that you provide a valid token.

To solve that we need to exchange octokit with other means to collect release information which does not need a token.

@my1e5
Copy link
Author

my1e5 commented Jan 8, 2025

Just to clarify, this is valid for v5 and issue #221. But for v3 and v4, even if you provide a valid GitHub token you will get a failure.

I don't mind if this issue gets closed as we should be moving to v5 anyway.

@eifinger
Copy link
Collaborator

eifinger commented Jan 8, 2025

Good catch thanks for clarifying and your help in pinpointing the culprit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants