dw-0 / kiauh

Klipper Installation And Update Helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KlipperScreen did not start after install

shodanx2 opened this issue · comments

Linux Distribution

debian

What happened

Installed klipperscreen via kiaut, install appears successful but it did not start

image

Now I can't seem to find the control to try and restart it

What did you expect to happen

klipperscreen starts

How to reproduce

Install klipperscreen via kiauth

Additional information

No response

Ran

systemctl list-unit-files --type service -all | grep -i scr

To find the name of the process

image

Then ran

systemctl start KlipperScreen

to start the process

image

Still does not appear to work

image

I restart the computer, nochange

Ran kiauth.sh again, this time did the update (it wasn't very old but I don't update unnecessarily because updates break things)

Removed klipperscreen

image

re-Installed klipperscreen

image

image

image

Still the error

[✓ OK] KlipperScreen successfully installed!
find: ‘’: No such file or directory

###### Restart KlipperScreen.service ...

Further investigating this today

I've completely wiped this computer with fresh debian 12 and re-installed Kiauth

So it seems the X server is not starting when run

Here's the journalctl -f

Jan 31 16:48:53 klippa KlipperScreen-start.sh[2198]:  for help.
Jan 31 16:48:53 klippa KlipperScreen-start.sh[2198]: (EE) Please also check the log file at "/home/user/.local/share/xorg/Xorg.0.log" for additional information.
Jan 31 16:48:53 klippa KlipperScreen-start.sh[2198]: (EE)
Jan 31 16:48:53 klippa KlipperScreen-start.sh[2198]: (EE) Server terminated with error (1). Closing log file.
Jan 31 16:49:08 klippa KlipperScreen-start.sh[2197]: /usr/bin/xinit: giving up
Jan 31 16:49:08 klippa KlipperScreen-start.sh[2197]: /usr/bin/xinit: unable to connect to X server: Connection refused
Jan 31 16:49:08 klippa KlipperScreen-start.sh[2197]: /usr/bin/xinit: server error
Jan 31 16:49:08 klippa systemd[1]: KlipperScreen.service: Main process exited, code=exited, status=1/FAILURE
Jan 31 16:49:08 klippa systemd[1]: KlipperScreen.service: Failed with result 'exit-code'.
Jan 31 16:49:09 klippa systemd[1]: KlipperScreen.service: Scheduled restart job, restart counter is at 26.
Jan 31 16:49:09 klippa systemd[1]: Stopped KlipperScreen.service - KlipperScreen.
Jan 31 16:49:09 klippa systemd[1]: Started KlipperScreen.service - KlipperScreen.
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2215]: Running KlipperScreen on X in display :0 by default
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: X.Org X Server 1.21.1.7
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: X Protocol Version 11, Revision 0
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: Current Operating System: Linux klippa 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-1 (2023-07-14) x86_64
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-10-amd64 root=UUID=5a8cce30-4f3c-4aa7-a7f2-1ba62ba92cf2 ro quiet
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: xorg-server 2:21.1.7-3+deb12u5 (https://www.debian.org/support)
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: Current version of pixman: 0.42.2
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]:         Before reporting problems, check http://wiki.x.org
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]:         to make sure that you have the latest version.
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: Markers: (--) probed, (**) from config file, (==) default setting,
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]:         (++) from command line, (!!) notice, (II) informational,
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]:         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (==) Log file: "/home/user/.local/share/xorg/Xorg.0.log", Time: Wed Jan 31 16:49:09 2024
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (==) Using system config directory "/usr/share/X11/xorg.conf.d"
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (EE)
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: Fatal server error:
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (EE)
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (EE)
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: Please consult the The X.Org Foundation support
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]:          at http://wiki.x.org
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]:  for help.
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (EE) Please also check the log file at "/home/user/.local/share/xorg/Xorg.0.log" for additional information.
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (EE)
Jan 31 16:49:09 klippa KlipperScreen-start.sh[2219]: (EE) Server terminated with error (1). Closing log file.

So the main error is

(EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)

Here is the full xorg log

