JuliaPackaging / BinaryBuilder.jl

Binary Dependency Builder for Julia
https://binarybuilder.org
Other
392 stars 101 forks source link

build_tarballs with --deploy="user/mylib_jll.jl" leads to `device_flow_disabled` error when authenticating with GitHub #1189

Closed mathieu17g closed 2 years ago

mathieu17g commented 2 years ago

I have a device_flow_disabled error when trying to deploy a JLL on my GitHub repository:

➜  CGAL git:(master) ✗ julia build_tarballs.jl --deploy="mathieu17g/CGAL_jll.jl" --verbose x86_64-apple-darwin 
[ Info: Building and deploying version 5.3.0+2 to mathieu17g/CGAL_jll.jl

Authenticating with GitHub
ERROR: LoadError: HTTP.ExceptionRequest.StatusError(400, "POST", "/login/device/code", HTTP.Messages.Response:
"""
HTTP/1.1 400 Bad Request
Server: GitHub.com
Date: Tue, 22 Mar 2022 04:51:45 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Vary: X-PJAX, X-PJAX-Container
permissions-policy: interest-cohort=()
Cache-Control: no-cache
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Expect-CT: max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"
Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com objects-origin.githubusercontent.com www.githubstatus.com collector.githubapp.com collector.github.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events translator.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src render.githubusercontent.com viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com identicons.github.com collector.githubapp.com collector.github.com github-cloud.s3.amazonaws.com secured-user-images.githubusercontent.com/ *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/
Vary: Accept-Encoding, Accept, X-Requested-With
X-GitHub-Request-Id: D1C1:CFA5:16E5474:187548A:623955E0

{"error":"device_flow_disabled","error_description":"Device Flow must be explicitly enabled for this App","error_uri":"https://docs.github.com"}""")

It is the first time that I have tried to deploy on my repository, so I can't say it ever worked for me, but I found this change on GitHub that may affect everybody https://github.blog/changelog/2022-03-16-enable-oauth-device-authentication-flow-for-apps/

Does anyone else experience the same issue?

giordano commented 2 years ago

Uhm, thanks for the report, but I just deployed a repository to GitHub without issues. For what is worth I used the GITHUB_TOKEN environment variable, maybe that helps for the time being?

mathieu17g commented 2 years ago

Thanks for the hint. It works for me now when using a GitHub token via the GITHUB_TOKEN environment variable. Shall I close the issue?

giordano commented 2 years ago

Thanks for the hint. It works for me now when using a GitHub token via the GITHUB_TOKEN environment variable.

Good to hear!

Shall I close the issue?

No, maybe we still need to fix the settings of the app

Octogonapus commented 2 years ago

I just hit this as well. Same error.

chkwon commented 2 years ago

I have the same error.

Following the GITHUB_TOKEN environment variable trick, I did:

$ export GITHUB_TOKEN="ghp_........"
$ julia build_tarball.jl .....

and it worked.

The GITHUB_TOKEN can be generated here: https://github.com/settings/tokens

jamesrhester commented 2 years ago

The GITHUB_TOKEN trick didn't work for me, perhaps there are particular permissions my token should have? I have allowed it to create repositories and write to repositories.

giordano commented 2 years ago

Can someone please try again? I believe I just enabled device flow in the settings of the app

giordano commented 2 years ago

According to https://github.com/JuliaPackaging/Yggdrasil/pull/5210#issuecomment-1193128118 this is now fixed.

lucifer1004 commented 2 years ago

There will be many more "Wizard Recipe: XXX" in PRs!