No www service, no matter what I do

I cannot connect to Octoprint via www.

I did upgrade
I did --force-reinstall

>#service octoprint status
● octoprint.service - LSB: OctoPrint daemon
   Loaded: loaded (/etc/init.d/octoprint; generated)
   Active: active (running) since Thu 2023-04-20 07:38:32 BST; 4min 8s ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 18 (limit: 1935)
   CGroup: /system.slice/octoprint.service
           └─395 /home/pi/oprint/bin/python3 /home/pi/oprint/bin/octoprint serve --host=127.0.0.1 --port=5000

Apr 20 07:38:31 octopi systemd[1]: Starting LSB: OctoPrint daemon...
Apr 20 07:38:32 octopi octoprint[317]: Starting OctoPrint Daemon: OctoPrint.
Apr 20 07:38:32 octopi systemd[1]: Started LSB: OctoPrint daemon.


>#ps -ef | grep -i octoprint | grep -i python
pi         395     1  3 07:38 ?        00:00:34 /home/pi/oprint/bin/python3 /home/pi/oprint/bin/octoprint serve --host=127.0.0.1 --port=5000

service is running but no port 80/443 is open

Starting Nmap 7.70 ( https://nmap.org ) at 2023-04-20 07:43 BST
Nmap scan report for 3d.pas (192.168.0.28)
Host is up (0.000090s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
22/tcp open  ssh

I restarted octoprint, rebooted RPI - nothing so far works.

tail of logs:

2023-04-20 07:39:31,992 - octoprint.events - INFO - Processing startup event, this is our first event
2023-04-20 07:39:31,993 - octoprint.events - INFO - Adding 2 events to queue that were held back before startup event
2023-04-20 07:39:32,004 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2023-04-20 07:39:32,014 - octoprint.server - INFO - Autoconnect on startup is configured, trying to connect to the printer...
2023-04-20 07:39:32,060 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2023-04-20 07:39:32,139 - octoprint.plugins.softwareupdate - INFO - Fetching check overlays from https://plugins.octoprint.org/update_check_overlay.json
2023-04-20 07:39:32,246 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2023-04-20 07:39:32,537 - octoprint.server - INFO - Trying to connect to configured serial port None
2023-04-20 07:39:33,642 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Detecting serial connection"
2023-04-20 07:39:33,677 - octoprint.server.util.watchdog - INFO - Running initial scan on watched folder...
2023-04-20 07:39:33,685 - octoprint.server.util.watchdog - INFO - ... initial scan done.
2023-04-20 07:39:33,772 - octoprint.util.comm - INFO - Serial detection: Performing autodetection with 1 port/baudrate candidates: /dev/ttyS0@115200
2023-04-20 07:39:33,773 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/ttyS0, baudrate 115200
2023-04-20 07:39:33,784 - octoprint.util.comm - INFO - Connecting to port /dev/ttyS0, baudrate 115200
2023-04-20 07:39:33,838 - octoprint.util.comm - INFO - Failed to connect: Port /dev/ttyS0 is busy or does not exist
2023-04-20 07:39:33,839 - octoprint.util.comm - INFO - Serial detection: Could not open port /dev/ttyS0, baudrate 115200, skipping
2023-04-20 07:39:33,840 - octoprint.util.comm - INFO - Changing monitoring state from "Detecting serial connection" to "Error"
2023-04-20 07:39:33,865 - octoprint.util.comm - INFO - Changing monitoring state from "Error" to "Offline after error"
2023-04-20 07:39:33,926 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2023-04-20 07:39:34,805 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on octopi._http._tcp.local.' for _http._tcp.local.
2023-04-20 07:39:35,205 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2023-04-20 07:39:35,701 - octoprint.plugins.discovery - INFO - Registered 'OctoPrint instance on octopi._octoprint._tcp.local.' for _octoprint._tcp.local.
2023-04-20 07:39:35,737 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on octopi for SSDP
2023-04-20 07:39:35,794 - octoprint.server - INFO - Listening on http://127.0.0.1:5000
2023-04-20 07:39:35,915 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2023-04-20 07:39:37,913 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2023-04-20 07:39:39,414 - octoprint.util.pip - INFO - Using "/home/pi/oprint/bin/python3 -m pip" as command to invoke pip
2023-04-20 07:39:39,419 - octoprint.util.pip - INFO - pip installs to /home/pi/oprint/lib/python3.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2023-04-20 07:39:39,419 - octoprint.util.pip - INFO - ==> pip ok -> yes
2023-04-20 07:39:39,435 - octoprint.plugins.softwareupdate - INFO - Minimum free storage across all update relevant locations is 9.7GB. That is considered sufficient for updating.
2023-04-20 07:39:39,681 - octoprint.plugins.stlviewer - INFO - STL Viewer loaded!
2023-04-20 07:53:59,784 - octoprint.server.heartbeat - INFO - Server heartbeat <3

Ports:
Netid       State        Recv-Q       Send-Q             Local Address:Port               Peer Address:Port
udp         UNCONN       0            0                   192.168.0.28:5353                    0.0.0.0:*           users:(("octoprint",pid=395,fd=6))
udp         UNCONN       0            0                        0.0.0.0:5353                    0.0.0.0:*           users:(("octoprint",pid=395,fd=5))
udp         UNCONN       0            0                        0.0.0.0:1900                    0.0.0.0:*           users:(("octoprint",pid=395,fd=19))
tcp         LISTEN       0            128                    127.0.0.1:5000                    0.0.0.0:*           users:(("octoprint",pid=395,fd=4))
tcp         LISTEN       0            128                      0.0.0.0:22                      0.0.0.0:*           users:(("sshd",pid=683,fd=3))
tcp         LISTEN       0            128                         [::]:22                         [::]:*           users:(("sshd",pid=683,fd=4))


No connection because the printer is off. When the printer is on the octoprint service connect to it.
Any help?

Are you running haproxy ? is that service running? If you are not, you might find OctoPrint on port 5000 at local host anyway. Might just be that your haproxy service is not running.

You are running OctoPrint with --host 127.0.0.1, so without a proxy or something else in front of it you won't be able to access it outside of the Pi.

It looks like an OctoPi install? If so it must be a quite old version as this is implying:

This hasn't been used in OctoPi for years, instead they use systemd these days.

I tried on 5000 port and no response.
Haproxy - I have, no running:

~#service haproxy stop
root@octopi:~#service octoprint stop
root@octopi:~#service haproxy start
Job for haproxy.service failed because the control process exited with error code.
See "systemctl status haproxy.service" and "journalctl -xe" for details.
root@octopi:~#systemctl status haproxy.service
● haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2023-04-20 18:27:19 BST; 7s ago
     Docs: man:haproxy(1)
           file:/usr/share/doc/haproxy/configuration.txt.gz
  Process: 11903 ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=127)

Apr 20 18:27:19 octopi systemd[1]: haproxy.service: Service RestartSec=100ms expired, scheduling restart.
Apr 20 18:27:19 octopi systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 5.
Apr 20 18:27:19 octopi systemd[1]: Stopped HAProxy Load Balancer.
Apr 20 18:27:19 octopi systemd[1]: haproxy.service: Start request repeated too quickly.
Apr 20 18:27:19 octopi systemd[1]: haproxy.service: Failed with result 'exit-code'.
Apr 20 18:27:19 octopi systemd[1]: Failed to start HAProxy Load Balancer.

Anyway I don't use haproxy by myself - is it a part of octoprint?
The general idea - it was working for months and I had 2-3 weeks off and I opened www page and got no response. That's all history.

You are running OctoPrint with --host 127.0.0.1, so without a proxy or something else in front of it you won't be able to access it outside of the Pi.

Not sure:

Nmap scan report for localhost (127.0.0.1)
PORT   STATE  SERVICE
80/tcp closed http
443/tcp closed https
5000/tcp open  upnp

on "wget 127.0.0.1:5000" I got www page I guess it is login to octoprint.

Next step:
./octoprint --host 192.168.0.28
and I got:

2023-04-20 18:45:09,159 - octoprint.server - INFO - Listening on http://192.168.0.28:5000

And I can connect via firefox on 5000 port :))
Is there a config file where I can change it permanent?
And - why i changed?!?
Thank you for your help.