X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
[   769.923] Current Operating System: Linux klippa 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-1 (2023-07-14) x86_64
[   769.923] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-10-amd64 root=UUID=5a8cce30-4f3c-4aa7-a7f2-1ba62ba92cf2 ro quiet
[   769.923] xorg-server 2:21.1.7-3+deb12u5 (https://www.debian.org/support)
[   769.923] Current version of pixman: 0.42.2
[   769.923]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[   769.923] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   769.923] (==) Log file: "/home/user/.local/share/xorg/Xorg.0.log", Time: Wed Jan 31 16:54:50 2024
[   769.923] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   769.924] (==) No Layout section.  Using the first Screen section.
[   769.924] (==) No screen section available. Using defaults.
[   769.924] (**) |-->Screen "Default Screen Section" (0)
[   769.924] (**) |   |-->Monitor "<default monitor>"
[   769.924] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[   769.924] (==) Automatically adding devices
[   769.924] (==) Automatically enabling devices
[   769.924] (==) Automatically adding GPU devices
[   769.924] (==) Automatically binding GPU devices
[   769.924] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   769.924] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[   769.924]    Entry deleted from font path.
[   769.924] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[   769.924]    Entry deleted from font path.
[   769.924] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[   769.924]    Entry deleted from font path.
[   769.924] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[   769.924]    Entry deleted from font path.
[   769.924] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[   769.924]    Entry deleted from font path.
[   769.924] (==) FontPath set to:
        /usr/share/fonts/X11/misc,
        /usr/share/fonts/X11/Type1,
        built-ins
[   769.924] (==) ModulePath set to "/usr/lib/xorg/modules"
[   769.924] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[   769.924] (II) Loader magic: 0x55f7ad134f00
[   769.924] (II) Module ABI versions:
[   769.924]    X.Org ANSI C Emulation: 0.4
[   769.924]    X.Org Video Driver: 25.2
[   769.924]    X.Org XInput driver : 24.4
[   769.924]    X.Org Server Extension : 10.0
[   769.927] (--) using VT number 2

