I can login to GNOME, but Terminal and even TTY does not work

Something weird just happened after a reboot, where I cannot login even to a TTY, but I am logged in on GNOME.
I did not apply the latest update yet, in fact, I was trying to login to a TTY to update.

I tried using the login to the TTY but it’s just there hanging.
If I try to use something that uses VTE or even XTerm, it just hangs in there:

I did not change my .bashrc/.zshrc or .profile since the last time it was working.
Any ideas of what should I do to have access to a terminal again? I really need it to ssh to other machines and work.

no idea why this happens - but 2 ideas to test

  1. did you try the other way around, so - not ssh into other machines but ssh into this system ?

  2. what happens if you try this?
    To boot Manjaro into runlevel 3, you can modify the GRUB boot parameters. When the GRUB menu appears, press the ‘e’ key to edit the selected boot entry. Navigate to the line that starts with ‘linux’ and add ‘3’ at the end of the line, right before the word ‘quiet’ or any other parameters. After making the change, press Ctrl+x or F10 to boot into runlevel 3 (this is console only, no graphical interface)

However, there may be a dependency on another component that has been updated.
you could rename the files and check if it works then, so you might be able to circle if and which file is and then check which commands are stuck in it.

1 Like

Ok, apparently the problem is really one of them.

I managed to boot into runlevel 3 as @Zauberer-Merlin suggested and updated the system from there, however I still had the same problem with the terminals.
Then, I tried logging in as root in a TTY and it worked in a normal boot, but my user was still hanging after I typed my password.

Finally, I renamed my .bashrc and .zshrc and tried opening Terminal and it worked. So likely something there is causing the problem. Thank you for your help.

Now I need to figure out what exactly is going on.
First, I sourced my .bashrc and apart from some bash_completion stuff it works:

