Git Product home page Git Product logo

Comments (14)

tarsius avatar tarsius commented on July 17, 2024

Did you update ghub and Emacs to the same version as used on the other machines?

There are bugs in the auth-source.el of older Emacsen, which may be relevant here.

from ghub.

tarsius avatar tarsius commented on July 17, 2024

Enter email, password and one-time password.

Are you creating a new token?

You should not have to enter your email but your username. Maybe if you provided your username instead of your email, then it would work.

from ghub.

d12frosted avatar d12frosted commented on July 17, 2024

Oh sorry, I meant username instead of email. Just tried again after upgrading all packages and I experience the same error.

Regarding Emacs version - yes, they are the same.

from ghub.

cbourjau avatar cbourjau commented on July 17, 2024

Just adding another datapoint here. I am experiencing the same issue on:

  • emacs 26.1
  • Ghub 20181112.1755
  • Magit 20181124.1733

In case it matters, I am using the .authinfo.gpg file to store my credentials. Anything I could do to further debug this?

from ghub.

tarsius avatar tarsius commented on July 17, 2024

Are you creating a new token?

That's a rather relevant question. In other words does only the setup wizard fail or do you also get this error for normal requests after you have manually created and stored the token?

from ghub.

d12frosted avatar d12frosted commented on July 17, 2024

from ghub.

jojojames avatar jojojames commented on July 17, 2024

Getting the same/similar issue.

I make sure to delete the token before token creation. Token seems to be created even though the elisp call fails.

