Closed da2x closed 1 year ago
This issue was originally reported against 0.0.9 but I’ve updated and reconfirmed on 0.0.13.
Did you ever figure this out? Getting similar:
$ neocities push public
/usr/local/lib/ruby/2.7.0/json/common.rb:156:in `parse': 783: unexpected token at '<html>\r (JSON::ParserError)
<head><title>400 Bad Request</title></head>\r
<body>\r
<center><h1>400 Bad Request</h1></center>\r
<hr><center>openresty</center>\r
</body>\r
</html>\r
'
from /usr/local/lib/ruby/2.7.0/json/common.rb:156:in `parse'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/client.rb:87:in `post'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/client.rb:42:in `upload_hash'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/client.rb:54:in `upload'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/cli.rb:225:in `block (2 levels) in push'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/cli.rb:222:in `each'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/cli.rb:222:in `block in push'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/cli.rb:191:in `chdir'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/cli.rb:191:in `push'
from /usr/local/bundle/gems/neocities-0.0.15/lib/neocities/cli.rb:79:in `run'
from /usr/local/bundle/gems/neocities-0.0.15/bin/neocities:4:in `<top (required)>'
from /usr/local/bundle/bin/neocities:23:in `load'
from /usr/local/bundle/bin/neocities:23:in `<main>'
For me this was because of a newline at the end of the API key config file. Use nano -L
or echo -n
to prevent the newline.
This worked a couple of hours ago, so I’m guessing that the API is temporary unavailable. The API isn’t listed on the status tracker so I don’t really know, though.
At any rate, the client should handle this error condition better.