UI does not connect to Klipper - Please check if the Klipper service is running and an UDS (Unix Domain Socket) is configured #261

Closed
opened 2022-11-09 11:28:11 +01:00 by ilium007 · 15 comments
ilium007 commented 2022-11-09 11:28:11 +01:00 (Migrated from github.com)

Linux Distribution

Raspbian GNU/Linux 11 (bullseye)

What happened

Installed Klipper / Moonraker / Mainsail but cannot connected to KLipper and UI hangs.

Please check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.

image

/home/xxxx/printer_data/systemd/klipper.env

KLIPPER_ARGS="/home/xxxx/klipper/klippy/klippy.py /home/xxxx/printer_data/config/printer.cfg -I /home/xxxx/printer_data/comms/klippy.serial -l /home/xxxx/printer_data/logs/klippy.log -a /home/xxxx/printer_data/comms/klippy.sock"

When I manually start via line below the UI connects:

xxxx@rpi01:~/printer_data/systemd $ ~/klippy-env/bin/python ~/klipper/klippy/klippy.py ~/printer_data/config/printer.cfg -a /tmp/klippy_uds -l /tmp/klippy.log

I don't know why the default /home/xxxx/printer_data/systemd/klipper.env file has a -I argument.

What did you expect to happen

Expected a working UI

How to reproduce

Default kiauh install

Additional information

No response

### Linux Distribution Raspbian GNU/Linux 11 (bullseye) ### What happened Installed Klipper / Moonraker / Mainsail but cannot connected to KLipper and UI hangs. `Please check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.` <img width="511" alt="image" src="https://user-images.githubusercontent.com/732766/200805672-858dcd58-b07e-4d33-9517-1b7ce465e325.png"> /home/xxxx/printer_data/systemd/klipper.env `KLIPPER_ARGS="/home/xxxx/klipper/klippy/klippy.py /home/xxxx/printer_data/config/printer.cfg -I /home/xxxx/printer_data/comms/klippy.serial -l /home/xxxx/printer_data/logs/klippy.log -a /home/xxxx/printer_data/comms/klippy.sock"` When I manually start via line below the UI connects: `xxxx@rpi01:~/printer_data/systemd $ ~/klippy-env/bin/python ~/klipper/klippy/klippy.py ~/printer_data/config/printer.cfg -a /tmp/klippy_uds -l /tmp/klippy.log` I don't know why the default /home/xxxx/printer_data/systemd/klipper.env file has a `-I` argument. ### What did you expect to happen Expected a working UI ### How to reproduce Default kiauh install ### Additional information _No response_
dw-0 commented 2022-11-09 13:14:10 +01:00 (Migrated from github.com)

So what is the KAIUH bug here? I see Mainsail working, i see Moonraker probably working. So there might be an issue configuring Klipper. klippy.sock is the new name for the UDS and its configured. klippy.serial (with the -I argument) is the new name for /tmp/printer.

So what is the KAIUH bug here? I see Mainsail working, i see Moonraker probably working. So there might be an issue configuring Klipper. klippy.sock is the new name for the UDS and its configured. klippy.serial (with the -I argument) is the new name for /tmp/printer.
ilium007 commented 2022-11-10 05:48:29 +01:00 (Migrated from github.com)

So this was a Kiauh install on a brand new Raspberry Pi OS Lite. Kiauh was deployed in the home directory as per the instructions on the GitHub page and Klipper, Moonraker and Mainsail installed from Kiauh. When I went looking at possible solutions I ran Klipper manually specifying the Unix socket in the /tmp sir I posted above. This allowed Moonraker to connect to Klipper and everything worked in Mainsail. I then went back and changed the /home/xxxx/printer_data/systemd/klipper.env file to put the Unix socket file in /tmp and then restarted the Klipper service and it worked fine.

I assume there is an issue running the Unix socket file in my home directory (permissions related maybe) but haven’t looked further for a solution.

So to answer your question, “ So what is the KAIUH bug here?”, I am not sure but a fresh Rasp Pi OS install and fresh Kiauh install, fresh Klipper, Moonraker and Mainsail install and Klipper wouldn’t start because of the Unix socket file location.

So this was a Kiauh install on a brand new Raspberry Pi OS Lite. Kiauh was deployed in the home directory as per the instructions on the GitHub page and Klipper, Moonraker and Mainsail installed from Kiauh. When I went looking at possible solutions I ran Klipper manually specifying the Unix socket in the /tmp sir I posted above. This allowed Moonraker to connect to Klipper and everything worked in Mainsail. I then went back and changed the /home/xxxx/printer_data/systemd/klipper.env file to put the Unix socket file in /tmp and then restarted the Klipper service and it worked fine. I assume there is an issue running the Unix socket file in my home directory (permissions related maybe) but haven’t looked further for a solution. So to answer your question, “ So what is the KAIUH bug here?”, I am not sure but a fresh Rasp Pi OS install and fresh Kiauh install, fresh Klipper, Moonraker and Mainsail install and Klipper wouldn’t start because of the Unix socket file location.
dw-0 commented 2022-11-10 10:04:32 +01:00 (Migrated from github.com)

I am not sure but a fresh Rasp Pi OS install and fresh Kiauh install, fresh Klipper, Moonraker and Mainsail install and Klipper wouldn’t start because of the Unix socket file location

I tried to reproduce that issue, but wasn't able to. I flashed a fresh copy of Raspberry Pi OS Lite with the Raspberry Pi Imager to the SD card, put it in my Rpi Zero and installed Klipper, Moonraker and Mainsail in that order. No issues here. All services running fine as they are supposed to be:
image

If there would be an issue anywhere, i would already encountered it tbh. I usually do some quite extensive testing before i release bigger changes to the public.

