Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

JSON readtable error:60 #228

Closed
TheSandBoxMKG opened this issue Aug 28, 2019 · 16 comments
Closed

JSON readtable error:60 #228

TheSandBoxMKG opened this issue Aug 28, 2019 · 16 comments

Comments

@TheSandBoxMKG
Copy link

It was working fine before with the instance I was using but one iday it stopped working, and returned this error after entering the credentials:
Captura de pantalla_2019-08-28_19-09-38
This is the only configuration I had on:
(setq mastodon-instance-url "https://meow.social/")
And tried already deleting the plstore and revoking the permission so it would ask me again for the permission but it didn't work. I did even delete and installed again the package from stable.melpa.org.
But it returned the same error.

I removed the instance configuration from .emacs and it started to work with mastodon.social (I didn't log in though because I don't have an account there).
But I want to use my meow.social account.
Anything I could help with to solve this problem?

Also, there's some reason it works with some instances but not with others?

@humanitiesNerd
Copy link

I'm having tha same issue

@AdamWysokinski
Copy link

Same problem here

@arenzana
Copy link

Same.

@slondr
Copy link

slondr commented Nov 17, 2020

Yep, having the same problem (fresh install, instance is koyu.space).

@justinabrahms
Copy link

justinabrahms commented Nov 26, 2020

Debugger entered--Lisp error: (json-readtable-error 60)
  signal(json-readtable-error (60))
  json-read()
  json-read-from-string("\n<!DOCTYPE html>\n<html lang='en'>\n<head>\n<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>\n<meta charset='utf-8'>\n<title>The page you are looking for isn&#39;t here.\n - Mastodon</title>\n<meta content='width=device-width,initial-scale=1' name='viewport'>\n<link rel=\"stylesheet\" media=\"all\" href=\"/packs/css/common-240b0151.css\" />\n<link rel=\"stylesheet\" media=\"all\" href=\"/packs/css/default-446e5713.chunk.css\" />\n<script src=\"/packs/js/common-fea69b14509bad28a4dd.js\" crossorigin=\"anonymous\"></script>\n<script src=\"/packs/js/error-7596933267cf9f5b9159.chunk.js\" crossorigin=\"anonymous\"></script>\n</head>\n<body class='error'>\n<div class='dialog'>\n<div class='dialog__illustration'>\n<img alt='Mastodon' src='/oops.png'>\n</div>\n<div class='dialog__message'>\n<h1>The page you are looking for isn&#39;t here.\n</h1>\n</div>\n</div>\n</body>\n</html>\n")
  mastodon-client--fetch()
  mastodon-client--store()
  mastodon-client()
  mastodon-auth--generate-token-no-storing-credentials()
  mastodon-auth--generate-token()
  mastodon-auth--get-token()
  mastodon-auth--access-token()
  mastodon-http--get("https://fosstodon.org/api/v1/timelines/home")
  mastodon-http--get-json("https://fosstodon.org/api/v1/timelines/home")
  mastodon-tl--init("home" "timelines/home" mastodon-tl--timeline)
  mastodon-tl--get-home-timeline()
  mastodon()
  funcall-interactively(mastodon)
  call-interactively(mastodon record nil)
  command-execute(mastodon record)
  execute-extended-command(nil "mastodon" "mastodon")
  funcall-interactively(execute-extended-command nil "mastodon" "mastodon")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

@humanitiesNerd
Copy link

humanitiesNerd commented Nov 26, 2020 via email

@justinabrahms
Copy link

Here's the debug log from the http library. Apparently you can customize the url-debug property to get logs like this. They log to the *URL-DEBUG* buffer. It appears as though we're somehow incorrectly sending a GET request that should be a POST request.