hmcezar-thinkpad% source .bashrc 
/usr/share/bash-completion/bash_completion:45: command not found: shopt
/usr/share/bash-completion/bash_completion:104: command not found: complete
/usr/share/bash-completion/bash_completion:107: command not found: complete
/usr/share/bash-completion/bash_completion:110: command not found: complete
/usr/share/bash-completion/bash_completion:113: command not found: complete
/usr/share/bash-completion/bash_completion:116: command not found: complete
/usr/share/bash-completion/bash_completion:119: command not found: complete
/usr/share/bash-completion/bash_completion:122: command not found: complete
/usr/share/bash-completion/bash_completion:125: command not found: complete
_comp_dequote__initialize:unset:5: no such hash table element: 
/usr/share/bash-completion/bash_completion:617: parse error near `&'
.bashrc:type:64: bad option: -P
.bashrc:105: command not found: shopt
.bashrc:107: command not found: shopt
.bashrc:112: command not found: shopt
(base) \[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\]

If I source the .zshrc then it starts and hangs:

(base) \[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\] source .zshrc_old 
Color escapes are \e[${value};...;${value}m
Values 30..37 are foreground colors
Values 40..47 are background colors
Value  1 gives a  bold-faced look

  \e[30m    TEXT BOLD  \e[30;41m TEXT BOLD  \e[30;42m TEXT BOLD  \e[30;43m TEXT BOLD  \e[30;44m TEXT BOLD  \e[30;45m TEXT BOLD  \e[30;46m TEXT BOLD  \e[30;47m TEXT BOLD

  \e[31m    TEXT BOLD  \e[31;41m TEXT BOLD  \e[31;42m TEXT BOLD  \e[31;43m TEXT BOLD  \e[31;44m TEXT BOLD  \e[31;45m TEXT BOLD  \e[31;46m TEXT BOLD  \e[31;47m TEXT BOLD

  \e[32m    TEXT BOLD  \e[32;41m TEXT BOLD  \e[32;42m TEXT BOLD  \e[32;43m TEXT BOLD  \e[32;44m TEXT BOLD  \e[32;45m TEXT BOLD  \e[32;46m TEXT BOLD  \e[32;47m TEXT BOLD

  \e[33m    TEXT BOLD  \e[33;41m TEXT BOLD  \e[33;42m TEXT BOLD  \e[33;43m TEXT BOLD  \e[33;44m TEXT BOLD  \e[33;45m TEXT BOLD  \e[33;46m TEXT BOLD  \e[33;47m TEXT BOLD

  \e[34m    TEXT BOLD  \e[34;41m TEXT BOLD  \e[34;42m TEXT BOLD  \e[34;43m TEXT BOLD  \e[34;44m TEXT BOLD  \e[34;45m TEXT BOLD  \e[34;46m TEXT BOLD  \e[34;47m TEXT BOLD

  \e[35m    TEXT BOLD  \e[35;41m TEXT BOLD  \e[35;42m TEXT BOLD  \e[35;43m TEXT BOLD  \e[35;44m TEXT BOLD  \e[35;45m TEXT BOLD  \e[35;46m TEXT BOLD  \e[35;47m TEXT BOLD

  \e[36m    TEXT BOLD  \e[36;41m TEXT BOLD  \e[36;42m TEXT BOLD  \e[36;43m TEXT BOLD  \e[36;44m TEXT BOLD  \e[36;45m TEXT BOLD  \e[36;46m TEXT BOLD  \e[36;47m TEXT BOLD

  (default) TEXT BOLD  \e[41m    TEXT BOLD  \e[42m    TEXT BOLD  \e[43m    TEXT BOLD  \e[44m    TEXT BOLD  \e[45m    TEXT BOLD  \e[46m    TEXT BOLD  \e[47m    TEXT BOLD

Commenting stuff out I managed to track the problem to the lines in my .zshrc:

if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
  source /usr/share/zsh/manjaro-zsh-prompt
fi

I did not change the contents of /usr/share/zsh/manjaro-zsh-prompt:

() {
  emulate -L zsh

  source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
  source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

  # Determine terminal capabilities.
  {
    if ! zmodload zsh/langinfo zsh/terminfo ||
       [[ $langinfo[CODESET] != (utf|UTF)(-|)8 || $TERM == (dumb|linux) ]] ||
       (( terminfo[colors] < 256 )); then
      # Don't use the powerline config. It won't work on this terminal.
      local USE_POWERLINE=false
      # Define alias `x` if our parent process is `login`.
      local parent
      if { parent=$(</proc/$PPID/comm) } && [[ ${parent:t} == login ]]; then
        alias x='startx ~/.xinitrc'
      fi
    fi
  } 2>/dev/null

  if [[ $USE_POWERLINE == false ]]; then
    # Use 8 colors and ASCII.
    source /usr/share/zsh/p10k-portable.zsh
    ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=black,bold'
  else
    # Use 256 colors and UNICODE.
    source /usr/share/zsh/p10k.zsh
    ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=244'
  fi
}

Any ideas of what’s wrong?

You’re in zsh. Bash has a $ at the end and zsh uses %.

It’s probably nordvpn (included in the zsh config), related to libxml2.

I posted some links here:

EDIT:

If you have nordvpn installed, then rebuild it.

4 Likes

Try the same again, commenting functions off and on again step by step, so you can narrow it down further.
However, manjaro-zsh-prompt includes more scripts, so you will have to crawl further and further down the rabbit hole :sweat_smile:

or it’s what dmt says :hugs:

1 Like

I would start with commenting this line, since the issue, assuming NordVPN is installed, seems to be related to the powerlevel10k theme that is used by default in Manjaro.

1 Like

I tried rebuilding but it does not work.

The reason seems to be the maintainer expect us to install libxml2-legacy, but unfortunately that’s not available in Manjaro.

+  ## Remove symbolic link from latest patch
+  if [[ $(readlink -- /usr/lib/libxml2.so.2) == /usr/lib/nordvpn/libxml2.so.2 ]] ; then
+    unlink /usr/lib/libxml2.so.2
+  fi
+  echo "::: README"
+  echo "::: Before use, install libxml2-legacy from extra repository."
+  echo "::: It is flagged as optional, but it will be mandatory in next release,"
+  echo "::: in case NordVPN had not built against the new libxml2 just yet."
+  echo "::: 3.20.2-3 was made to remove the symbolic link from previous patch"

https://aur.archlinux.org/cgit/aur.git/commit/?h=nordvpn-bin&id=8fa5be7b62fd2dfa7403bb7faf45da174d5e9af6

It’s available in the Unstable branch of Manjaro. You can either wait until it hits the Stable branch or install it manually before rebuilding NordVPN from the AUR.

Something like this:

sudo pacman -U https://mirror.alpix.eu/manjaro/unstable/extra/x86_64/libxml2-legacy-2.13.8-1-x86_64.pkg.tar.zst

Unfortunately that does not work:

(base) hmcezar-thinkpad% sudo pacman -U https://mirror.alpix.eu/manjaro/unstable/extra/x86_64/libxml2-legacy-2.13.8-1-x86_64.pkg.tar.zst
Place your right index finger on the fingerprint reader
:: Retrieving packages...
 libxml2-legacy-2.13.8-1-x86_64                  600,6 KiB  1938 KiB/s 00:00 [--------------------------------------------] 100%
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) libxml2-legacy-2.13.8-1

Total Installed Size:  1,70 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                               [--------------------------------------------] 100%
(1/1) checking package integrity                                             [--------------------------------------------] 100%
(1/1) loading package files                                                  [--------------------------------------------] 100%
(1/1) checking for file conflicts                                            [--------------------------------------------] 100%
error: failed to commit transaction (conflicting files)
libxml2-legacy: /usr/lib/libxml2.so.2 exists in filesystem (owned by libxml2)
libxml2-legacy: /usr/lib/libxml2.so.2.13.8 exists in filesystem (owned by libxml2)
Errors occurred, no packages were upgraded.

I’ll probably have to disable powerlevel10k until the next stable release is out.

Ah yes, that package hasn’t been updated on stable yet so you already have the legacy version.

So we’re back to:

I can’t replicate the issue myself, so I can only go on what’s been posted on the forum.

It is, however, available from Arch;

If it’s actually needed, it could be installed manually as mentioned in the same topic;

wget https://mirror.math.princeton.edu/pub/archlinux/extra/os/x86_64/libxml2-legacy-2.13.8-1-x86_64.pkg.tar.zst
sudo pacman -U libxml2-legacy-2.13.8-1-x86_64.pkg.tar.zst

That said, I don’t think it’s needed. Perhaps just wait till libxml2 (2.14.2-2) filters down from the Unstable branch.