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

No longer works in Github CI #280

Closed
anka-213 opened this issue Sep 16, 2020 · 20 comments
Closed

No longer works in Github CI #280

anka-213 opened this issue Sep 16, 2020 · 20 comments

Comments

@anka-213
Copy link

Five days ago something changed. I'm not sure what:
https://github.com/nix-dot-dev/getting-started-nix-template/actions?query=workflow%3A%22Update+niv%22

Now we're getting error messages like this:

  Package: gitignore.nix
  FATAL: Cannot get latest revision for branch 'master' (hercules-ci/gitignore.nix)
  The request failed: Response {responseStatus = Status {statusCode = 404, statusMessage = "Not Found"}, responseVersion = HTTP/1.1, responseHeaders = [("server","GitHub.com"),("date","Fri, 11 Sep 2020 08:12:48 GMT"),("content-type","application/json; charset=utf-8"),("status","404 Not Found"),("x-github-media-type","github.v3; param=sha"),("access-control-expose-headers","ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset"),("access-control-allow-origin","*"),("strict-transport-security","max-age=31536000; includeSubdomains; preload"),("x-frame-options","deny"),("x-content-type-options","nosniff"),("x-xss-protection","1; mode=block"),("referrer-policy","origin-when-cross-origin, strict-origin-when-cross-origin"),("content-security-policy","default-src 'none'"),("vary","Accept-Encoding, Accept, X-Requested-With"),("content-encoding","gzip"),("X-Ratelimit-Limit","60"),("X-Ratelimit-Remaining","57"),("X-Ratelimit-Reset","1599815568"),("X-Ratelimit-Used","3"),("Content-Length","91"),("X-GitHub-Request-Id","07C0:4303:4B774F:83C930:5F5B3180")], responseBody = "{\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest\"}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
  NOTE: You may want to retry with an authentication token:
  
      GITHUB_TOKEN=... niv <cmd>
  
  For more information on rate-limiting, see
  
      https://developer.github.com/v3/#rate-limiting
  
  
  FATAL: One or more packages failed to update:

Adding a GITHUB_TOKEN doesn't help.

Do you have any idea what the problem is?

@anka-213
Copy link
Author

@domenkozar I opened an issue for it here instead of in your getting-started-nix-template repo, since I assumed it's an upstream issue. Is this correct?

@domenkozar
Copy link
Contributor

I've been seeing this too, no idea yet what's going on.

@nmattia
Copy link
Owner

nmattia commented Sep 17, 2020

I think GitHub might have started using GITHUB_PATH, which is read by niv (and prepended to the HTTP path used when making API calls). Will need to investigate.

@dhess
Copy link

dhess commented Sep 17, 2020

Same here.

@nmattia
Copy link
Owner

nmattia commented Sep 17, 2020

Can somebody try echoing or unseting GITHUB_PATH? I don't have a GitHub action workflow handy

@domenkozar
Copy link
Contributor

Can confirm unsetting GITHUB_PATH makes it work again.

@domenkozar
Copy link
Contributor

@nmattia
Copy link
Owner

nmattia commented Sep 17, 2020

Great, I'll work on the workaround.

@dhess
Copy link

dhess commented Sep 17, 2020

@domenkozar It's a bit off-topic, but how do you test GitHub Actions? I don't know of a way to run them manually unless they've failed, and when you re-run those, it appears to use the same revision of the action that failed the first time, not any newer revision.

dhess pushed a commit to hackworthltd/hacknix that referenced this issue Sep 17, 2020
@nmattia
Copy link
Owner

nmattia commented Sep 17, 2020

@domenkozar mind having a quick look here, see if that makes sense? #281

@nmattia
Copy link
Owner

nmattia commented Sep 17, 2020

I've just release v0.2.18, feel free to re-open if the workaround is not applicable or if the problem persist!

@nmattia nmattia closed this as completed Sep 17, 2020
@anka-213
Copy link
Author

@dhess The solution I used was to add "on: push" to the yaml file, so it runs every time you push new changes.

@dhess
Copy link

dhess commented Sep 17, 2020

@anka-213 Ahh, that's clever, thanks!

@anka-213
Copy link
Author

Hmm, I've not gotten it to work yet. Neither unsetting GITHUB_TOKEN nor upgrading to latest version of niv helped for me. https://github.com/anka-213/cclaw-nix-stuff/actions?query=workflow%3A%22Update+niv%22

and I don't see any succeeding tests here either: https://github.com/nix-dot-dev/getting-started-nix-template/actions?query=workflow%3A%22Update+niv%22

@dhess
Copy link

dhess commented Sep 18, 2020

Same, my GitHub Actions using niv are still failing after upgrading to this version of niv.

@nmattia
Copy link
Owner

nmattia commented Sep 18, 2020

Neither unsetting GITHUB_TOKEN

I think you mean GITHUB_PATH?

nor upgrading to latest version of niv helped for me.

How exactly are you pinning the version? Have you tried building from master (using the cache) like niv-updater-action? That one (niv-updater-action) is now running smoothly again.

EDIT: the tests here appear to be working; note the GITHUB_PATH=

@dhess
Copy link

dhess commented Sep 18, 2020

Oh, do we still need to unset GITHUB_PATH to make this work with GitHub Actions?

@nmattia
Copy link
Owner

nmattia commented Sep 18, 2020

No, it should work out of the box with niv 0.2.18. Are you sure you're using that version?

@dhess
Copy link

dhess commented Sep 18, 2020

I pinned the latest version in my sources.json, but didn't make it available in the shell in which the GitHub Action was running. Sorry, user error! Should be fixed now.

@anka-213
Copy link
Author

Neither unsetting GITHUB_TOKEN

I think you mean GITHUB_PATH?

Ah, right. That was the problem. I didn't notice the difference!

How exactly are you pinning the version?

Apparently in the wrong way. It was using the version from nixpkgs.

Thanks!

avdv added a commit to avdv/replay that referenced this issue Aug 30, 2021
It has been fixed in niv 0.2.18.

See nmattia/niv#280
avdv added a commit to avdv/replay that referenced this issue Aug 30, 2021
It has been fixed in niv 0.2.18.

See nmattia/niv#280
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

4 participants