linux-user.eu

~/ z-dyzuru

On Call

Short cases from the admin desk: first the symptom and your decision, then the diagnosis. Pick what to check first and see how your reasoning compares with the answer.

EPISODE 01 · EMAIL / TLS

The certificate was replaced, but clients still see the old one

After a scheduled replacement of the IMAP certificate at imap.example.org:993 some users report that their mail clients still see the previous certificate. The administrator sees the new one when testing from the office network. For now, leave the configuration and services alone.

The domain, addresses and results are illustrative.

What would you check first?

Expand the option you’d try first. You can compare all three afterward.

I’d compare the certificates served on every address

The quickest route given these symptoms. Look up the A and AAAA records, then connect to each address separately, keeping the same hostname for SNI and verification. This compares endpoints instead of repeating the same test from the office.

I’d check the certificate file on the mail server

Useful, but it doesn’t settle the question. The local file’s expiry date and fingerprint tell you whether you have the right certificate. They don’t confirm what the process that terminates TLS presents to clients. A correct file may still not be in use on every listener.

I’d compare settings and logs from two mail clients

A good way to narrow down the issue. Confirm the hostname, port and destination address if the client logs it. This helps distinguish misconfigured accounts from differences in the network path. A DNS lookup on the computer alone doesn’t prove which address the client actually chose.

Reveal the diagnosis

Two addresses, two different certificates

DNS returns the A record 192.0.2.25 and the AAAA record 2001:db8::25. Both tests use the same hostname, imap.example.org and the same port:

dig +short imap.example.org A
dig +short imap.example.org AAAA

openssl s_client -connect 192.0.2.25:993 \
  -servername imap.example.org -verify_hostname imap.example.org \
  -verify_return_error -showcerts </dev/null | \
  openssl x509 -noout -serial -enddate -fingerprint -sha256

openssl s_client -connect '[2001:db8::25]:993' \
  -servername imap.example.org -verify_hostname imap.example.org \
  -verify_return_error -showcerts </dev/null | \
  openssl x509 -noout -serial -enddate -fingerprint -sha256

The first command in each pipeline checks TLS; the second reads the certificate fields. Compare the fingerprint with the one from the rollout. If OpenSSL reports a verification error, don’t treat the appearance of certificate fields alone as a successful check.

  • IPv4: new certificate, serial number 40B2.
  • IPv6: previous certificate, serial number 31A1, which is still valid in this example.
  • Logs from the affected clients show connections to the IPv6 address. Reviewing the configuration confirms that a separate TLS endpoint receives IPv6 traffic and still has the old certificate assigned to it.

Conclusion: The certificate was replaced on the IPv4 path, but not on IPv6. This is an inconsistent rollout, not client caching. In a planned fix, the team updates the affected endpoint and retests both addresses from an external network. There’s no need to disable TLS verification or drop the AAAA record to hide the symptom.

Documentation

EPISODE 02 · NETWORKING / VPN

Small files download over the VPN, but large ones stall

The dashboard at pliki.example.org opens over the VPN. A small file downloads immediately, but a larger transfer stalls after a while. On a direct connection, the same file from the same HTTPS server downloads in full. Leave the tunnel and application settings unchanged for now.

The addresses and sizes are illustrative.

What do the first tests show?

  • Over the VPN: the 600 B test file downloads in full. For the 40 MiB file, the client receives HTTP 200, but the download never finishes.
  • Off the VPN: the same client downloads both files from the same address and port. Short dashboard requests work on both networks.
  • On a retry: the result is the same. The symptom depends on the network path and the type of traffic, but you don’t yet know where the data is being lost.

What would you check first?

I’d compare how small and large packets behave on both paths

A promising lead. Size-dependent behavior fits a path MTU limit. Try several packet sizes with DF (Don’t Fragment) set. A large ping going unanswered is a clue, not proof: ICMP Echo can be filtered, and the ping size threshold may not describe TCP traffic in both directions.

I’d check the HTTPS application and web server logs

Useful for ruling out a different cause. Look for application errors, timeouts or differences in how requests are handled. HTTP 200 by itself doesn’t prove the transfer finished. If the file downloads off the VPN, also compare what happens to packets on both paths.

I’d check whether both paths reach the same server

Worth confirming. DNS over the VPN may give you a different address. Compare the actual destination address, the HTTPS hostname and the object you requested. If the endpoint is the same, look for differences along the path.

Reveal the diagnosis

The packets are too large, and the warning never makes it back

Use a Linux test machine to check the same server IPv4 address. On IPv4 without options, the IP and ICMP headers add 28 bytes to the ping payload. The probes below send packets of 1400 and 1401 bytes:

ping -4 -c 3 -M do -s 1372 192.0.2.25
ping -4 -c 3 -M do -s 1373 192.0.2.25

Off the VPN, both sizes get replies. Over the VPN, only the smaller one gets through. That narrows the search, but packet captures on both sides of the firewall on the return path to the server settle it:

  • The server sends TCP segments in IPv4 packets with DF set that exceed the tunnel’s effective MTU of 1400 bytes. The capture shows the same segments being retransmitted.
  • The gateway at the tunnel entrance drops the oversized packet and sends the server an ICMP Fragmentation Needed message (type 3, code 4) for that connection. The message appears before the firewall, but not beyond it or at the server. A firewall rule confirms that the message is dropped.

Pay attention to direction: when the large file downloads, the server sends the large segments. A ping from the laptop alone doesn’t tell you whether the warning reached the server. That’s why you need to check the specific session and the ICMP return path.

