Solved Can't login as user after system upgrade

rockzombie2

Member

Reaction score: 15
Messages: 38

Hello again! I hope to one day become a venerable FreeBSD admin but until then, I come humbly to the forums seeking knowledge!

So I was trying to build chromium but was running into a compile error that seemed kind of odd, since it didn't seem related to a missing package or a mis-configuration. It was something like "TypeError: expected bytes-like object, not 'str'".

I decided to try and upgrade my system because why not; maybe it'll magically fix the error. I remembered upgrading from 11 to 12 was easier and smoother than I expected so I followed the steps listed on the release notes to upgrade to 13. I reboot and then I can't startx to my desktop because of a kernel error or something, so I figured I needed to recompile nvidia-drivers. The release notes mentioned recompiling your applications before freebsd-update installing again so I did that and a few other applications before restarting again (I don't remember exactly, but I think I restarted twice in that order).

Now, when I try to login, I'm prompted for my login and password, I provide it and then I see the login message... followed by a prompt for my login and password. I keep attempting to login, but it keeps asking for my login and password.

Luckily, I am still able to login as root and I can even startx into my desktop just fine, which is how I'm writing this post. So any ideas what could be going on here? I don't see any errors in dmesg, really.
 

Vull

Aspiring Daemon

Reaction score: 518
Messages: 821

You might have a bad or corrupted passwd file after the upgrade.

Please login as root and run these commands (from your desktop, so you can copy and paste):
grep username /etc/passwd
ls -l /etc/passwd /etc/master.passwd /var/backups/master.passwd.bak

... after substituting your problem user name for "username". Then copy and paste the output.
 

grahamperrin

Son of Beastie

Reaction score: 810
Messages: 2,622

… DWM as my window manager. …

– long ago, but still enough for me to assume that SDDM is not currently in the mix; that a different display manager or (GUI) login manager is in use, and not behaving as expected.
 

Geezer

Aspiring Daemon

Reaction score: 447
Messages: 761

Now, when I try to login, I'm prompted for my login and password, I provide it and then I see the login message... followed by a prompt for my login and password. I keep attempting to login, but it keeps asking for my login and password.
which is how I'm writing this post. So any ideas what could be going on here? I don't see any errors in dmesg, really.

It does not sound like a problem with the desktop manager. Possibly the desktop environment is not starting properly, and dropping you back into the DM.

Luckily, I am still able to login as root and I can even startx into my desktop just fine, which is how I'm writing this post. So any ideas what could be going on here? I don't see any errors in dmesg, really.

No, don't start a DE as root. You should be an ordinary user in the video group.
 

Argentum

Aspiring Daemon

Reaction score: 296
Messages: 623

Luckily, I am still able to login as root and I can even startx into my desktop just fine, which is how I'm writing this post. So any ideas what could be going on here? I don't see any errors in dmesg, really.
Log in as root and try to change your other user password. Will probably fix your issue.

passwd(1)
 
OP
rockzombie2

rockzombie2

Member

Reaction score: 15
Messages: 38

Log in as root and try to change your other user password. Will probably fix your issue.

passwd(1)
I should note that this was the first thing I tried but with the same results.
It does not sound like a problem with the desktop manager. Possibly the desktop environment is not starting properly, and dropping you back into the DM.
Not sure what the DM is (desktop manager?), but this sounds right, I think. I don't have SDDM and do still use DWM.
Now, when I try to login, I'm prompted for my login and password, I provide it and then I see the login message... followed by a prompt for my login and password. I keep attempting to login, but it keeps asking for my login and password.
Let me be explicitly clear and mention this is all happening from the terminal, immediately after boot. My normal startup procedure involves logging in and then running startx from the terminal.

You might have a bad or corrupted passwd file after the upgrade.
I will try this soon...
 
OP
rockzombie2

rockzombie2

Member

Reaction score: 15
Messages: 38

Oct 16 23:08:23 nzxt doas[96191]: chris ran command portsnap fetch as root from /usr/ports
Oct 16 23:11:08 nzxt doas[96643]: chris ran command make config as root from /usr/ports/x11/nvidia-driver
Oct 16 23:11:25 nzxt doas[96684]: chris ran command make deinstall as root from /usr/ports/x11/nvidia-driver
Oct 16 23:11:29 nzxt doas[96723]: chris ran command make install as root from /usr/ports/x11/nvidia-driver
Oct 16 23:12:41 nzxt doas[97658]: chris ran command kldload nvidia as root from /usr/home/chris
Oct 16 23:15:13 nzxt doas[97715]: chris ran command nvim /usr/local/share/X11/xorg.conf.d as root from /usr/home/chris
Oct 16 23:17:32 nzxt doas[97878]: chris ran command freebsd-update install as root from /usr/home/chris
Oct 16 23:17:43 nzxt doas[99156]: chris ran command shutdown -r now as root from /usr/home/chris
Oct 16 23:17:43 nzxt shutdown[99157]: reboot by chris:
Oct 16 23:17:43 nzxt sshd[1704]: Received signal 15; terminating.
Oct 16 23:20:04 nzxt sshd[1761]: Server listening on :: port 22.
Oct 16 23:20:04 nzxt sshd[1761]: Server listening on 0.0.0.0 port 22.
Oct 16 23:20:08 nzxt login[1782]: login on ttyv0 as chris
Oct 16 23:20:43 nzxt login[1791]: login on ttyv0 as chris
Oct 16 23:20:52 nzxt login[1793]: login on ttyv0 as chris
Oct 16 23:21:00 nzxt login[1795]: login on ttyv0 as root
Oct 16 23:21:00 nzxt login[1795]: ROOT LOGIN (root) ON ttyv0
Oct 16 23:23:31 nzxt login[1858]: login on ttyv0 as chris
Oct 16 23:23:44 nzxt login[1860]: login on ttyv0 as chris
Oct 16 23:24:04 nzxt login[1862]: login on ttyv0 as root
Oct 16 23:24:04 nzxt login[1862]: ROOT LOGIN (root) ON ttyv0
Oct 16 23:33:06 nzxt doas[2131]: root ran command nvim /etc/rc.conf as root from /usr/home/chris
Oct 16 23:45:53 nzxt login[2968]: login on ttyv0 as chris
Oct 16 23:46:21 nzxt login[2970]: login on ttyv0 as root
Oct 16 23:46:21 nzxt login[2970]: ROOT LOGIN (root) ON ttyv0
Oct 17 09:23:31 nzxt sshd[1761]: Received signal 15; terminating.
Oct 17 10:57:00 nzxt sshd[1761]: Server listening on :: port 22.
Oct 17 10:57:00 nzxt sshd[1761]: Server listening on 0.0.0.0 port 22.
Oct 17 10:57:25 nzxt login[1782]: login on ttyv0 as chris
Oct 17 10:57:31 nzxt login[1791]: login on ttyv0 as root
Oct 17 10:57:31 nzxt login[1791]: ROOT LOGIN (root) ON ttyv0
 
OP
rockzombie2

rockzombie2

Member

Reaction score: 15
Messages: 38

You might have a bad or corrupted passwd file after the upgrade.

Please login as root and run these commands (from your desktop, so you can copy and paste):
grep username /etc/passwd
ls -l /etc/passwd /etc/master.passwd /var/backups/master.passwd.bak

... after substituting your problem user name for "username". Then copy and paste the output.

root@nzxt:~ # grep chris /etc/passwd
chris:*:1001:1001:Christofer Padilla:/home/chris:/usr/local/bin/fish
root@nzxt:~ # ls -l /etc/passwd /etc/master.passwd /var/backups/master.passwd.bak
-rw------- 1 root wheel 3153 Oct 16 23:45 /etc/master.passwd
-rw-r--r-- 1 root wheel 2722 Oct 16 23:45 /etc/passwd
-rw------- 1 root wheel 3153 Oct 16 23:45 /var/backups/master.passwd.bak
 
OP
rockzombie2

rockzombie2

Member

Reaction score: 15
Messages: 38

Not sure what that did, but it didn't fix the login issue.

Now that I think about it, the passwords do seem to work, because if I type in a wrong password, it'll say invalid login. This is after I changed my user password, so I would imagine it's some kind of startup process/daemon failing that's booting me back to login. Also, I do see the post-login message so that at least runs before it kicks me back to login. Not sure if that helps or provides any more useful information.
 
OP
rockzombie2

rockzombie2

Member

Reaction score: 15
Messages: 38

tunefs -p / says tunefs: /: could not open special device

I restarted in single user mode and ran fsck -fy but there was no output returned from it, so I assume it worked.
 

monwarez

Active Member

Reaction score: 64
Messages: 152

Just to be sure, are you using a non complex login system ?
What I mean by that: is this non kerberos login ? Is there multiple step to authenticate ? (Like is there some pam configuration for gnome-keyring, or maybe some pam configuration to decrypt the $HOME folder ?)
 
OP
rockzombie2

rockzombie2

Member

Reaction score: 15
Messages: 38

root@nzxt:~ # zpool status -v
pool: zroot
state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(5) for details.
config:

NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
ada2p4.eli ONLINE 0 0 0

errors: No known data errors
So I should run zpool upgrade?
 

grahamperrin

Son of Beastie

Reaction score: 810
Messages: 2,622

So I should run zpool upgrade?

It's not necessary at this time.

Has the pool never been scrubbed?

As a comparison:

Code:
root@mowa219-gjp4-8570p-freebsd:~ # zpool status -v august
  pool: august
 state: ONLINE
  scan: scrub repaired 0B in 02:45:23 with 0 errors on Thu Sep 16 05:48:48 2021
config:

        NAME                STATE     READ WRITE CKSUM
        august              ONLINE       0     0     0
          ada0p3.eli        ONLINE       0     0     0
        cache
          gpt/cache-august  ONLINE       0     0     0
          gpt/duracell      ONLINE       0     0     0

errors: No known data errors
root@mowa219-gjp4-8570p-freebsd:~ #
 

Vull

Aspiring Daemon

Reaction score: 518
Messages: 821

IVull and all: what next?
I was going to suggest pwd_mkdb -p /etc/master.passwd but you already suggested it.

I'd follow up on that by running passwd chris from the root login, just to make double-sure that everything in the database was up to date and syncronized, then try to login as chris from the text login on a virtual terminal again. If that doesn't work, I'm pretty much out of ideas.
 
OP
rockzombie2

rockzombie2

Member

Reaction score: 15
Messages: 38

I'm so dumb.

After rebooting and trying to login as chris, I carefully read the login message to make sure I wasn't missing anything and sure enough, I was.
ld-elf.so.1: Shared object 'libncurses.so.8' not found, required by 'fish'
So I guess the question is how do I install it for the user as root? Alternatively, I guess I could change the shell to login and install the missing packages as the user (need instructions on how to do this too, please).
 
Top