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

(wrong-type-argument number-or-marker-p nil) in gh-url-response-init because url-http-end-of-headers does not seem to be properly available #102

Open
colonelpanic8 opened this issue May 26, 2019 · 6 comments

Comments

@colonelpanic8
Copy link
Contributor

Here is a full traceback:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  #f(compiled-function (resp buffer) #<bytecode 0x1f9363d>)(#<gh-api-paged-response gh-api-paged-response> #<buffer  *http api.github.com:443*>)
  apply(#f(compiled-function (resp buffer) #<bytecode 0x1f9363d>) (#<gh-api-paged-response gh-api-paged-response> #<buffer  *http api.github.com:443*>))
  #f(compiled-function (cl-cnm resp buffer) #<bytecode 0x1da4aed>)(#f(compiled-function (&rest cnm-args) #<bytecode 0x2109df5>) #<gh-api-paged-response gh-api-paged-response> #<buffer  *http api.github.com:443*>)
  apply(#f(compiled-function (cl-cnm resp buffer) #<bytecode 0x1da4aed>) #f(compiled-function (&rest cnm-args) #<bytecode 0x2109df5>) (#<gh-api-paged-response gh-api-paged-response> #<buffer  *http api.github.com:443*>))
  #f(compiled-function (&rest args) #<bytecode 0x195bfa1>)(#<gh-api-paged-response gh-api-paged-response> #<buffer  *http api.github.com:443*>)
  apply(#f(compiled-function (&rest args) #<bytecode 0x195bfa1>) #<gh-api-paged-response gh-api-paged-response> #<buffer  *http api.github.com:443*>)
  gh-url-response-init(#<gh-api-paged-response gh-api-paged-response> #<buffer  *http api.github.com:443*>)
  gh-url-set-response(nil (#<gh-api-paged-request gh-api-paged-request> #<gh-api-paged-response gh-api-paged-response>))
  #f(compiled-function (req &optional resp) #<bytecode 0x221e4a1>)(#<gh-api-paged-request gh-api-paged-request> #<gh-api-paged-response gh-api-paged-response>)
  apply(#f(compiled-function (req &optional resp) #<bytecode 0x221e4a1>) (#<gh-api-paged-request gh-api-paged-request> #<gh-api-paged-response gh-api-paged-response>))
  #f(compiled-function (cl-cnm req &optional resp) #<bytecode 0x1cd4041>)(#f(compiled-function (&rest cnm-args) #<bytecode 0x2250935>) #<gh-api-paged-request gh-api-paged-request> #<gh-api-paged-response gh-api-paged-response>)
  apply(#f(compiled-function (cl-cnm req &optional resp) #<bytecode 0x1cd4041>) #f(compiled-function (&rest cnm-args) #<bytecode 0x2250935>) (#<gh-api-paged-request gh-api-paged-request> #<gh-api-paged-response gh-api-paged-response>))
  #f(compiled-function (&rest args) #<bytecode 0x1cff1d9>)(#<gh-api-paged-request gh-api-paged-request> #<gh-api-paged-response gh-api-paged-response>)
  apply(#f(compiled-function (&rest args) #<bytecode 0x1cff1d9>) #<gh-api-paged-request gh-api-paged-request> #<gh-api-paged-response gh-api-paged-response>)
  gh-url-run-request(#<gh-api-paged-request gh-api-paged-request> #<gh-api-paged-response gh-api-paged-response>)
  #f(compiled-function (api transformer method resource &optional data params page-limit) #<bytecode 0x1ccf4f9>)(#<gh-search-api gh-search-api> #f(compiled-function (&rest args2) #<bytecode 0x22507f1>) "GET" "/search/repositories" nil ((q . "lens")) 1)
  apply(#f(compiled-function (api transformer method resource &optional data params page-limit) #<bytecode 0x1ccf4f9>) (#<gh-search-api gh-search-api> #f(compiled-function (&rest args2) #<bytecode 0x22507f1>) "GET" "/search/repositories" nil ((q . "lens")) 1))
  #f(compiled-function (cl-cnm api transformer method resource &optional data params page-limit) #<bytecode 0x135fde5>)(#f(compiled-function (&rest cnm-args) #<bytecode 0x225080d>) #<gh-search-api gh-search-api> #f(compiled-function (&rest args2) #<bytecode 0x22507f1>) "GET" "/search/repositories" nil ((q . "lens")) 1)
  apply(#f(compiled-function (cl-cnm api transformer method resource &optional data params page-limit) #<bytecode 0x135fde5>) #f(compiled-function (&rest cnm-args) #<bytecode 0x225080d>) (#<gh-search-api gh-search-api> #f(compiled-function (&rest args2) #<bytecode 0x22507f1>) "GET" "/search/repositories" nil ((q . "lens")) 1))
  #f(compiled-function (&rest args) #<bytecode 0x225731d>)(#<gh-search-api gh-search-api> #f(compiled-function (&rest args2) #<bytecode 0x22507f1>) "GET" "/search/repositories" nil ((q . "lens")) 1)
  apply(#f(compiled-function (&rest args) #<bytecode 0x225731d>) #<gh-search-api gh-search-api> (#f(compiled-function (&rest args2) #<bytecode 0x22507f1>) "GET" "/search/repositories" nil ((q . "lens")) 1))
  gh-api-authenticated-request(#<gh-search-api gh-search-api> #f(compiled-function (&rest args2) #<bytecode 0x22507f1>) "GET" "/search/repositories" nil ((q . "lens")) 1)
  #f(compiled-function (search-api query-string &optional page-limit &rest additional-arguments) #<bytecode 0x19586a9>)(#<gh-search-api gh-search-api> "lens" 1)
  apply(#f(compiled-function (search-api query-string &optional page-limit &rest additional-arguments) #<bytecode 0x19586a9>) (#<gh-search-api gh-search-api> "lens" 1))
  #f(compiled-function (cl-cnm search-api query-string &optional page-limit &rest additional-arguments) #<bytecode 0x1c211d1>)(#f(compiled-function (&rest cnm-args) #<bytecode 0x2250799>) #<gh-search-api gh-search-api> "lens" 1)
  apply(#f(compiled-function (cl-cnm search-api query-string &optional page-limit &rest additional-arguments) #<bytecode 0x1c211d1>) #f(compiled-function (&rest cnm-args) #<bytecode 0x2250799>) (#<gh-search-api gh-search-api> "lens" 1))
  #f(compiled-function (&rest args) #<bytecode 0x2257245>)(#<gh-search-api gh-search-api> "lens" 1)
  apply(#f(compiled-function (&rest args) #<bytecode 0x2257245>) #<gh-search-api gh-search-api> ("lens" 1))
  gh-search-repos(#<gh-search-api gh-search-api> "lens" 1)
  github-search-for-completion("lens" 1)
  github-search-clone-repo("lens")
  funcall-interactively(github-search-clone-repo "lens")
  call-interactively(github-search-clone-repo record nil)
  command-execute(github-search-clone-repo record)
  helm-M-x(nil #("github-search-clone-repo" 0 24 (match-part "github-search-clone-repo")))
  funcall-interactively(helm-M-x nil #("github-search-clone-repo" 0 24 (match-part "github-search-clone-repo")))
  call-interactively(helm-M-x nil nil)
  command-execute(helm-M-x)

Can't say I fully understand what is going on, but it seems that gh is expecting the url-http-end-of-headers variable to be populated, but this isn't happening for some reason.

@colonelpanic8
Copy link
Contributor Author

Possibly related to magit/ghub#81

@colonelpanic8
Copy link
Contributor Author

Wow, this is really strange. When I use edebug to break in
url-http-wait-for-headers-change-function, which is where url-http-end-of-headers seems to get set, the issue magically goes away for me. This is getting to the limits of my emacs fu, and seems like it could be an issue with emacs itself and the weird sort of variable being used for url-http-end-of-headers

@colonelpanic8
Copy link
Contributor Author

Ahh, magit/ghub#81 (comment) seems to explain why this is the case. "Adding sleeps before the point where we send the http request consisntently fixes the issue for me"

@colonelpanic8
Copy link
Contributor Author

Okay, so here is the bug report we should look at: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34341

@colonelpanic8
Copy link
Contributor Author

For now setting

(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")

fixes the issue. This should get fixed in newer versions of emacs though.

@vv111y
Copy link

vv111y commented Jul 6, 2019

Thank You @IvanMalison , this was not easy to find.

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

2 participants