[   769.927] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[   769.928] (II) xfree86: Adding drm device (/dev/dri/card0)
[   769.928] (II) Platform probe for /sys/devices/pci0000:00/0000:00:02.0/drm/card0
[   769.935] (--) PCI:*(0@0:2:0) 8086:0a06:1ae0:c000 rev 11, Mem @ 0x86400000/4194304, 0x90000000/268435456, I/O @ 0x00001100/64, BIOS @ 0x????????/131072
[   769.935] (II) LoadModule: "glx"
[   769.935] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   769.937] (II) Module glx: vendor="X.Org Foundation"
[   769.937]    compiled for 1.21.1.7, module version = 1.0.0
[   769.937]    ABI class: X.Org Server Extension, version 10.0
[   769.937] (==) Matched modesetting as autoconfigured driver 0
[   769.937] (==) Matched fbdev as autoconfigured driver 1
[   769.937] (==) Matched vesa as autoconfigured driver 2
[   769.937] (==) Assigned the driver to the xf86ConfigLayout
[   769.937] (II) LoadModule: "modesetting"
[   769.937] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[   769.937] (II) Module modesetting: vendor="X.Org Foundation"
[   769.937]    compiled for 1.21.1.7, module version = 1.21.1
[   769.937]    Module class: X.Org Video Driver
[   769.937]    ABI class: X.Org Video Driver, version 25.2
[   769.937] (II) LoadModule: "fbdev"
[   769.938] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[   769.938] (II) Module fbdev: vendor="X.Org Foundation"
[   769.938]    compiled for 1.21.1.3, module version = 0.5.0
[   769.938]    Module class: X.Org Video Driver
[   769.938]    ABI class: X.Org Video Driver, version 25.2
[   769.938] (II) LoadModule: "vesa"
[   769.938] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so
[   769.938] (II) Module vesa: vendor="X.Org Foundation"
[   769.938]    compiled for 1.21.1.3, module version = 2.5.0
[   769.938]    Module class: X.Org Video Driver
[   769.938]    ABI class: X.Org Video Driver, version 25.2
[   769.938] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   769.938] (II) FBDEV: driver for framebuffer: fbdev
[   769.938] (II) VESA: driver for VESA chipsets: vesa
[   769.938] (EE)
Fatal server error:
[   769.938] (EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
[   769.938] (EE)
[   769.938] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[   769.938] (EE) Please also check the log file at "/home/user/.local/share/xorg/Xorg.0.log" for additional information.
[   769.938] (EE)
[   769.939] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[   769.939] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[   769.939] (EE) Server terminated with error (1). Closing log file.

First I'm going to check the user and the script's permissions

root@klippa:~# ps aux | grep -i klip
avahi        492  0.0  0.0   8292  3876 ?        Ss   16:42   0:00 avahi-daemon: running [klippa.local]
user         625  0.1  0.8 113484 31796 ?        Ssl  16:42   0:01 /home/user/klippy-env/bin/python /home/user/klipper/klippy/klippy.py /home/user/printer_1_data/config/printer.cfg -I /home/user/printer_1_data/comms/klippy.serial -l /home/user/printer_1_data/logs/klippy.log -a /home/user/printer_1_data/comms/klippy.sock
user         627  0.1  0.7 113484 30780 ?        Ssl  16:42   0:01 /home/user/klippy-env/bin/python /home/user/klipper/klippy/klippy.py /home/user/printer_2_data/config/printer.cfg -I /home/user/printer_2_data/comms/klippy.serial -l /home/user/printer_2_data/logs/klippy.log -a /home/user/printer_2_data/comms/klippy.sock
user         628  0.1  0.8 113484 32076 ?        Ssl  16:42   0:01 /home/user/klippy-env/bin/python /home/user/klipper/klippy/klippy.py /home/user/printer_3_data/config/printer.cfg -I /home/user/printer_3_data/comms/klippy.serial -l /home/user/printer_3_data/logs/klippy.log -a /home/user/printer_3_data/comms/klippy.sock
user         629  0.1  0.8 113484 32316 ?        Ssl  16:42   0:01 /home/user/klippy-env/bin/python /home/user/klipper/klippy/klippy.py /home/user/printer_4_data/config/printer.cfg -I /home/user/printer_4_data/comms/klippy.serial -l /home/user/printer_4_data/logs/klippy.log -a /home/user/printer_4_data/comms/klippy.sock
user         630  0.1  0.8 113484 31728 ?        Ssl  16:42   0:01 /home/user/klippy-env/bin/python /home/user/klipper/klippy/klippy.py /home/user/printer_5_data/config/printer.cfg -I /home/user/printer_5_data/comms/klippy.serial -l /home/user/printer_5_data/logs/klippy.log -a /home/user/printer_5_data/comms/klippy.sock
user         631  0.1  0.7 113484 30904 ?        Ssl  16:42   0:01 /home/user/klippy-env/bin/python /home/user/klipper/klippy/klippy.py /home/user/printer_6_data/config/printer.cfg -I /home/user/printer_6_data/comms/klippy.serial -l /home/user/printer_6_data/logs/klippy.log -a /home/user/printer_6_data/comms/klippy.sock
user        3142  0.0  0.0   6932  3224 ?        Ss   16:59   0:00 /bin/bash /home/user/KlipperScreen/scripts/KlipperScreen-start.sh
user        3145  0.0  0.0   6160  1324 ?        S    16:59   0:00 /usr/bin/xinit /home/user/.KlipperScreen-env/bin/python /home/user/KlipperScreen/screen.py
root        3162  0.0  0.0   6332  2108 pts/6    S+   16:59   0:00 grep -i klip
root@klippa:~# groups user
user : user tty dialout cdrom floppy sudo audio dip video plugdev users netdev bluetooth lpadmin scanner

So both KlipperScreen-start.sh and xinit run as user

and user has the permission to tty / dialout / video

Searching for "xf86OpenConsole: Cannot open virtual console 2 "

Leads to this reddit post about someone trying to install KlipperScreen

https://old.reddit.com/r/klippers/comments/uly2j6/cannot_open_virtual_console_2_and_any_commands_to/

They suggest running this command

root@klippa:~# cat /etc/X11/Xwrapper.config | grep allow
allowed_users=anybody

Ok, doesn't help, next the consensus of that thread is to add

needs_root_rights=yes

to

nano /etc/X11/Xwrapper.config

And immediately after saving this file klipper starts

Yet again, not running as root was the cause of all the problems !!

image

Problem solved for me thanks

(Well, touchscreen's not working but that's going to be a separate issue !)

Further notes:

As for the touchscreen, it was a bad microusb cable.

There is a permission somewhere that is wrong, I don't know where but

needs_root_rights=yes

which launches the x server as root

image

does fix it !

Can confirm. Have to do this every time when installing KlipperScreen on Ubuntu Server.

sudo bash -c "echo needs_root_rights=yes>>/etc/X11/Xwrapper.config"

That needs to be added to the install script.

commented

It looks like this issue has to be fixed by KlipperScreen. In case of KlipperScreen KIAUH is just executing KlipperScreens own install script: https://github.com/dw-0/kiauh/blob/master/scripts/klipperscreen.sh#L60

So please head over to the KlipperScreen repository and open an issue there, if there does not exist one already.