Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal broken under NixOS-17.09.2826.5141f28405e #34364

Closed
chisui opened this issue Jan 28, 2018 · 20 comments
Closed

Terminal broken under NixOS-17.09.2826.5141f28405e #34364

chisui opened this issue Jan 28, 2018 · 20 comments
Labels
0.kind: regression Something that worked before working no longer 1.severity: blocker
Milestone

Comments

@chisui
Copy link
Contributor

chisui commented Jan 28, 2018

Issue description

On the graphical image as well as a system installed from it terminfo is broken. This manifests in the form of clear and reset not work and nano only displaying available commands at the bottom with no file content or way to edit anything. I would classify this as a blocker since I only have nano as an editor on the installation and cat/echo are no real alternatives.

The problem seems to be that ncurses-6.0-20170902 installs a broken terminfo database to /run/current-system/sw/share/terminfo/. There any lowercase entry that has corresponding uppercase entries is followed by ~nix~case~hack~1. Both the entry for l(with linux in it) and x(xterm*) have these.

Creating a copy of this directory where the postfixes are removed and setting the TERMINFO_DIRS environment variable to point to that directory fixes the problems. This isn't an acceptable fix though.

Steps to reproduce

  1. run the iso
  2. login
  3. enter clear
    actual: 'linux': unknown terminal type.
    excpected: a cleared terminal.

Technical details

 - system: `x86_64-linux`
 - host os: `Linux 4.9.77, NixOS, 17.09.2826.5141f28405e (Hummingbird)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 1.11.16`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`
@chisui chisui closed this as completed Jan 28, 2018
@chisui
Copy link
Contributor Author

chisui commented Jan 28, 2018

Can't reproduce with 17.09.2875.c2b668ee726

@rimmington
Copy link
Contributor

rimmington commented Jan 29, 2018

I've run into this with the current head of channels/17.09, ie. c2b668e, in a Vagrant box. I've done a bisect and it seems like the issue was introduced in 0186286. Here's some Bash output while running on 0186286:

[vagrant@nixbox:~]$ clear
'xterm-256color': unknown terminal type.
[vagrant@nixbox:~]$ ls /etc/terminfo
1  6  a~nix~case~hack~1  e~nix~case~hack~1  j                  m~nix~case~hack~1  p~nix~case~hack~1  t  x~nix~case~hack~1
2  7  b                  f                  k                  N                  Q                  u  z
3  8  c                  g                  L                  n~nix~case~hack~1  q~nix~case~hack~1  v
4  9  d                  h                  l~nix~case~hack~1  o                  r                  w
5  A  E                  i                  M                  P                  s                  X
[vagrant@nixbox:~]$ export TERM=vt100
[vagrant@nixbox:~]$ clear
# works now

@chisui I'm a bit confused as to why I ran into this but you didn't. I am using the Vagrant box nixos/nixos-17.09-x86_64, but I'd be surprised if there were different results between using a fresh image and upgrading from an older version of 17.09.

@chisui
Copy link
Contributor Author

chisui commented Jan 30, 2018

I first encountered this problem with in nixos-graphical-17.09.2826.5141f28405e-x86_64-linux.iso. Some time later I tried nixos-graphical-17.09.2875.c2b668ee726-x86_64-linux.iso and terminfo was ok.

@kuznero
Copy link
Member

kuznero commented Jan 30, 2018

I keep seeing this more and more. I am running nixos-minimal-17.09.2875.c2b668ee726-x86_64-linux.iso on VirtualBox v5.2.6.

@kuznero
Copy link
Member

kuznero commented Jan 30, 2018

Doesn't it make sense to keep the issue open?

@chisui
Copy link
Contributor Author

chisui commented Jan 30, 2018

Yeah, I thought it was fixed but seems as if its still there.

@chisui chisui reopened this Jan 30, 2018
@chisui
Copy link
Contributor Author

chisui commented Jan 30, 2018

The weird thing is that ~nix~case~hack~ is only used in archive.cc and only if you are on a mac. So how does this get into anything linux related at all?

@kuznero
Copy link
Member

kuznero commented Jan 30, 2018

Is there any way to override ~nix~case~hack~ somehow? File system is read-only...

@chisui
Copy link
Contributor Author

chisui commented Jan 30, 2018

My fix was to:

  1. create a copy of the directory.
  2. Fix the filenames.
  3. Let TERMINFO_DIRS point to the copy.

@kuznero
Copy link
Member

kuznero commented Jan 30, 2018

Does upgrading to 18.x help?

@kuznero
Copy link
Member

kuznero commented Jan 30, 2018

And upgrading to nixos-unstable also fixed the issue. Quite annoying.

@guillaumekoenig
Copy link
Contributor

Ran into the same issue while installing a linux nixos 17.09 from start. sudo nix-store --repair-path /nix/store/609zdpfi5kpz2c7mbjcqjmpb4sd2y3j4-ncurses-6.0-20170902 followed by sudo nixos-rebuild switch fixed it for me (there might need to be a change for rebuild to be effectful). It forces a redownload of ncurses from one of the cache servers.

Like @chisui suggested ~nix~case~hack~ appears in archive.cc which handles nar files, archives from binary cache servers. The above "fix" suggests there is something going on with some of the binary cache servers. It looks like a version targeting OS X is retrieved by a linux NixOS (~nix~case~hack~ is flagged to the apple platform in archive.cc).

@srid
Copy link
Contributor

srid commented Feb 2, 2018

FWIW, this can be seen on nixos-graphical-17.09.2905.c1d9aff56e0-x86_64-linux.iso as well.

@dezgeg
Copy link
Contributor

dezgeg commented Feb 3, 2018

Comment on IRC:

17:47:25        niksnut | somehow, the darwin-specific case hack got applied while nixops copied that path from one linux machine to another

@knedlsepp
Copy link
Member

knedlsepp commented Feb 5, 2018

Experienced this issue today on a fresh nixos-17.09 install. Neither backspace nor arrow keys would work in the Konsole. I could only mitigate the problem a little by using export TERM=vt100. I guess I'll give repairing the ncurses-path a try.

@ttamttam
Copy link

ttamttam commented Feb 6, 2018

I installed NixOS for the first time on sunday, with the ISO pointed to by the download page of NixOS (17.09.2905.c1d9aff56e0).

I faced this problem: it makes the installation very painfull.

The solution proposed by @guillaumekoenig:

sudo nix-store --repair-path /nix/store/609zdpfi5kpz2c7mbjcqjmpb4sd2y3j4-ncurses-6.0-20170902
sudo nixos-rebuild switch

seems to work after a reboot.

@fpletz fpletz added this to the 18.03 milestone Feb 9, 2018
@fpletz fpletz added 1.severity: blocker 0.kind: regression Something that worked before working no longer labels Feb 9, 2018
@kini
Copy link
Member

kini commented Mar 24, 2018

Data point: nixos-graphical-17.09.3129.1dcd022f01b-x86_64-linux.iso doesn't have the problem.

@dezgeg
Copy link
Contributor

dezgeg commented Mar 25, 2018

I believe the underlying problem still exists in latest Nix: NixOS/nix#2009

@matthewbauer matthewbauer modified the milestones: 18.03, 18.09 Oct 1, 2018
@xeji
Copy link
Contributor

xeji commented Oct 1, 2018

Does this issue still exist in 18.09 ? The nix issue ^^ was fixed.
Maybe this can be closed.

@matthewbauer
Copy link
Member

Yeah landed in Nix 2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: regression Something that worked before working no longer 1.severity: blocker
Projects
None yet
Development

No branches or pull requests