🇺🇦 We stand with Ukraine! 🇺🇦

Cannot connect to Octoprint from PC

What is the problem?
Been running the previous version of Octoprint for a few months now, updated to 1.4.0 yesterday, had numerous problems I think with a few plugins (which I deleted) after I looked at the logs. Got it all running ok until turned it all back on this morning and I cant connect from the PC, the last message I see very briefly is 'Loading Octoprint's UI, please wait' that disappears and I'm left with

'Loading failed' 'Initial settings fetch failed. Please check your browser's error console and octoprint.log for possible reasons.Also make sure that the server is actually running by reloading this page'

I have connected a monitor to the Raspberry Pi and watched it boot up ok, I can login to the pi ok, I can PuTTy to the pi from my PC, I can even see my webcam connected to the pi from my phone using OctoClient but is says its failed to connect to serial port.

What did you already try to solve it?
Apart from restarting the PC (the PC stays on 24,7) and the Pi numerous times. Trying a different browser. I can ping the pi from my PC ok, and can see the connection at my Router.

Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!)
I would supply these if I knew how to get them as I cant log onto Octoprint. I've looked in the %APPDATA%\OctoPrint\logs directory and there's no Octoprint directory. I'm assuming this should be on my PC

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)
Octoprint 1.4.0
OctoPi 0.17.0
PC running Win10 using Chrome
Raspberry Pi version 3
Creality CR10s with a BLtouch and running Klipper.

Review your post. There is a word that consistently gets replaced by a link. Read the page that link goes to.

1 Like

You will only have this directory if you have OctoPrint running on your PC, which you obviously don't cause you said Pi 3. Perhaps the Klipper reference is telling?

https://community.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299

Yes, Ive read the logs link, it lists the log files but how do I access them through puTTY ? Just copy and pasting the commands there does nothing. It seems to assume I should know how but I don't.

That explains why I can't find them :slight_smile:

Use WinSCP. With WinSCP you can easily download the logs with a gui :slight_smile:

Thanks, now I've found the logs, these are the ones hopefully..

octoprint.log (878.9 KB) serial.log (148 Bytes) plugin_pluginmanager_console.log (964 Bytes) plugin_softwareupdate_console.log (219.4 KB)

Try shift reload in your browser. For some reason it looks like your client in the browser think its logged in when in fact you aren't according to what OctoPrint is seeing.

I'm also seeing some data corruption in the log which hints at file corruption or powerloss. Have you pulled power from the Pi without shutting it down first? That can cause file system corruption and break your install in exciting ways.

Tried shift reload but still the same result. Yes, Im guilty of just switching of the power supply to both printer and Raspberry Pi at the wall socket when finished.

Might be that you killed your file system that way and it broke something that's needed for OctoPrint to work. If you have a spare SD card on hand I'd suggest to flash that to a fresh version and take it from there.

I'm not sure whether I should advise to create a backup (which you can do via command line) and to restore from that because if it has nuked the user store you'll be right back where you started...

I can find another SD card, Once reinstalled can I copy across the Klipper log file or copy and paste the relevant parts as it has all my setup data for bed leveling and BLtouch. I'm assuming I'll have to reinstall the other plugins from scratch..

Well I was nearly there. I've reinstalled Octoprint and Klipper. Octoprint went ok and I can log on and open up the display, Kippler went sort of ok until I got to the config of the USB port. So I carried on with the install.

At first I've managed to connect to the printer, temps were showing and I homed the printer. I have installed the BLTouch plugin and was trying reset the error it had with a M280 alarm. Usually I just keep re-setting the sensor till it clears.

By mistake I hit the emergency stop button, now it wont connect at all.. Any ideas ?

octoprint (12).log (262.7 KB)

Re-installed klipper again successfully. Got the serial connection and everything up and running. Started putting the plugins back on. This time I'll make a backup/restore and switch off properly.

Thanks for your help guys..

1 Like

I had a similar problem after upgrading to Octoprint v 1.4
Here's how I solved my problem:

  1. I first logged into Pi via the terminal and upgraded all the Raspberry Pi software,
  2. reverted to a previous version of Octoprint which then ran correctly
  3. I used the update functionality of Octoprint to upgrade to v.1.4.0 again.
    This time everything went swimmingly and worked.

Instructions on upgrading Raspery Pi software

https://projects.raspberrypi.org/en/projects/using-pip-on-raspberry-pi/3
.
To revert to an earlier version of Octoprint is easy

Yep, I have this problem too. Just updated to latest Buster on RPi 3, expunged the previous Octoprint installation by manually removing services, venvs, caches etc, rebooted, followed the instructions at Setting up OctoPrint on a Raspberry Pi running Raspbian to install OctoPrint. When I run Octoprint, it starts up and spits out log messages, but when I try to connect from a browser running locally ( Firefox ESR ) I get the 'initial settings fetch failed' message. This appears to correspond to a log message saying 'WARNING - 403 GET /api/settings' .

Upload the full logs please.
Hopefully they will show us what's going on. :slight_smile:

(Octoprint 1.4.0 on Raspbian 10)
Had the same problem, turns out, somehow a bunch of files were missing in /home/pi/.local/lib/python2.7/site-packages/octoprint since the update, the solution which worked for me was to copy everything from /usr/local/lib/python2.7/dist-packages/octoprint/ (here the files did exist) to /home/pi/.local/lib/python2.7/site-packages/octoprint, doing a chown -R pi:pi * in that directory and reloading the webpage. You should now be able to login as usual. As far as I can tell octoprint somehow messes up during update/install and doesn't put the files in the location and then crashes when loading the login mask.
In case you still would like to take a look at the logs (before the fix): https://pastebin.com/emTpKCyL (this is just a tail, if you really need more just ask :slight_smile: )

1 Like

It doesn't. Updating works fine for tens of thousands of people who installed it the way it was intended to be installed, in a virtual environment, not some global or --user install. Install it as described in the actual setup guide.