sigma / magit-gh-pulls

Magit plugin for dealing with GitHub pull requests
254 stars 48 forks source link

JSON readtable error when [# g g] #50

Open stardiviner opened 8 years ago

stardiviner commented 8 years ago

I configure magit-gh-pulls like this:

(use-package magit-gh-pulls
  :config
  (add-hook 'magit-mode-hook 'turn-on-magit-gh-pulls)
  )

When I press [# g g] in magit-status. got error JSON readtable error in echo-area.

stardiviner commented 8 years ago

I try to debug it with toggle debug-on-error: Here is the output:

Debugger entered--Lisp error: (json-readtable-error)
  signal(json-readtable-error nil)
  byte-code("")\207" [req num err resp eieio-oref :num-retries zerop signal eieio-oset gh-url-run-request] 5)
  gh-url-set-response(nil (#2=[object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/repos/stardiviner/emacs.d/pulls" nil (("Authorization" . "token 7da023389d565b537ff1e14b1ba07a6ddba7f0e0") ("Content-Type" . "application/json")) "null" nil 0 nil] [object gh-api-paged-response "gh-api-paged-response" nil nil (("Via" . "1.0 qingyunProxy005 (squid)") ("X-Cache-Lookup" . "NONE from qingyunProxy005:8128") ("X-Cache" . "MISS from qingyunProxy005") ("Content-Language" . "en") ("Vary" . "Accept-Language") ("X-Squid-Error" . "ERR_INVALID_REQ 0") ("Content-Length" . "6830") ("Content-Type" . "text/html") ("Date" . "Tue, 06 Oct 2015 07:40:10 GMT") ("Mime-Version" . "1.0") ("Server" . "squid") (status-string . "Length Required") (status-code . "411") (status-version . "1.0")) 411 nil (closure (t) (&rest . #1=(args)) (apply 'gh-object-list-read 'gh-pulls-request . #1#)) #2#]))
  #[(req &optional resp) "....." [req params url url-request-extra-headers url-request-data url-request-method (("basic" ignore . 4)) high eieio-oref :method :data :headers :url :query gh-url-params-encode "" :async make-instance default-response-cls url-retrieve gh-url-set-response make-local-variable url-registered-auth-schemes url-retrieve-synchronously nil mapc #[(cb) "\302    \"\207" [resp cb gh-url-add-response-callback] 3] :install-callbacks url-privacy-level resp req-resp] 10]([object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/repos/stardiviner/emacs.d/pulls" nil (("Authorization" . "token 7da023389d565b537ff1e14b1ba07a6ddba7f0e0") ("Content-Type" . "application/json")) "null" nil 0 nil] [object gh-api-paged-response "gh-api-paged-response" nil nil (("Via" . "1.0 qingyunProxy005 (squid)") ("X-Cache-Lookup" . "NONE from qingyunProxy005:8128") ("X-Cache" . "MISS from qingyunProxy005") ("Content-Language" . "en") ("Vary" . "Accept-Language") ("X-Squid-Error" . "ERR_INVALID_REQ 0") ("Content-Length" . "6830") ("Content-Type" . "text/html") ("Date" . "Tue, 06 Oct 2015 07:40:10 GMT") ("Mime-Version" . "1.0") ("Server" . "squid") (status-string . "Length Required") (status-code . "411") (status-version . "1.0")) 411 nil (closure (t) (&rest . #1=(args)) (apply 'gh-object-list-read 'gh-pulls-request . #1#)) [object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/repos/stardiviner/emacs.d/pulls" nil (("Authorization" . "token 7da023389d565b537ff1e14b1ba07a6ddba7f0e0") ("Content-Type" . "application/json")) "null" nil 0 nil]])
  apply(#[(req &optional resp) "...." [req params url url-request-extra-headers url-request-data url-request-method (("basic" ignore . 4)) high eieio-oref :method :data :headers :url :query gh-url-params-encode "" :async make-instance default-response-cls url-retrieve gh-url-set-response make-local-variable url-registered-auth-schemes url-retrieve-synchronously nil mapc #[(cb) "\302    \"\207" [resp cb gh-url-add-response-callback] 3] :install-callbacks url-privacy-level resp req-resp] 10] (#2=[object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/repos/stardiviner/emacs.d/pulls" nil (("Authorization" . "token 7da023389d565b537ff1e14b1ba07a6ddba7f0e0") ("Content-Type" . "application/json")) "null" nil 0 nil] [object gh-api-paged-response "gh-api-paged-response" nil nil (("Via" . "1.0 qingyunProxy005 (squid)") ("X-Cache-Lookup" . "NONE from qingyunProxy005:8128") ("X-Cache" . "MISS from qingyunProxy005") ("Content-Language" . "en") ("Vary" . "Accept-Language") ("X-Squid-Error" . "ERR_INVALID_REQ 0") ("Content-Length" . "6830") ("Content-Type" . "text/html") ("Date" . "Tue, 06 Oct 2015 07:40:10 GMT") ("Mime-Version" . "1.0") ("Server" . "squid") (status-string . "Length Required") (status-code . "411") (status-version . "1.0")) 411 nil (closure (t) (&rest . #1=(args)) (apply 'gh-object-list-read 'gh-pulls-request . #1#)) #2#]))
  gh-url-run-request([object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/repos/stardiviner/emacs.d/pulls" nil (("Authorization" . "token 7da023389d565b537ff1e14b1ba07a6ddba7f0e0") ("Content-Type" . "application/json")) "null" nil 0 nil] [object gh-api-paged-response "gh-api-paged-response" nil nil (("Via" . "1.0 qingyunProxy005 (squid)") ("X-Cache-Lookup" . "NONE from qingyunProxy005:8128") ("X-Cache" . "MISS from qingyunProxy005") ("Content-Language" . "en") ("Vary" . "Accept-Language") ("X-Squid-Error" . "ERR_INVALID_REQ 0") ("Content-Length" . "6830") ("Content-Type" . "text/html") ("Date" . "Tue, 06 Oct 2015 07:40:10 GMT") ("Mime-Version" . "1.0") ("Server" . "squid") (status-string . "Length Required") (status-code . "411") (status-version . "1.0")) 411 nil (closure (t) (&rest . #1=(args)) (apply 'gh-object-list-read 'gh-pulls-request . #1#)) [object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/repos/stardiviner/emacs.d/pulls" nil (("Authorization" . "token 7da023389d565b537ff1e14b1ba07a6ddba7f0e0") ("Content-Type" . "application/json")) "null" nil 0 nil]])
  #[(api transformer method resource &optional data params) "....." [api fmt headers cache resource method eieio-oref :data-format :form (("Content-Type" . "application/x-www-form-urlencoded")) :json (("Content-Type" . "application/json")) :cache sha1 format "%s" safe-methods pcache-has pcache-get gh-cache-outdated-p gh-cache-etag gh-auth-modify-request :auth make-instance gh-api-paged-request :method :url :base gh-api-expand-resource :query :headers "If-None-Match" :data gh-api-json-encode gh-url-form-encode "" gh-api-response "cached" :data-received t default-response-cls :transform gh-url-run-request gh-url-add-response-callback gh-api-callback :key :revive pcache-invalidate transformer key ...] 16]([object gh-pulls-api "api" t [object gh-cache "cache" "~/.emacs.d/var/pcache/cache" "0.3/gh-3" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1444111912.2226124 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "stardiviner" "7da023389d565b537ff1e14b1ba07a6ddba7f0e0"] :json 1 nil] (closure (t) (&rest . #1=(args)) (apply 'gh-object-list-read 'gh-pulls-request . #1#)) "GET" "/repos/stardiviner/emacs.d/pulls")
  apply(#[(api transformer method resource &optional data params) "......" [api fmt headers cache resource method eieio-oref :data-format :form (("Content-Type" . "application/x-www-form-urlencoded")) :json (("Content-Type" . "application/json")) :cache sha1 format "%s" safe-methods pcache-has pcache-get gh-cache-outdated-p gh-cache-etag gh-auth-modify-request :auth make-instance gh-api-paged-request :method :url :base gh-api-expand-resource :query :headers "If-None-Match" :data gh-api-json-encode gh-url-form-encode "" gh-api-response "cached" :data-received t default-response-cls :transform gh-url-run-request gh-url-add-response-callback gh-api-callback :key :revive pcache-invalidate transformer key ...] 16] ([object gh-pulls-api "api" t [object gh-cache "cache" "~/.emacs.d/var/pcache/cache" "0.3/gh-3" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1444111912.2226124 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "stardiviner" "7da023389d565b537ff1e14b1ba07a6ddba7f0e0"] :json 1 nil] (closure (t) (&rest . #1=(args)) (apply 'gh-object-list-read 'gh-pulls-request . #1#)) "GET" "/repos/stardiviner/emacs.d/pulls"))
  gh-api-authenticated-request([object gh-pulls-api "api" t [object gh-cache "cache" "~/.emacs.d/var/pcache/cache" "0.3/gh-3" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1444111912.2226124 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "stardiviner" "7da023389d565b537ff1e14b1ba07a6ddba7f0e0"] :json 1 nil] (closure (t) (&rest . #1=(args)) (apply 'gh-object-list-read 'gh-pulls-request . #1#)) "GET" "/repos/stardiviner/emacs.d/pulls")
  #[(api user repo) "..." [api user repo gh-api-authenticated-request gh-object-list-reader eieio-oref req-cls "GET" format "/repos/%s/%s/pulls"] 8]([object gh-pulls-api "api" t [object gh-cache "cache" "~/.emacs.d/var/pcache/cache" "0.3/gh-3" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1444111912.2226124 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "stardiviner" "7da023389d565b537ff1e14b1ba07a6ddba7f0e0"] :json 1 nil] "stardiviner" "emacs.d")
  apply(#[(api user repo) "...." [api user repo gh-api-authenticated-request gh-object-list-reader eieio-oref req-cls "GET" format "/repos/%s/%s/pulls"] 8] ([object gh-pulls-api "api" t [object gh-cache "cache" "~/.emacs.d/var/pcache/cache" "0.3/gh-3" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1444111912.2226124 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "stardiviner" "7da023389d565b537ff1e14b1ba07a6ddba7f0e0"] :json 1 nil] "stardiviner" "emacs.d"))
  gh-pulls-list([object gh-pulls-api "api" t [object gh-cache "cache" "~/.emacs.d/var/pcache/cache" "0.3/gh-3" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1444111912.2226124 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "stardiviner" "7da023389d565b537ff1e14b1ba07a6ddba7f0e0"] :json 1 nil] "stardiviner" "emacs.d")
  magit-gh-pulls-reload()
  call-interactively(magit-gh-pulls-reload nil nil)
  command-execute(magit-gh-pulls-reload)
justmytwospence commented 8 years ago

Same error for me

alexander-yakushev commented 8 years ago

@stardiviner @justmytwospence What version of Emacs are you using, and also where magit-gh-pulls is installed from (melpa or melpa-stable)?

stardiviner commented 8 years ago

@alexander-yakushev MELPA , current, sx 20150718.625 installed

alexander-yakushev commented 8 years ago

Have you tried to recompile all packages, like described here http://emacs.stackexchange.com/questions/185/can-i-avoid-outdated-byte-compiled-elisp-files ? You should also update to the latest version of magit-gh-pulls while you are at it.

stardiviner commented 8 years ago

After recompile, with latest version MELPA. I got another error:

byte-code: Wrong type argument: listp, "https://developer.github.com/v3"

After I press # g again, then got same error again:

Debugger entered--Lisp error: (json-readtable-error)
  signal(json-readtable-error nil)
  byte-code("....
  gh-pulls-list([object gh-pulls-api "api" t [object gh-cache "cache" "~/.emacs.d/var/pcache/cache" "0.3/gh-3" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1445489164.554636 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "stardiviner" "7da023389d565b537ff1e14b1ba07a6ddba7f0e0"] :json 1 nil] "stardiviner" "emacs.d")
  magit-gh-pulls-reload()
alexander-yakushev commented 8 years ago

You haven't told me your Emacs version :)

stardiviner commented 8 years ago

sorry, forget that, magit-gh-pulls 20151020.446 installed

alexander-yakushev commented 8 years ago

I mean, what is the output of M-x version.

stardiviner commented 8 years ago

GNU Emacs 24.5.1

alexander-yakushev commented 8 years ago

It's most likely that something is wrong with your setup, or there are some old precompiled leftovers in one of the libraries (not necessarily magit-gh-pulls itself). Or maybe one of the dependencies' new versions are incompatible. I'm not able to tell more until I can reproduce this.

stardiviner commented 8 years ago

I have tried emacs -q and load packages with package-initialize, then enable magit-gh-pulls-mode in magit-status. Got same error.

alexander-yakushev commented 8 years ago

Do you have proper ~/.gitconfig? It should contain your user name and oauth token.

stardiviner commented 8 years ago

I tested with ~/.gitconfig:

[user]
    name = stardiviner
    email = numbchild@gmail.com
    ; signingkey = 47C32433 # GPG key ID.
    signingkey = numbchild@gmail.com

[credential]
    username = stardiviner
    ; find a helper -> $ git help -a | grep credential-
    ; helper = "$helper $options"
    helper = store

[github]
    user = stardiviner
    oauth-token = ......
alexander-yakushev commented 8 years ago

OK, I have no more ideas, sorry :( It's probably not magit-gh-pulls, but something wrong with https://github.com/sigma/gh.el

gengel commented 8 years ago

FWIW, I have the same issue.

[EDIT: By "the same issue" I meant that I'm getting byte-code: Wrong type argument: listp, "https://developer.github.com/v3"]

Environment: GNU Emacs 24.5.1 OS X 10.10.5 git version 2.4.9 (Apple Git-60)

gh 20150126.1125 magit-gh-pulls 0.5.2

~/.gitconfig:

[user]
    email = lobotomy42@gmail.com
    name = Gregory Engel
[push]
    default = simple
[github]
    user = gengel
    password = ...
    oauth-token = " ..."```
robb-romans commented 8 years ago

I have the same issue and error. GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2016-01-15 git version 2.7.3

Today, on upgrading to magit-gh-pulls Version: 20160313.1650

Github works from the command line, but magit-gh-pulls prompts me for username/password. Entering the correct username and pasting the personal access token generates this error: byte-code: JSON readtable error

If I manually type the access token, I get this error: Contacting host: api.github.com:443 byte-code: Wrong type argument: listp, "https://developer.github.com/v3"

tampix commented 8 years ago

Same issues (both byte-code: JSON readtable error and byte-code: Wrong type argument: listp, "https://developer.github.com/v3") for me with :

cmacrae commented 7 years ago

Sorry to add, but I'm also experiencing this issue :disappointed:

LaloHao commented 5 years ago

byte-recompiling emacs.d folder solves this error

C-u 0 M-x byte-recompile-directory

but now i get

Wrong type argument: listp, (message . "Not Found")