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

Cannot use Cloud Foundry command line #1027

Closed
jemartineza opened this issue Dec 8, 2016 · 7 comments
Closed

Cannot use Cloud Foundry command line #1027

jemartineza opened this issue Dec 8, 2016 · 7 comments

Comments

@jemartineza
Copy link

  • Command
    cf login

  • What occurred, incl. error and/or stack trace
    ←[31;1mFAILED←[0m
    Error read/writing config: unexpected end of JSON input

  • What you expected to occur
    Open promt API>

  • CLI Version
    _cf-cli-installer_6.22.2_winx64

  • Platform & Shell Details
    Windows 8.1 64-bit

  • Any other relevant information
    I reinstalled several times. Even I downloaded the binary and show the same error all the time

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/135805311

The labels on this github issue will be updated when the story is started.

@AdrianLThomas
Copy link

AdrianLThomas commented Dec 13, 2016

Hi,
I've been having the same issue but managed to resolve it.

The issue was that the cf.exe config was reading from an empty / 0kb file located here:
C:\Users<Your.Username>.cf\config.json

I deleted this file and it was recreated when I ran cf.exe again. The CLI then continued to work as normal. I guess if you do have some valid config in there then it may be worth making a backup of it first.

@jemartineza
Copy link
Author

Great Adrian!!

I renamed the file, executed the command and it works again

Thank you very much!

Ernesto

@dkoper
Copy link

dkoper commented Dec 13, 2016

@jemartineza @AdrianLThomas We've had a similar report quite recently. If you can figure out why your config.json got empty/corrupted/stopped working, please let us know. Maybe there is a plugin, or even a cf CLI corner case that corrupts it and we should address that.

Cheers,
Dies Koper
CF CLI PM

@AdrianLThomas
Copy link

@dkoper I think I started noticing the issue when I was setting a password in the HTTP_PROXY / HTTPS_PROXY environment variables. I had a special character in my password (a colon). I think from then on I started to see the issue (even after I had removed the environment variable.

Hope that helps,
Adrian

@dkoper
Copy link

dkoper commented Dec 16, 2016

@AdrianLThomas I tried setting http_proxy with a password with a colon and doing a cf login on Windows 7 64 bit but could not reproduce the issue.

I don't think we have enough information to investigate deeper.

Closing. Feel free to reopen or submit a new issue if you run into it again and have reproducible steps for us, or at least more details for us to go from.

@arobinsongit
Copy link

I also ran into this issue. Relevant details below with initiating steps on my build

  • Command

cf login

  • What occurred, incl. error and/or stack trace
    ←[31;1mFAILED←[0m
    Error read/writing config: unexpected end of JSON input

  • What you expected to occur
    Receive API endpoint> prompt

  • CLI Version
    _cf-cli-installer_6.22.2_winx64

  • Platform & Shell Details
    Windows 10 Pro 64 bit with recent updates

  • Recreate Steps

  1. Created CF_HOME environment variable pointed to D:\CF_HOME (folder previously created but empty)
  2. open command prompt
  3. C:\WINDOWS\system32>cf login
  4. Receive API endpoint> prompt
  5. CTRL+C
  6. C:\WINDOWS\system32>cf logout
    �6. [31;1mFAILED�[0m
    Error read/writing config: unexpected end of JSON input
  7. C:\WINDOWS\system32>cf login
    �[31;1mFAILED�[0m
    Error read/writing config: unexpected end of JSON input
  8. Inspect config.json in D:\CF_HOME.cf
  9. config.json file is empty - 0 kb
  10. Delete config.json
  11. C:\WINDOWS\system32>cf login
  12. Receive API endpoint> prompt
  13. Inspect config.json --> json file is populated. See attachment.
    Step13-config.json.txt
  14. Repeat cf login with CTRL+C combination twice

C:\WINDOWS\system32>cf login

API endpoint>
C:\WINDOWS\system32>cf login

API endpoint>
C:\WINDOWS\system32>

  1. No further issues encountered. config.json remains valid.
  • Any other relevant information
    It seems that if config.json does not exist and you CTRL+C on the first cf login attempt a blank config.json file is written. On subsequent cf login attempts the system attempts to read config.json but it is blank and so it throws the referenced error.

Hope this helps with the recreation for bug fix.

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

5 participants