Emacs 26.1
ghub-20181220.1406
magit-20181218.2039

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  (encode-coding-string nil utf-8)
  (ghub--auth "api.github.com" forge "jojojames" nil)
  (#f(compiled-function () #<bytecode 0x45f64555>))
  (ghub--retrieve "{\"query\":\"query ($owner:String!, $name:String!) {\\n                 repository(owner:$owner, name:$name) { id }\\n               }\",\"variables\":{\"owner\":\"emacs-evil\",\"name\":\"evil-collection\"}}" #s(ghub--req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/graphql" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous t) :forge nil :silent nil :method "POST" :headers #f(compiled-function () #<bytecode 0x45f64555>) :handler ghub--handle-response :unpaginate nil :noerror nil :reader nil :callback nil :errorback nil :value nil :extra nil))
  (ghub-request "POST" "/graphql" nil :payload "{\"query\":\"query ($owner:String!, $name:String!) {\\n                 repository(owner:$owner, name:$name) { id }\\n               }\",\"variables\":{\"owner\":\"emacs-evil\",\"name\":\"evil-collection\"}}" :silent nil :username nil :auth forge :host "api.github.com" :callback nil :errorback nil :extra nil :value nil)
  (ghub-graphql "query ($owner:String!, $name:String!) {\n                 repository(owner:$owner, name:$name) { id }\n               }" ((owner . "emacs-evil") (name . "evil-collection")) :username nil :auth forge :host "api.github.com")
  (ghub--repository-id "emacs-evil" "evil-collection" :username nil :auth forge :host "api.github.com")
  (ghub-repository-id "emacs-evil" "evil-collection" :host "api.github.com" :auth forge :forge ghub)
  (#f(compiled-function (class host owner name &optional stub) "Return (OUR-ID . THEIR-ID) of the specified repository.\nIf optional STUB is non-nil, then the IDs are not guaranteed to\nbe unique.  Otherwise this method has to make an API request to\nretrieve THEIR-ID, the repository's ID on the forge.  In that\ncase OUR-ID derives from THEIR-ID and is unique across all\nforges and hosts.  " #<bytecode 0x45dc7f61>) forge-github-repository "github.com" "emacs-evil" "evil-collection" nil)
  (apply #f(compiled-function (class host owner name &optional stub) "Return (OUR-ID . THEIR-ID) of the specified repository.\nIf optional STUB is non-nil, then the IDs are not guaranteed to\nbe unique.  Otherwise this method has to make an API request to\nretrieve THEIR-ID, the repository's ID on the forge.  In that\ncase OUR-ID derives from THEIR-ID and is unique across all\nforges and hosts.  " #<bytecode 0x45dc7f61>) forge-github-repository ("github.com" "emacs-evil" "evil-collection" nil))
  (forge--repository-ids forge-github-repository "github.com" "emacs-evil" "evil-collection" nil)
  (#f(compiled-function (&rest rest) "Return the repository identified by HOST, OWNER and NAME." #<bytecode 0x45dc9e39>) ("github.com" "emacs-evil" "evil-collection") "origin" create)
  (apply #f(compiled-function (&rest rest) "Return the repository identified by HOST, OWNER and NAME." #<bytecode 0x45dc9e39>) ("github.com" "emacs-evil" "evil-collection") ("origin" create))
  (forge-get-repository ("github.com" "emacs-evil" "evil-collection") "origin" create)
  (#f(compiled-function (url &optional remote demand) "Return the repository at URL." #<bytecode 0x45dc9dcd>) "https://github.com/emacs-evil/evil-collection" "origin" create)
  (apply #f(compiled-function (url &optional remote demand) "Return the repository at URL." #<bytecode 0x45dc9dcd>) "https://github.com/emacs-evil/evil-collection" ("origin" create))
  (forge-get-repository "https://github.com/emacs-evil/evil-collection" "origin" create)
  (#f(compiled-function (demand &optional remote) "Return the forge repository for the current Git repository." #<bytecode 0x45dc9db5>) create)
  (apply #f(compiled-function (demand &optional remote) "Return the forge repository for the current Git repository." #<bytecode 0x45dc9db5>) create nil)
  (forge-get-repository create)
  (forge-pull)
  (funcall-interactively forge-pull)
  (call-interactively forge-pull)
  (magit-invoke-popup-action 121)
  (funcall-interactively magit-invoke-popup-action 121)
  (call-interactively magit-invoke-popup-action nil nil)
  (command-execute magit-invoke-popup-action)

from ghub.

YoungFrog avatar YoungFrog commented on July 17, 2024

FWIW I had a similar issue which I resolved by clearing auth-source cache (M-x auth-source-forget-all-cached). Before I did that : (auth-source-search :host "api.github.com" :user "YoungFrog^forge" :max 1) returned nothing, now it returns something (modify "api.github.com", "YoungFrog" and "forge" according to your situation).

from ghub.

tarsius avatar tarsius commented on July 17, 2024

There already was code in ghub--token and ghub-create-token that was supposed to deal with auth-source thinking that "I do not know this" is a "value" that should be cached. But looking at that again I noticed that the latter instance of this kludge was not updated to work around an additional bug only present in Emacs versions before 26.1.

Please verify that a newly created token can now be used on your version of Emacs without invalidating the cache explicitly.

from ghub.

d12frosted avatar d12frosted commented on July 17, 2024

Unfortunately, I don't have that system anymore. But will try to get similar setup and verify that your commit fixes the issue.

P. S. thank you for the fix :)

from ghub.

jojojames avatar jojojames commented on July 17, 2024

I still see the same thing.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  (encode-coding-string nil utf-8)
  (ghub--auth "api.github.com" forge "jojojames" nil)
  (#f(compiled-function () #<bytecode 0x454d9bf9>))
  (ghub--retrieve "{\"query\":\"query ($owner:String!, $name:String!) {\\n                 repository(owner:$owner, name:$name) { id }\\n               }\",\"variables\":{\"owner\":\"emacs-evil\",\"name\":\"evil-collection\"}}" #s(ghub--req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/graphql" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous t) :forge nil :silent nil :method "POST" :headers #f(compiled-function () #<bytecode 0x454d9bf9>) :handler ghub--handle-response :unpaginate nil :noerror nil :reader nil :callback nil :errorback nil :value nil :extra nil))
  (ghub-request "POST" "/graphql" nil :payload "{\"query\":\"query ($owner:String!, $name:String!) {\\n                 repository(owner:$owner, name:$name) { id }\\n               }\",\"variables\":{\"owner\":\"emacs-evil\",\"name\":\"evil-collection\"}}" :silent nil :username nil :auth forge :host "api.github.com" :callback nil :errorback nil :extra nil :value nil)
  (ghub-graphql "query ($owner:String!, $name:String!) {\n                 repository(owner:$owner, name:$name) { id }\n               }" ((owner . "emacs-evil") (name . "evil-collection")) :username nil :auth forge :host "api.github.com")
  (ghub--repository-id "emacs-evil" "evil-collection" :username nil :auth forge :host "api.github.com")
  (ghub-repository-id "emacs-evil" "evil-collection" :host "api.github.com" :auth forge :forge ghub)
  (#f(compiled-function (class host owner name &optional stub) "Return (OUR-ID . THEIR-ID) of the specified repository.\nIf optional STUB is non-nil, then the IDs are not guaranteed to\nbe unique.  Otherwise this method has to make an API request to\nretrieve THEIR-ID, the repository's ID on the forge.  In that\ncase OUR-ID derives from THEIR-ID and is unique across all\nforges and hosts.  " #<bytecode 0x4558ac55>) forge-github-repository "github.com" "emacs-evil" "evil-collection" nil)
  (apply #f(compiled-function (class host owner name &optional stub) "Return (OUR-ID . THEIR-ID) of the specified repository.\nIf optional STUB is non-nil, then the IDs are not guaranteed to\nbe unique.  Otherwise this method has to make an API request to\nretrieve THEIR-ID, the repository's ID on the forge.  In that\ncase OUR-ID derives from THEIR-ID and is unique across all\nforges and hosts.  " #<bytecode 0x4558ac55>) forge-github-repository ("github.com" "emacs-evil" "evil-collection" nil))
  (forge--repository-ids forge-github-repository "github.com" "emacs-evil" "evil-collection" nil)
  (#f(compiled-function (&rest rest) "Return the repository identified by HOST, OWNER and NAME." #<bytecode 0x4558bc2d>) ("github.com" "emacs-evil" "evil-collection") "origin" create)
  (apply #f(compiled-function (&rest rest) "Return the repository identified by HOST, OWNER and NAME." #<bytecode 0x4558bc2d>) ("github.com" "emacs-evil" "evil-collection") ("origin" create))
  (forge-get-repository ("github.com" "emacs-evil" "evil-collection") "origin" create)
  (#f(compiled-function (url &optional remote demand) "Return the repository at URL." #<bytecode 0x4558bbc1>) "https://github.com/emacs-evil/evil-collection" "origin" create)
  (apply #f(compiled-function (url &optional remote demand) "Return the repository at URL." #<bytecode 0x4558bbc1>) "https://github.com/emacs-evil/evil-collection" ("origin" create))
  (forge-get-repository "https://github.com/emacs-evil/evil-collection" "origin" create)
  (#f(compiled-function (demand &optional remote) "Return the forge repository for the current Git repository." #<bytecode 0x4558b969>) create)
  (apply #f(compiled-function (demand &optional remote) "Return the forge repository for the current Git repository." #<bytecode 0x4558b969>) create nil)
  (forge-get-repository create)
  (forge-pull)
  (funcall-interactively forge-pull)
  (call-interactively forge-pull)
  (magit-invoke-popup-action 121)
  (funcall-interactively magit-invoke-popup-action 121)
  (call-interactively magit-invoke-popup-action nil nil)
  (command-execute magit-invoke-popup-action)

forge-20181227.1804
ghub-20181227.1039
magit-20181226.1909

I'm not sure about auth-source. I am entering my username and password upon being prompted by forge.

from ghub.

cbourjau avatar cbourjau commented on July 17, 2024

Sorry for the late respnse, I just tried this again using:

  • Magit 20190102.107, Git 2.17.1, Emacs 27.0.50, gnu/linux
  • Forge 20190102.58
  • Ghub 20190102.109

I never had a token before and things fail after an attempted token creation with:

ghub--token: Wrong type argument: listp, "/authorizations"

I get this message after entering my github username, password, and two-factor authentication. In case it matters, I am also using a .authinfo.gpg file.

from ghub.

tarsius avatar tarsius commented on July 17, 2024

That's not the same issue I would think. I also don't see how this could happen. The code paths taken by this literal string are pretty trivial at least within ghub and I don't see anything along the way that could possibly fail.

If you want me to look into this more you will have to open a new issue and provide a backtrace.

from ghub.

jojojames avatar jojojames commented on July 17, 2024

@tarsius Don't want to comingle the two threads too much but I think that happens when the token already exists on github.

I hit that issue @cbourjau hit every time if there's a token.

from ghub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.