hexadecimalDinosaur/octoprint-cli

"Octoprint server cannot be reached

Closed this issue · 5 comments

Describe the bug
A clear and concise description of what the bug is.

Hopefully this is user error, but getting a "Octoprint server cannot be reached" message upon launching the app. I use the same address and API key with multiple other apps to connect to the Octoprint instance, all working normally.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'

  2. Click on '....'

  3. Scroll down to '....'

  4. See error

  5. pip3 install octoprint-cli

  6. create config file (~/.config/octoprint-cli) copied from sample config file. I have tried all imaginable permutations of my server address (with and without http and https, using .local name and local ip, as well as localhost running from RPi) and both my user and system API key. Also tried no quotes, soft quotes, and hard quotes around server name and api key values. Having reviewed the code, it looks like it should be able to handle my server address with/without http/https prefixes....

Expected behavior
A clear and concise description of what you expected to happen.
I enter server address and api key and running octoprint-cli connects to my Octoprint instance.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment Information:

  • OS: [e.g. iOS] both OctoPi and MacOS
  • Version [e.g. 22] just downloaded (does not output version when octoprint-cli version is issued, only above error message
  • Python Version: [e.g. 3.8] 3.7.3
  • Dependency versions
  • OctoPrint version: current
  • 3D Printer Model: Chiron w/ Marlin 2 sometimes, Klipper other times
    I've tried this on MacOS and RPi (running from OctoPi image)

Additional context
Add any other context about the problem here.

Happy to provide any logs/etc, just not sure what would be useful here...

Thanks

I'm unsure whether this is an issue with octoprint-cli or your OctoPrint server. Can you send the output of this command if you have access to curl?

curl -H 'X-API-Key: API_KEY_HERE' http://SERVER_ADDRESS_HERE/api/version

Thanks for responding so fast!

curl output:
{"api":"0.1","server":"1.5.3","text":"OctoPrint 1.5.3"}

Really looking forward to getting this figured out looks like you've done some awesome work :)

Just poked around a little further...

When I supply ServerAddress and ApiKey with no quotes, I get: "Invalid or Missing Arguments" followed by the help message. When I use soft or hard quotes, I get "Octoprint server cannot be reached"....

Just poked around a little further...

When I supply ServerAddress and ApiKey with no quotes, I get: "Invalid or Missing Arguments" followed by the help message. When I use soft or hard quotes, I get "Octoprint server cannot be reached"....

The configuration file shouldn't have quotes. Should look something like the image below. Invalid or Missing Arguments should only be showing up if the program arguments used are incorrect. Can you remove the quotes and try octoprint-cli version and tell me if the issue persists?

image

Ahh, user error it is. I was expecting an interactive session when I executed octoprint-cli, but I now see I need to issue a sub command at runtime.

Thanks so much.