Conclusion: this is a PMTU black hole. The sender never learns it needs to send smaller packets. As a temporary workaround for new TCP sessions, you may be able to clamp the advertised MSS at the VPN edge to fit the measured path; this won’t help other protocols. The proper fix is to let the relevant ICMP messages reach the sender and repeat the same VPN download. You don’t need to allow all ICMP traffic without restrictions.

Documentation

EPISODE 03 · DNS / TWO VIEWS OF THE SAME ZONE

The portal works until you get to the office

Scenario date:

08:51. A message lands in the on-call queue: “Works on my phone, not at my desk.” The support portal moved behind a new HTTPS gateway overnight. The external monitor is green, but office browsers time out after a few seconds. Nobody gets as far as the sign-in page or sees a certificate warning.

What you know so far

  • The same laptop opens the same URL over a phone hotspot. Back on office Wi-Fi, the portal stops responding again.
  • The new gateway is receiving traffic from the internet. Its logs show no request corresponding to the failed office test.
  • The migration plan lists two destination addresses, one public and one private. Both are meant to lead to the new gateway, taking different routes.

What would you check before asking anyone to change the configuration?

Restart the new gateway and wait to see whether the reports stop.

A restart doesn’t explain why the same laptop works on a hotspot. It could also interrupt access for people who can still use the portal.

Compare DNS answers for portal.example.test inside and outside the office using the resolver each network normally uses.

A good first lead. If the addresses differ, compare them with the migration plan and check whether each answer comes from the zone or a cache.

Issue a new certificate, since the outage followed an HTTPS migration.

The browser hasn’t reached the point where it can inspect a certificate. First find out where it’s trying to connect.

Reveal the diagnosis

One URL, two DNS answers

In the office, dig portal.example.test A returns 10.20.30.18. Outside the office, the same name resolves to 203.0.113.45. That difference is intentional: internal and external DNS views can steer clients to different addresses. But 10.20.30.18 belongs to the retired gateway. The new gateway listens internally at 10.20.30.42.

The authoritative server for the internal view returns the old address too. That distinguishes a stale zone record from an entry cached on the laptop. Correct only the internal A record, allow for the old answer’s remaining cache lifetime, and retry from the office. Then check that the portal still opens from the internet.

Takeaway: For a split-DNS migration, write down the expected address in each view and test the service from where people use it. A green check from one network tells you nothing about the other.

Documentation

EPISODE 04 · LINUX / SYSTEMD

It works in the shell, but systemd never writes the file

Scenario date:

07:10. The orders report hasn’t appeared on disk. Run the exporter by hand as the service user and the file appears. A new version went out an hour ago, but you hold off on rolling it back: the very same program has produced two different results.

What you know so far

  • The timer fired on schedule. The service journal ends with “EXPORT_TMP is missing”, and the disk isn’t full.
  • The command works in a login shell with the same binary, arguments and user as the service.
  • The shell has a non-empty EXPORT_TMP. There’s no need to dump the whole environment to establish that.

What would you check first?

Inspect the service unit and compare where the two runs get their configuration.

Good lead. systemctl cat orders-export.service shows the unit file and its drop-ins. Compare those with the message in the journal, not just the result from the shell.

Roll back the deployment, since everything worked before it.

That might bring the report back, but it doesn’t explain why the new version works by hand. Check the missing variable mentioned in the logs first.

Give the service a longer timeout.

The process is exiting on its own with a configuration error. More time won’t give it the missing setting.

Reveal the diagnosis

Same account, different environment

The new version requires EXPORT_TMP. A login shell gets it from the account’s profile, but the systemd system unit starts the binary without a login shell. No Environment= or EnvironmentFile= setting provides the value.

The team adds the non-secret setting to managed configuration for that unit, checks access to the working directory and reloads the systemd configuration. Then they start the same service the timer triggers and check both the journal and the contents of the report, not just the exit status.

Takeaway: “It works by hand” is a useful clue, not proof it works in production. Compare the launch context and verify the fix through the same path that runs the job.

Documentation

EPISODE 05 · BACKUPS

Backup passed. Attachments missing.

Scenario date:

07:35. The ticket system’s test restore looks promising. You can sign in, the tickets are there, and both the database and the files restored without errors. Then you click Download. The new PDF has a name, size and author, but the app returns 404. An older attachment opens right away.

What you know so far

  • The missing PDF and yesterday’s working file have the same type, and both paths point to the same restored storage.
  • The application log reports a missing file at a specific key, not a permission error. The database contains a record with that key.
  • The set labelled “nightly” contains a 01:00 file snapshot and a 01:15 PostgreSQL dump. The system was accepting tickets all night.

What would you check before blaming the web server?

Restart the application and see whether clearing its cache helps.

Not as a first step. The log already points to a missing file in storage. A restart cannot supply a file the restored copy does not contain.

Look up the key from the database record in the file backup and establish the recovery point for each component.

Good lead. Comparing the database record with storage distinguishes a missing file from a problem in the application.

Overwrite the files with the newest available copy and see whether the PDF turns up.

Don’t overwrite blindly. A newer file backup can also disagree with the dump, for example if a file was deleted after the dump was taken.

Reveal the diagnosis

Two valid backups, two versions of the same app

The PDF was uploaded at 01:08. The database dump includes its record, but the earlier storage snapshot doesn’t contain the file. PostgreSQL restored a consistent database, not a consistent application. A restart can’t recreate the missing PDF.

Keep both backups. In an isolated environment, restore a verified pair from a common recovery point and open several attachments, including ones added just before that point. Next time, pause application writes and let in-flight operations finish before capturing both components, or use a coordination mechanism supported by the application. Record which components belong together in the backup metadata.

Takeaway: After a restore, test a complete user action, not just whether the database starts. Two individually consistent backups don’t necessarily form a consistent pair.

Documentation