> I am not sure but a fresh Rasp Pi OS install and fresh Kiauh install, fresh Klipper, Moonraker and Mainsail install and Klipper wouldn’t start because of the Unix socket file location I tried to reproduce that issue, but wasn't able to. I flashed a fresh copy of Raspberry Pi OS Lite with the Raspberry Pi Imager to the SD card, put it in my Rpi Zero and installed Klipper, Moonraker and Mainsail in that order. No issues here. All services running fine as they are supposed to be: ![image](https://user-images.githubusercontent.com/31533186/201047215-b1978d0b-0c62-4df5-82a3-79957af1e90f.png) If there would be an issue anywhere, i would already encountered it tbh. I usually do some quite extensive testing before i release bigger changes to the public.
ilium007 commented 2022-11-10 11:13:39 +01:00 (Migrated from github.com)

Thanks for taking to time to look into this. The only difference I can see is that I am not using the 'pi' user, I created a named user to run under.

Thanks for taking to time to look into this. The only difference I can see is that I am not using the 'pi' user, I created a named user to run under.
dw-0 commented 2022-11-10 11:20:00 +01:00 (Migrated from github.com)

That shouldn't matter. The script is written, that it uses the current username, no matter if it's called pi or anything else.

You should also have a look at the klippy.log. Usually klipper starts fine without the UDS, if the UDS is missing, it is usually Moonraker which is complaining, as it requires the UDS to exist.

That shouldn't matter. The script is written, that it uses the current username, no matter if it's called `pi` or anything else. You should also have a look at the klippy.log. Usually klipper starts fine without the UDS, if the UDS is missing, it is usually Moonraker which is complaining, as it requires the UDS to exist.
ilium007 commented 2022-11-10 11:27:16 +01:00 (Migrated from github.com)

Reinstalling now

Reinstalling now
ilium007 commented 2022-11-10 11:29:14 +01:00 (Migrated from github.com)

That shouldn't matter. The script is written, that it uses the current username, no matter if it's called pi or anything else.

You should also have a look at the klippy.log. Usually klipper starts fine without the UDS, if the UDS is missing, it is usually Moonraker which is complaining, as it requires the UDS to exist.

I just think its strange that when I change the location of the Unix socket in the /home/xxxx/printer_data/systemd/klipper.env file and put the Unix socket in /tmp it all works

> That shouldn't matter. The script is written, that it uses the current username, no matter if it's called `pi` or anything else. > > You should also have a look at the klippy.log. Usually klipper starts fine without the UDS, if the UDS is missing, it is usually Moonraker which is complaining, as it requires the UDS to exist. I just think its strange that when I change the location of the Unix socket in the /home/xxxx/printer_data/systemd/klipper.env file and put the Unix socket in /tmp it all works
dw-0 commented 2022-11-10 11:37:50 +01:00 (Migrated from github.com)

You don't need to manually put the socket file anywhere. It gets created during runtime. If it doesn't exist, Klipper should create it itself during start

You don't need to manually put the socket file anywhere. It gets created during runtime. If it doesn't exist, Klipper should create it itself during start
ilium007 commented 2022-11-10 11:40:08 +01:00 (Migrated from github.com)

I understand this. I'm saying that if I change the location of the socket file from the user home directory ~/printer_data/xxxx in the service config to /tmp/klipper_uds and restart the UDS file is created and it all works.

I understand this. I'm saying that if I change the location of the socket file from the user home directory ~/printer_data/xxxx in the service config to /tmp/klipper_uds and restart the UDS file is created and it all works.
dw-0 commented 2022-11-10 11:42:40 +01:00 (Migrated from github.com)

Okay. Im not sure why it's not working. I will re-flash the SD card and will use a custom name, something different than 'pi' and see what happens.

Okay. Im not sure why it's not working. I will re-flash the SD card and will use a custom name, something different than 'pi' and see what happens.
ilium007 commented 2022-11-10 11:43:38 +01:00 (Migrated from github.com)

Don't waste any more of your time. The issue must be on my end. I'll keep looking.

Don't waste any more of your time. The issue must be on my end. I'll keep looking.
dw-0 commented 2022-11-10 11:46:58 +01:00 (Migrated from github.com)

Writing the image is pretty fast. Installing all the stuff on a Pi Zero with its weak Wifi and poor performance is the bigger pain, but that doesn't matter ^^ I just let it run and do its thing. I want to make sure that its no issue with a non-pi username (although i can't imagine it is - we'll see).

Writing the image is pretty fast. Installing all the stuff on a Pi Zero with its weak Wifi and poor performance is the bigger pain, but that doesn't matter ^^ I just let it run and do its thing. I want to make sure that its no issue with a non-pi username (although i can't imagine it is - we'll see).
ilium007 commented 2022-11-10 11:48:02 +01:00 (Migrated from github.com)

I have found it... issue was on my end. My old moonraker.conf file was missing the config line:

klippy_uds_address: /home/pi/printer_data/comms/klippy.sock

This must not have been there in the last version of Klipper I had installed from around Oct 2021.

Apologies.

I have found it... issue was on my end. My old moonraker.conf file was missing the config line: `klippy_uds_address: /home/pi/printer_data/comms/klippy.sock` This must not have been there in the last version of Klipper I had installed from around Oct 2021. Apologies.
dw-0 commented 2022-11-10 11:51:32 +01:00 (Migrated from github.com)

Ohhh okay. That was something that hasn't come to my mind. Good catch. Thanks for clearing it up! So i can close this issue, right? All working?

Ohhh okay. That was something that hasn't come to my mind. Good catch. Thanks for clearing it up! So i can close this issue, right? All working?
ilium007 commented 2022-11-10 11:52:04 +01:00 (Migrated from github.com)

All good. Again, apologies for causing you work.

All good. Again, apologies for causing you work.
Sign in to join this conversation.