go to /var/log and look at haproxy.log and see what the actual error is. it shows haproxy isn't running, and is dying due to an error.

It is part of the OctoPi image, not OctoPrint, and runs infront of OctoPrint so that it is accessible on port 80, rather than 5000.

You've run that for localhost..... That means the Pi itself. This is how OctoPrint is often configured to run, so that it is only accessible through the proxy.

You don't want to use --host with your IP address, if you really want to be able to access OctoPrint via port 5000 (which is really a workaround, not fixing your issue), then one could use --host 0.0.0.0.

You've not really shared any details about your setup or how it was installed in the first place - it is somewhat different to a stock OctoPi image, so I don't know what to suggest to you in terms of configuration or what might have changed. None of the Python 3 OctoPi images used /etc/init.d files to start OctoPrint, they have been systemd services for a while now, so something about your setup does not match up.

/var/log
several lines like:

Apr 20 05:36:08 octopi haproxy[699]: /usr/sbin/haproxy: symbol lookup error: /usr/sbin/haproxy: undefined symbol: bit
Apr 20 07:13:22 octopi haproxy[637]: /usr/sbin/haproxy: symbol lookup error: /usr/sbin/haproxy: undefined symbol: ms_left_sca,ed
Apr 20 07:13:23 octopi haproxy[691]: /usr/sbin/haproxy: symbol lookup error: /usr/sbin/haproxy: undefined symbol: ms_left_sca,ed

You've not really shared any details about your setup or how it was installed in the first place

Because I don't know what to say. It was installed from OctoPi image but I don't know when, because last time my sdcard was dead and I restored it from my backup (I have several services on that RPI, not only OctoPi).
The error in log seems for me as a malfunction - I reinstalled haproxy:

apt-get install haproxy --reinstall
service haproxy start

and it started, and I can connect on normal IP address.
I start to think my sdcard is falling again and it is not a nice thing - I replaced it a little like 4 months ago.
Thank for your help - it is working now.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.