keybase / keybase-issues

A single repo for managing publicly recognized issues with the keybase client, installer, and website.
900 stars 37 forks source link

Keybase fails to upgrade via apt: “Unable to connect to X server” #4247

Closed TinaRussell closed 7 months ago

TinaRussell commented 8 months ago

I’m using Ubuntu MATE 24.04, and recently I tried to upgrade all my packages using sudo apt upgrade (well, I used sudo sh -c "apt update && apt upgrade -y && apt autoremove -y", but you get the idea). In the middle of the apt upgrade process, it was upgrading the Keybase package, and my computer ran out of space (not sure if this is relevant to the problem, but I’m including it in the interest of thoroughness). Bad, I know. The terminal showed two errors: “Unable to connect to X server”, and something to do with there being no space left on my device, and it showed these two errors over and over (alternating) until the process just hung. So, I cleared up some space, assuming that would solve the problem, but the process still wasn’t doing anything (just to be sure, I left it “going” all night, and by the morning there was no progress and no new error messages, it was just hung like before).

So, after that, I terminated all the apt-related processes (dangerous, I know) and decided to try finishing the upgrade, using sudo dpkg --configure -a. It immediately started “Setting up keybase (6.2.8-20240306193933.e38523abbe) ...” and then, after a bit, it spit out those error messages—not the ones about no disk space, since I’d cleared up some space, but the ones that said “Unable to connect to X server”. And then, it hung, just like before. I’ve tried it several times since (each time first having to terminate whichever process has the dpkg lock; again, dangerous, I know), and I get the same results every time: setting up Keybase, “Unable to connect to X server,” then nothing. The upgrade just won’t finish installing.

For background, I have keybase.list in my /etc/apt/sources.list.d/, and the entry reads deb http://prerelease.keybase.io/deb stable main. I’m using Ubuntu MATE 22.04 on a Compaq Presario CQ60. And, in case it helps, I recorded what happens if I enter sudo dpkg --debug=77777 --configure -a (the maximum debug level) when trying to finish the upgrade again, and first it says, D000001: ensure_diversions: new, (re)loading, then a bunch of stuff related to other packages on my system, and then:

D000001: process queue pkg keybase:amd64 queue.len 82 progress 21, try 1
D000040: checking dependencies of keybase:amd64 (- <none>)
D000400:   checking group ...
D000400:     checking possibility  -> libappindicator1
D000400:       not installed
D000400:         returning 0
D000400:      checking provider libayatana-appindicator1:amd64
D000400:       checking package libappindicator1 provided by pkg libayatana-appindicator1:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> fuse
D000400:       not installed
D000400:         returning 0
D000400:      checking provider fuse3:amd64
D000400:       checking package fuse provided by pkg fuse3:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libgconf-2-4
D000400:       checking non-provided pkg libgconf-2-4:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> psmisc
D000400:       checking non-provided pkg psmisc:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> lsof
D000400:       checking non-provided pkg lsof:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> procps
D000400:       checking non-provided pkg procps:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libasound2
D000400:       checking non-provided pkg libasound2:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libnss3
D000400:       checking non-provided pkg libnss3:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libxss1
D000400:       checking non-provided pkg libxss1:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libxtst6
D000400:       checking non-provided pkg libxtst6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libgtk-3-0
D000400:       checking non-provided pkg libgtk-3-0:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000040: ok 2 msgs >><<
D000040:     checking Breaks
Setting up keybase (6.2.8-20240306193933.e38523abbe) ...
D020000: trigproc_activate_packageprocessing pkg=keybase:amd64
D000002: fork/exec /var/lib/dpkg/info/keybase.postinst ( configure 6.2.4-20240101011938.ae7e4a1c15 )
Unable to connect to X server
Unable to connect to X server
Unable to connect to X server
Unable to connect to X server
Unable to connect to X server
Unable to connect to X server

…and then it just hangs, as always. Anyway, until I have this problem fixed, my whole apt packaging system is sort of in limbo. I mean, it can’t finish the upgrade process, and I have no idea what happens when you have a bunch of updates (including some kernel updates) and leave them half-configured, or in whatever state they’re in right now, for an extended amount of time… I’m scared! Please help, thanks!

TinaRussell commented 8 months ago

So, I figured out how to finish upgrading the other packages (the ones that hadn’t been fully upgraded because of how the Keybase package problem interrupted the upgrade process in the middle). First, I had to use sudo dpkg -C to list all the packages that were left in limbo. It listed packages in three categories: the packages that had been unpacked, but not configured; the one package (the Keybase package) that was listed as partially configured, in that the configuration process had been interrupted in the middle; and the packages that had been unpacked and configured but had triggers that hadn’t been run. What I had to do is use sudo dpkg --configure (followed by the name of the package) for each package in that first category, which was a huge pain, but thankfully it worked. (Sometimes I’d run into errors where dpkg couldn’t configure a package until another package in the list had been configured, so I’d have to mind the order in which I instructed dpkg to configure these packages. Now, I did discover that the order didn’t matter if you listed all the required packages in the same command, so I could’ve probably just used sudo dpkg --configure followed by the names of every package in that first category, but I guess I preferred doing it a little more peacemeal.) Thankfully, the first time I used sudo dpkg --configure to have it configure a package, it automatically ran the triggers for that third category of packages (unpacked, configured, but with triggers that hadn’t been run), so that wasn’t a problem.

Anyway, now that I’ve finished doing this, my system isn’t in quite as much of a scary limbo state, but Keybase still is. (For that matter, it’d be hard for me to install anything at this point, including things like security updates, until the matter of the Keybase upgrade is fixed.) I’ve tried it again and sudo dpkg --configure -a (or, for that matter, sudo dpkg --configure keybase) still hangs with six “Unable to connect to X server” errors. If anybody could help me figure out what’s going on, I’d be very grateful. Thank you!

TinaRussell commented 7 months ago

Hmmm, if I try running keybase ctl stop, to make sure Keybase is not currently running, and then use sudo dpkg --configure -a, something else happens:

Setting up keybase (6.2.8-20240306193933.e38523abbe) ...
mkdir: cannot stat ‘/keybase’: Transport endpoint is not connected
chown: cannot access '/keybase': Transport endpoint is not connected
chmod: cannot access '/keybase': Transport endpoint is not connected
dpkg: error processing package keybase (--configure):
 installed keybase package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 keybase

…and then it returns me to the command prompt, instead of hanging. So that’s… progress, I guess? But, it still doesn’t work. Hmmm…

TinaRussell commented 7 months ago

Okay, I think I finally got this working. Per the suggestion here, I tried using sudo fusermount -u /keybase and then sudo dpkg --configure -a, and the installation finished without any error messages. I think this is finally closed. (Whew!)