Nethack: cannot write scoreboard file ‘record’

Applied Stable update a few minutes ago, and noticed that nethack was updated, which was very surprising to me, so I tried to start a game, since I use it regularly - here’s what I found:

brad@brad-LenovoT590 ~]$ nethack
Warning: cannot write scoreboard file ‘record’

Hit return to continue: (hit return, and):

NetHack, Copyright 1985-2020
By Stichting Mathematisch Centrum and M. Stephenson.
Version 3.6.6 Unix, built Dec 30 12:25:28 2021.
See license for details.
Cannot open file perm. Is NetHack installed correctly?

I unistalled/reinstalled the binary, and got the same messages. I’ve reported this issue to the NetHack developers, in case there was an issue on their end.


1 Like

I can reproduce it. The current Arch package maintainer did a rebuild with 3.6.6-2 and also changed some things with file permissions.

I tried installing 3.6.6-1, however there is still an issue:

❯ nethack

cannot creat lock file (alock.0).

It seems there have been issues with packaging this game for years and several Arch bug reports.

The file permissions will prevent you from fiddling with the game files

Cheating - NetHack Wiki

nethack used to be run as games user on ancient Unices to avoid users from cheating by editing bones and save files.

FS#20284 : [nethack] runs as root because arch does not have the games user.

Thanks for checking this issue!

I last played this game in mid-December, so I’m assuming I was using the “previous” version, which worked as expected.

from the pacman.log:

[2021-09-17T19:46:06-0400] [ALPM] installed nethack (3.6.6-1)
[2022-01-02T10:17:35-0500] [ALPM] upgraded nethack (3.6.6-1 → 3.6.6-2)

I know - “bad form” to reply to my own post!

I have a workaround - I built nethack from the AUR repository, and it works:

NetHack, Copyright 1985-2020
By Stichting Mathematisch Centrum and M. Stephenson.
Version 3.6.6-0 Unix post-release, built Jan 2 16:00:55 2022.
See license for details.

Shall I pick character’s race, role, gender and alignment for you? [ynaq]

I’ll use this version, until -2 gets fixed by the Arch folks. Thanks!

A workaround: change the permissions to include writing for /var/games/nethack/perm and /var/games/nethack/record, using

sudo chmod 666 /var/games/nethack/record
sudo chmod 666 /var/games/nethack/perm

1 Like

Thanks for all the suggestions - one more - just don’t upgrade nethack. The previous version works without issue, at least for me.

Sometimes, the latest is not the greatest.

: - )

OK, so I tried the chmod suggestion from engtao but I ran into another issue after that, the alock.0 issue.

I decided to check out the Arch package list and found bugs [dot] archlinux [dot] org [slash] task [slash] 73353 which suggests the following command:

chgrp -R games /var/games/nethack

After running this command everything works as expected without needing to chmod any files.