http -> Contacting host: fosstodon.org:443
http -> Marking connection as busy: fosstodon.org:443 #<process fosstodon.org>
http -> Request is: 
GET /oauth/token HTTP/1.1
MIME-Version: 1.0
Connection: keep-alive
Extension: Security/Digest Security/SSL
Host: fosstodon.org
Accept-encoding: gzip
Accept: */*
User-Agent: URL/Emacs Emacs/26.3 (TTY; x86_64-pc-linux-gnu)
Cookie: _mastodon_session=9aGH7fKFu4tNTS48tQfmBbCVozpHi6oPKuPKtqEQBiHWDVtOB%2BZXbhI80SzvGy7StErCKq6QPJtU0uwISJ%2FA--LyoCANedgVSMv5j%2B--mUiauI%2FbC%2B4jBN1mgnVPNA%3D%3D


retrieval -> Spinning in url-retrieve-synchronously: nil (#<buffer  *http fosstodon.org:443*-308303>)
http -> Calling after change function `url-http-wait-for-headers-change-function' for `#<process fosstodon.org>'
http -> url-http-wait-for-headers-change-function ( *http fosstodon.org:443*-308303)
http -> Saw end of headers... ( *http fosstodon.org:443*-308303)
http -> url-http-parse-response called in ( *http fosstodon.org:443*-308303)
http -> Saw chunked encoding.
http -> Calling initial chunked-encoding for extra data at end of headers
http -> Reading chunk 0 (599 1073 474)
http -> Saw start of chunk 1 (length=466, start=600
http -> Reading chunk 1 (599 1073 474)
http -> Got to the end of chunk #1!
http -> Did not see start of chunk @ 1066!
http -> Spinning waiting for headers...
http -> Calling after change function `url-http-chunked-encoding-after-change-function' for `#<process fosstodon.org>'
http -> Reading chunk 1 (1068 1073 5)
http -> Got to the end of chunk #1!
http -> Saw start of chunk 2 (length=0, start=1066
http -> Saw end of stream chunk!
http -> Removing terminator of last chunk
http -> Marking connection as free: fosstodon.org:443 #<process fosstodon.org>
http -> url-http-parse-headers called in ( *http fosstodon.org:443*-308303)
http -> url-http-parse-response called in ( *http fosstodon.org:443*-308303)
http -> Parsed HTTP headers: class=4 status=404
http -> Found 1 Set-Cookie headers
http -> Finished parsing HTTP headers: t
http -> Marking connection as free: fosstodon.org:443 #<process fosstodon.org>
http -> Activating callback in buffer ( *http fosstodon.org:443*-308303): #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (#<buffer  *http fosstodon.org:443*-308303>) url-debug retrieval "Synchronous fetching done (%S)" t] 5 "

(fn &rest IGNORED)"] ((:error (error http 404) :peer (:certificate (:version 3 :serial-number "04:6e:0c:dd:1e:71:b4:1c:da:4f:3a:35:ee:c5:af:56:c3:d5" :issuer "C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3" :valid-from "2020-11-10" :valid-to "2021-02-08" :subject "CN=www.fosstodon.org" :public-key-algorithm "RSA" :certificate-security-level "High" :signature-algorithm "RSA-SHA256" :public-key-id "sha1:c2:c6:54:22:90:02:19:c9:d0:4f:c3:75:b8:cc:7e:f3:7d:bf:da:ed" :certificate-id "sha1:01:f1:aa:a7:94:72:9f:d6:1c:45:4a:47:83:d6:8a:5e:3e:ec:e2:88") :key-exchange "ECDHE-RSA" :protocol "TLS1.2" :cipher "AES-256-GCM" :mac "AEAD")))
retrieval -> Synchronous fetching done (#<buffer  *http fosstodon.org:443*-308303>)

@justinabrahms
Copy link

Okay, I now have this working. Aside from slowly stepping through the code, I made this config change which altered how the code path ran:

(setq mastodon-auth-source-file "~/.authinfo")

Maybe that will help folks?

@ghost
Copy link

ghost commented Mar 1, 2021

(json-readtable-error 60)

same error

json-read-from-string("\n\n<html lang='en...")

this is an 404 html page. source of this error:

mastodon-http--get("https://lor.sh/api/v1/timelines/home")

visited in web browser, this page does not exist.

@ghost
Copy link

ghost commented Mar 1, 2021

fixed with

(setq mastodon-auth-source-file "~/.authinfo")

@apoorv569
Copy link

apoorv569 commented May 17, 2021

I installed mastodon.el today for the first time, and I'm also having this issue. Unfortunately adding (setq mastodon-auth-source-file "~/.authinfo") did not fix it. It asks for my email and password then throws the error JSON readtable error:60. My instance is mastodon.social

@mooseyboots
Copy link
Owner

strange, i haven't encountered this on my install, on emacs -Q, or on a second machine.

.authinfo.gpg is notoriously picky. the magic dev explained that having comments, newlines or incorrectly formatted urls can break it.

@mooseyboots
Copy link
Owner

fwiw, this commit by ieure seems to fix initial auth token issues:
ieure@50062c5

[it's also incorporated into my fork: https://github.com/mooseyboots/mastodon.el]

@libertyimp
Copy link

I'm having this issue as well, i tried the (setq mastodon-auth-source-filie "~/.authinfo) and it didn't work for me

@libertyimp
Copy link

Well i just deleted the package and reinstalled the package and it seems to be working now... kinda odd but maybe this will work for someone else as well

@mooseyboots
Copy link
Owner

ieure/mastodon.el@50062c5 should fix this. re-open if you still have this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants