Repository navigation
Troubleshooting
| Build | Log |
|---|---|
| default (syslog) | syslog, facility news: journalctl -u newscache, or the file your syslog writes news.* to |
--without-syslog |
LogDirectory/newscache.log (and newscache_newscacheclean.log, newscache_updatenews.log) |
| container image | the container's output: docker logs newscache
|
--enable-debug adds much more detail. newscache -o shows how a binary
was built.
With --without-syslog, the log file must be a regular file with one
link. A symbolic or hard link is refused with an error on stderr (a link
to the program's own stderr, such as /dev/stderr, is fine). The daemon
started without -n or -d points its standard input, output and error
at /dev/null, so such messages are lost then; start it with -n to see
them. Errors in Username or Groupname go to the log.
Control bytes in a log line (ESC, CR, DEL and the other bytes below
0x20) are written as ?: commands, user names, group names and host
names come from clients and DNS. The same holds for .headerlog
(--enable-headerlog), except tabs and line ends.
newscache -c /etc/newscache.conf -pprints the configuration as NewsCache parsed it, or the line of the first
error. A file that can't be opened is reported as cannot open configuration file <path>: <reason> (up to 1.3.22: unexpected EOF in <path>, whatever the reason). Upstream passwords are shown as # Password set, not shown, so the
output can be pasted into a bug report.
A numeric option that isn't a plain number in its range (ClientTimeout 20m, Retries -1) and an AccessList prefix length that is empty, too
large or a netmask with gaps are errors: the program doesn't start, and
a running daemon keeps its old configuration at a reload.
A client with the debug right can check its own view:
XDEBUG dump authorization
XDEBUG dump configuration
To talk to NewsCache by hand:
printf 'CAPABILITIES\r\nQUIT\r\n' | nc localhost 119No AccessList entry allows the client. Nothing is allowed by default,
not even localhost. Add a Client entry for its address or network
before Default, and reload. Remember:
- the first matching entry wins;
- a plain address (
Client 10.1.2.3) is exactly that host; - behind Docker/Podman port forwarding, clients on the host itself arrive
from the container network (
172.17.0.1,10.88.0.1); - behind a TLS proxy, NewsCache sees the proxy's address;
- in inetd mode the client is called
stdin.
See Access and Authentication.
The client's entry allows the command only after a login. If logins should
be optional, give the entry its own rights (allow read post); if they
are wanted, check the user file. 502 access denied after a login means
the login worked but doesn't grant that group or right. A failed login
gets 481.
-
The user file: check its format (
user:hash[:list:read:postto:allow]) and that the user NewsCache runs as (news) can read it. -
Local accounts (
Authentication unix, PAM withpam_unix) can't be checked as news; the log says "cannot read the shadow password" or shows PAM's error with a hint. Use a user file or a PAM module that works without root. See Access and Authentication. -
The delay: each failed login waits
AuthFailureDelay(at most 1 s), and after three failures the connection is closed. - MD5 hashes on big-endian hosts (s390x, ppc64, ...) never matched up to 1.3.22; fixed after 1.3.22.
The log has TLS handshake with <host> failed: ... and a TLS: line with
the reason. Usual causes: the certificate has expired, its name doesn't
match the Server line, or it comes from a private CA (use TLSCAFile).
openssl s_client -connect host:563 -servername host shows the
certificate. With starttls, a server that doesn't offer STARTTLS makes
the connection fail; NewsCache never falls back to plain text. See
Upstream Servers and TLS.
The log has TLS handshake failed: <reason> for each client that couldn't
connect. Check the certificate with openssl s_client -connect host:563 -servername host: an expired certificate (NewsCache warns at start), a
missing intermediate certificate (use the full chain in TLSCertFile), or
a client that speaks plain NNTP to the TLS port. After a certificate
renewal, SIGHUP reloads it only if Username can read the key; the log
says so if it can't. See TLS for Clients.
The container has no working DNS, typically because the host uses a local
resolver (nameserver 127.0.0.1). Build with docker build --network host
and run with --dns <resolver>. See the
README.
The active list is cached for the first Timeouts value. After changing
the servers' Read lists, remove SpoolDirectory/.active64 or run
updatenews -a.
These changes are on main and will be in the next release (see the
Unreleased section of
NEWS):
-
Reply codes: a failed login answers
481instead of502. The greeting andMODE READERanswer201instead of200when the client may not post at that moment. Upstream failures and internal faults answer403instead of503. After aPOSTed article only240or441come. See NNTP Commands and Access and Authentication. -
Configuration: numeric options must be plain numbers in their range,
the last line counts even without a newline, and bad prefix lengths in
the
AccessListare errors. Check the file withnewscache -pbefore restarting. -
NiceClean:newscachecleannow uses it (default 3) instead ofNiceServer. -
New limits:
ReadTimeout(300 s per read or write on an upstream connection),MaxArticleSizeandMaxPostSize(1 MiB each). Raise the size limits if you need larger articles. Active-list and range replies have separate whole-reply limits; see Upstream Servers and TLS. - Log and pid file: only a regular file with one link is written. A link there is refused (the log) or left alone with a warning (the pid file).
-
LIST ACTIVEwith a wildmat andLIST NEWSGROUPSshow only the groups of the client'sList. -
updatenews -wis accepted and ignored. -
PAM: NewsCache now gives PAM the client's address (
PAM_RHOST), so host-based PAM rules (pam_access, pam_succeed_ifrhost) apply. Check such rules in thenewscachePAM service before upgrading. -
Logins: after a failed
AUTHINFO PASS, sendAUTHINFO USERagain (a secondPASSgets482). A command the client may not use, where a login can't help, gets502(440forPOST) instead of500. -
Failed logins wait at most 1 s, the same each time
(
AuthFailureDelayabove 1 counts as 1; it was 15, 30, 45 s). -
Building: a plain
./configureuses/usr/local/etcinstead ofNONE/etc;--without-pam,--with-md5autoand--with-uniquenamework as documented. -
TLS for clients is new and off unless
TLSListenTois set (see TLS for Clients).ListenTo [::1]now works on hosts without a global IPv6 address, and the listening sockets queue up to 128 connections instead of 4. -
Crossposts: when a posting goes to multiple upstream servers,
NewsCache adds missing
DateandInjection-Datealong with a shared Message-ID before forwarding or queuing copies. -
Log lines: control bytes (below 0x20, and DEL) are written as
?. - SIGTERM: a session ends within about a second, also while it waits for the upstream server, and doesn't reconnect after the signal.
-
Big article files are written as
.art<number>.tmpand renamed;newscachecleanremoves a leftover.tmpby its age. -
Locks: a session no longer keeps a group locked while it writes to
a client or waits for the upstream server, and a LIST ACTIVE refresh no
longer blocks other sessions' GROUP. Two lock files appear in the spool,
.active.refreshand.fetch.lock(no data). While another session refreshes the active list, a group that is new upstream answers 411 until the refresh is done. -
updatenews -lreserves each range of 10000 numbers instead of locking the whole group: clients keep reading the group meanwhile.
-
Active list: at the first start NewsCache converts
.activeto.active64and renames the old file to.active.v1(the log says so). The old file can then be deleted. - Group databases: they stay valid. Old ones may be large; they never shrink, so remove a group's directory to get the space back (see Caching and Large Groups).
-
Message-ID history: it is off unless you add
History on. -
CachePort: it works now, but is ignored when aListenToline is set. PreferListenTo DEFAULT:port. -
ListenTo DEFAULT: it now listens on IPv6 too. UseListenTo 0.0.0.0for IPv4 only. -
Pid file: the systemd and container configs no longer set
PidFile.
Going back to 1.3.21 works, but it drops each group's cached articles the first time it uses the group (see Caching and Large Groups).
After make install, restart the daemon: a running daemon keeps using the
old binary, and reload doesn't change that.
NewsCache checks its spool files. A damaged .db or .active64 is moved
to name.bad, logged once, and rebuilt from the upstream server;
newscacheclean removes the .bad files. If this keeps happening, check
the disk, and that only one NewsCache installation uses the spool. See
doc/newscache-corrupt-db-files.txt.
A big article's file (.art<number>) that a crash cut off under an
older version (its last line has no line end, or there is no empty line
after the header) is fetched again from the upstream server and written
anew. If that server no longer has the article, the stored copy is
served as it is and the log says so. A file cut right after a line end
in the body can't be told from a whole one.
NewsCache keeps answering: articles and overview records it can't store
are passed on from the upstream server, and the log says what couldn't be
stored ("cannot store article ...", "cannot grow the file"). Nothing is
left half written: a big article's file is written under a temporary
name and renamed only when it is complete, so a failed write keeps the
old file. Up to 1.3.21 a full spool crashed sessions (SIGBUS) and could
leave articles cut off. Free space with newscacheclean, and keep
SpoolSize well below the file system's size. The databases take the
disk space of their full size (the history's 16 files about 8 MB).
Run newscacheclean regularly (cron or a systemd timer), and check
SpoolSize (in KB). With History on, the history in .history counts
too; newscacheclean removes it when it alone takes more than half of
SpoolSize.
Most of these date from 2004 (Herbert Straub); details may have changed.
| File | Topic |
|---|---|
| newscache-debugging.txt | Debugging with newscache -i and gdb |
| newscache-coredump.txt | Getting a core dump |
| newscache-corrupt-db-files.txt | Damaged spool databases |
| newscache-pam.txt | PAM |
| newscache-stunnel-ssl.txt | TLS for clients with stunnel (needed in 1.3.22 and older; from 1.3.23 see TLS for Clients) |
Open an issue at https://github.com/go-while/NewsCache/issues with:
- the version (
newscache -v) and how it was built (newscache -o); - your system;
- the output of
newscache -p(passwords are hidden, but check for other things you don't want to publish); - the relevant log lines, and the NNTP commands that show the problem.
NewsCache is free software under the GNU General Public License, version 2 or (at your option) any later version — see COPYING. © 1996–1998 Thomas Gschwind, © 2001–2004 Herbert Straub, © 2008–2024 Christof Meerwald.