basecamp / omakub

Opinionated Ubuntu Setup
https://omakub.org
4.38k stars 357 forks source link

problem related to zellij when logging in after a fresh install #9

Closed lvnilesh closed 3 months ago

lvnilesh commented 3 months ago

Thank you for omakub.

This is a fresh install and I note this error

error found when loading .profile 

thread main panicked at zellij-client/src/os_input _output.rs:29.43 

could not get terminal attribute: ENOTTY 

as a result the session will not be configured correctly. You should fix the problem as soon as feasible.
dhh commented 3 months ago

Can you give some more details about your system? I haven't seen that one across everything I've looked at. Maybe @imsnif can help us figure out what's up.

iljo-dp commented 3 months ago

you are using ubuntu yes? because maybe a missing dependency? ENOTTY mean that there is an I/O control operation on an object that is not a terminal perhaps resource the .profile And reinstall zellij?

cargo install zellij --force

imsnif commented 3 months ago

Seems like Zellij is being launched without a controlling terminal. I'm not aware of the particulars of the environment here, but this can for example happen if Zellij is launched from within a background script.

Any context on when we get this error? Every time a terminal is launched, or?

imsnif commented 3 months ago

So, a guess for now after looking around the repo a bit: if the conditional generated by this command is placed in a bash file that gets invoked outside of the Zellij context in a script without a controlling terminal, this might be causing the error.

Since this setup comes pre-cooked with Alacritty, may I recommend having Alacritty launch Zellij directly rather than having it launched by bash? If my guess is correct this should resolve the issue.

This can be done like so in the Alacritty configuration:

[shell]
program = "zellij"
# args = ["-l", "welcome"] # optionally, if you'd like to start Zellij with a welcome screen to help manage sessions
dhh commented 3 months ago

We can definitely switch to that configuration, but there must be something else going on too. I've installed this setup on a bunch of machines, as have others, and not seen that error. But lemme try to switch over anyway!

dhh commented 3 months ago

Hmm, on second thoughts, don't love the idea of moving this into alacritty. Since if someone wanted to replace wezterm or kitty or whatever in its place, they'd have to deal with the zellij integration there too by hand.

Let's see if we can't find what the actual issue is here. Doesn't seem widespread. Can you share more about your setup @lvnilesh? Are you running this in a wm of some kind or?

lvnilesh commented 3 months ago

Issue is reproducible.

It happens once whenever I login after logout or when I login after a reboot.

Here is lspci:

00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) (rev 07)
00:02.0 Display controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630]
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
00:14.2 Signal processing controller: Intel Corporation 200 Series PCH Thermal Subsystem
00:16.0 Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
00:17.0 SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCI mode]
00:1c.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #1 (rev f0)
00:1c.4 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #5 (rev f0)
00:1c.6 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #7 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Z370 Chipset LPC/eSPI Controller
00:1f.2 Memory controller: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller
00:1f.3 Audio device: Intel Corporation 200 Series PCH HD Audio
00:1f.4 SMBus: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V
01:00.0 VGA compatible controller: NVIDIA Corporation GA104 [GeForce RTX 3070 Ti] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GA104 High Definition Audio Controller (rev a1)
03:00.0 USB controller: ASMedia Technology Inc. ASM2142/ASM3142 USB 3.1 Host Controller
04:00.0 Network controller: Intel Corporation Dual Band Wireless-AC 3168NGW [Stone Peak] (rev 10)

and lsusb:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 003: ID 095d:0005 Polycom, Inc. Polycom CX100
Bus 001 Device 004: ID 8087:0aa7 Intel Corp. Wireless-AC 3168 Bluetooth
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 2935:0006 Magewell USB Capture HDMI
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

and lscpu:

lscpu
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          39 bits physical, 48 bits virtual
  Byte Order:             Little Endian
CPU(s):                   12
  On-line CPU(s) list:    0-11
Vendor ID:                GenuineIntel
  Model name:             Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
    CPU family:           6
    Model:                158
    Thread(s) per core:   2
    Core(s) per socket:   6
    Socket(s):            1
    Stepping:             10
    CPU(s) scaling MHz:   95%
    CPU max MHz:          4700.0000
    CPU min MHz:          800.0000
    BogoMIPS:             7399.70
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl
                           xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rd
                          rand lahf_lm abm 3dnowprefetch cpuid_fault pti ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt
                          xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp vnmi md_clear flush_l1d arch_capabilities
Virtualization features:
  Virtualization:         VT-x
Caches (sum of all):
  L1d:                    192 KiB (6 instances)
  L1i:                    192 KiB (6 instances)
  L2:                     1.5 MiB (6 instances)
  L3:                     12 MiB (1 instance)
NUMA:
  NUMA node(s):           1
  NUMA node0 CPU(s):      0-11
Vulnerabilities:
  Gather data sampling:   Mitigation; Microcode
  Itlb multihit:          KVM: Mitigation: VMX disabled
  L1tf:                   Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
  Mds:                    Mitigation; Clear CPU buffers; SMT vulnerable
  Meltdown:               Mitigation; PTI
  Mmio stale data:        Mitigation; Clear CPU buffers; SMT vulnerable
  Reg file data sampling: Not affected
  Retbleed:               Mitigation; IBRS
  Spec rstack overflow:   Not affected
  Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
  Srbds:                  Mitigation; Microcode
  Tsx async abort:        Mitigation; TSX disabled

and I am using NVIDIA proprietary driver version 550.

dhh commented 3 months ago

@lvnilesh Try the suggestion to have alacritty start zellij directly instead of via bash.

lvnilesh commented 3 months ago

This diff seems to resolve the issue.

diff --git a/defaults/alacritty.toml b/defaults/alacritty.toml
index cdb16b7..0654095 100644
--- a/defaults/alacritty.toml
+++ b/defaults/alacritty.toml
@@ -11,3 +11,7 @@ opacity = 0.97
 bindings = [
 { key = "F11", action = "ToggleFullscreen" }
 ]
+
+[shell]
+program = "zellij"
+# args = ["-l", "welcome"] # optionally, if you'd like to start Zellij with a welcome screen to help manage sessions
diff --git a/defaults/bash/init b/defaults/bash/init
index f3fff3f..78c342d 100644
--- a/defaults/bash/init
+++ b/defaults/bash/init
@@ -1,5 +1,5 @@
 eval "$(rbenv init - bash)"
 eval "$(nodenv init -)"
 eval "$(zoxide init bash)"
-eval "$(zellij setup --generate-auto-start bash)"
+# eval "$(zellij setup --generate-auto-start bash)"
 source /usr/share/doc/fzf/examples/key-bindings.bash
dhh commented 3 months ago

Oh great! Then it probably is worth switching over. Wonder if it's specifically an nvidia issue. Anyone else hit it too on something else but nvidia?

stramec commented 3 months ago

Yep @dhh exactly the same error on boot, fresh install with Nvidia 4080. Zellij (and eza) are throwing errors. Everything else looks to work fine.

mphalliday commented 3 months ago

Have the same issue on an older desktop with an Nvida 1050 Ti ... no issues with my AMD framework. Loving this project @dhh 😍

kengggg commented 3 months ago

I confirm having the same issue on logging on after logging out and after restart. I'm on NVIDIA RTX 3090 using proprietary driver version 535.

dhh commented 3 months ago

Thanks for the confirmations! Seems to be an nvidia issue. But no matter, I'll make the change to route around it.

dhh commented 3 months ago

Should be fixed now. Run "omakub update" and restart the terminal.