UI does not connect to Klipper - Please check if the Klipper service is running and an UDS (Unix Domain Socket) is configured #261
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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./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.logI don't know why the default /home/xxxx/printer_data/systemd/klipper.env file has a
-Iargument.What did you expect to happen
Expected a working UI
How to reproduce
Default kiauh install
Additional information
No response
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 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.
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:

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.
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.
That shouldn't matter. The script is written, that it uses the current username, no matter if it's called
pior 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.
Reinstalling now
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
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
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.
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.
Don't waste any more of your time. The issue must be on my end. I'll keep looking.
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).
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.sockThis must not have been there in the last version of Klipper I had installed from around Oct 2021.
Apologies.
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?
All good. Again, apologies for causing you work.