Man pages render empty

Hello, I’m no expert with Linux man page configuration, but I spent quite a bit of time recently trying to understand why my package man pages aren’t rendering correctly on any of my Resin devices. While I show an example of the issue on one of my devices, this isn’t specific to a particular device or image; I’ve never had man pages working properly. Suspecting the package ordering, I even tried installing ‘man-db’ and ‘manpages’ in a Dockerfile step prior to all the other system packages, but this didn’t help.

Have you seen this problem before?

Dockerfile excerpt:

FROM resin/raspberrypi3-debian:latest
RUN apt-get ... \
    man-db \
    manpages \

My attempt at debugging the issue follows. My gut tells me that this is more about the ability of the renderer (less) to function correctly because all evidence suggests that the man tool correctly locates the physical man pages and traverses the section numbers properly.

root@pi:~# manpath
root@pi:~# mandb
Purging old database entries in /usr/share/man...
Processing manual pages under /usr/share/man...
Purging old database entries in /usr/share/man/cs...
Processing manual pages under /usr/share/man/cs...
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.

root@pi:~# ls -l /usr/share/man/man1/grep.1.gz
-rw-r--r-- 1 root root 10001 Feb 14  2015 /usr/share/man/man1/grep.1.gz

root@pi:~# zgrep pattern /usr/share/man/man1/grep.1.gz
grep, egrep, fgrep, rgrep \- print lines matching a pattern

root@pi:~# man -d grep
From the config file /etc/manpath.config:
Mandatory mandir `/usr/share/man'.
ult_src: File /usr/share/man/man1/grep.1.gz in mantree /usr/share/man
found ultimate source file /usr/share/man/man1/grep.1.gz
chdir /usr/share/man
pre-processors `t' from default
page_encoding = ISO-8859-1
source_encoding = ISO-8859-1
locale_charset = ANSI_X3.4-1968
roff_device (locale) = ascii
roff_encoding = ANSI_X3.4-1968
output_encoding = ANSI_X3.4-1968
less_charset = ascii
Terminal width 168
Terminal width 168 not within cat page range [80, 80]
Using 163-character lines
formatted_encoding = ANSI_X3.4-1968
format: 1, save_cat: 0, found: 1
add_output_iconv: source ANSI_X3.4-1968, target ANSI_X3.4-1968
Setting LESS to -ix8RmPm Manual page grep(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page grep(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$
Setting MAN_PN to grep(1)
++priv_drop_count = 1
--priv_drop_count = 0
hashtable_free: 2 entries, 2 (100%) unique

Found 1 man pages
++priv_drop_count = 1
hashtable_free: 7 entries, 7 (100%) unique

The result: man page (blank page with footer):

 Manual page grep(1) line ?/? (END) (press h for help or q to quit)


Can you share some more details?
Do you see an empty man page when you are in the web terminal in your dashboard?

Thanks for the question.

I’ve noticed that groff does complain if you try to run it:

root@raspberrypi3-c0b49cb:/usr/src/app# groff
groff: can't find `DESC' file
groff:fatal error: invalid device `ps'

And that it seems to be missing DESC files in /usr/share/groff. This might explain why man is not rendering.



Thanks! I didn’t notice that. I’ll dig in and let you know. strace has a little more detail. I glossed over groff because groff-base was already installed as a transitive dependency. Will let you know what I discover, thanks again.

brk(0x56824000)                         = 0x56824000
open("/usr/share/groff/site-font/devps/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/groff/1.22.2/font/devps/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/font/devps/DESC", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "groff: can't find `DESC' file\n", 30groff: can't find `DESC' file
) = 30
write(2, "groff:fatal error: invalid devic"..., 39groff:fatal error: invalid device `ps'
) = 39
exit_group(3)                           = ?
+++ exited with 3 +++

This was the crux of it, and after some pretty bleak Google search results, I came across this:

My Ubuntu system has no such file, but my Resin devices have them. I commented out items that refer to the paths that I know/care about.

root@pi:~# cat /etc/dpkg/dpkg.cfg.d/01_nodoc
path-exclude /usr/share/doc/*
# we need to keep copyright files for legal reasons
path-include /usr/share/doc/*/copyright
#path-exclude /usr/share/man/*
#path-exclude /usr/share/groff/*
path-exclude /usr/share/info/*
path-exclude /usr/share/lintian/*
path-exclude /usr/share/linda/*

path-exclude /usr/share/locale/*
path-include /usr/share/locale/en*

root@pi:~# apt-get install groff groff-base manpages man-db --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 4 reinstalled, 0 to remove and 8 not upgraded.
Need to get 6204 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 jessie/main man-db armhf [975 kB]
Get:2 jessie/main groff-base armhf 1.22.2-8 [1052 kB]
Get:3 jessie/main manpages all 3.74-1 [997 kB]
Get:4 jessie/main groff armhf 1.22.2-8 [3180 kB]
Fetched 6204 kB in 11s (541 kB/s)
Preconfiguring packages ...
(Reading database ... 19250 files and directories currently installed.)
Preparing to unpack .../man-db_2.7.0.2-5_armhf.deb ...
Unpacking man-db ( over ( ...
Preparing to unpack .../groff-base_1.22.2-8_armhf.deb ...
Unpacking groff-base (1.22.2-8) over (1.22.2-8) ...
Preparing to unpack .../manpages_3.74-1_all.deb ...
Unpacking manpages (3.74-1) over (3.74-1) ...
Preparing to unpack .../groff_1.22.2-8_armhf.deb ...
Unpacking groff (1.22.2-8) over (1.22.2-8) ...
Processing triggers for mime-support (3.58) ...
Setting up groff-base (1.22.2-8) ...
Setting up man-db ( ...
Updating database of manual pages ...
Setting up manpages (3.74-1) ...
Setting up groff (1.22.2-8) ...
root@pi:~# man grep
       grep, egrep, fgrep, rgrep - print lines matching a pattern

       grep [OPTIONS] PATTERN [FILE...]
       grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]

I’m not sure if you need to mark this issue as resolved, but I think that we’re done here. Thanks!

Great to see you’ve managed to resolve it; glad I could help you!

1 Like