json parse error #39

ehaselwanter opened this Issue Jan 25, 2011 · 10 comments


None yet

gh network list
/Library/Ruby/Gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in initialize': A JSON text must at least contain two octets! (JSON::ParserError) from /Library/Ruby/Gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:innew'
from /Library/Ruby/Gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in parse' from /Library/Ruby/Gems/1.8/gems/github-0.5.0/lib/commands/helpers.rb:400:inget_cache'

ento commented Apr 7, 2011

In my case, I hadn't told git about my github credentials. From github-gem's readme:


To let GitHub know who you are, just have your git config set up with your GitHub username and token.

$ git config --global github.user "your-github-username"
$ git config --global github.token "your-github-token"

You can find your token under your account.

After setting that up, gh network list worked smoothly.

jasonm commented Jul 21, 2011

I still see this issue, even after adding those configs. Happens in ruby 1.8.7 and 1.9.2 with github gem versino 0.6.2.

encukou commented Oct 29, 2011

I also get this error.

paulp commented Dec 1, 2011

I had this very frustrating issue for a long time (is spewing a stack trace really the best error message available?) and finally fixed it by removing GITHUB_USER and GITHUB_TOKEN from my gitconfig and hardcoding my actual credentials.

jjb commented Jan 18, 2012

I'm having the same problem. None of the proposed solutions work for me.

savs commented Jan 22, 2012

Same error.

subblue commented Jan 27, 2012

Issue here too with ruby 1.9.2p290, json 1.6.5, json-pure 1.5.4 and github 0.6.2

evan commented Feb 25, 2012

The github gem will drop an invalid empty "network cache" file at .git/network-cache if the credentials are busted. Remove it, fix your credentials, then try.

shaneog commented Apr 11, 2012

Same error for me, tried with multiple repositories, both personal and part of an organisation.

I tried removing the .git/network_cache file also but it still doesn't work

This issue isn't relevant currently because the network list command doesn't work at all since GitHub deprecated the v2 API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment