Skip to content

Fix crashes from unmapped UIDs and invalid DNS lookups#327

Open
kimjune01 wants to merge 2 commits into
PabloLec:mainfrom
kimjune01:fix/user-lookup-error-handling
Open

Fix crashes from unmapped UIDs and invalid DNS lookups#327
kimjune01 wants to merge 2 commits into
PabloLec:mainfrom
kimjune01:fix/user-lookup-error-handling

Conversation

@kimjune01

@kimjune01 kimjune01 commented May 12, 2026

Copy link
Copy Markdown

Summary

  • Wrap execSync('id -nu') in try/catch to handle unmapped UIDs in containerized environments (NixOS, Docker). Falls back to showing the numeric UID instead of crashing.
  • Wrap dns.reverse() in try/catch to handle synchronous throws on invalid/malformed IP addresses. Keeps the original IP address on failure.

Fixes #186

Test plan

  • npx tsc --noEmit passes with zero errors
  • Crash condition requires Linux /proc with specific container state (unmapped UIDs) - verified by code review

kimjune01 added 2 commits May 11, 2026 20:32
Two crash fixes:

1. Issue PabloLec#186: Handle unmapped UIDs gracefully
   - Wrap execSync("id -nu") in try-catch
   - Fall back to numeric UID when user lookup fails
   - Prevents crash in containerized environments (NixOS, etc.)

2. Issue PabloLec#177: Handle DNS reverse lookup errors
   - Wrap reverse() in try-catch block
   - DNS can throw synchronously on invalid addresses (EINVAL)
   - Prevents intermittent crashes during refresh

Both fixes are defensive: continue operation with degraded
data (UID instead of username, IP instead of hostname) rather
than crash the entire application.
The test script is useful for local verification but shouldn't be
committed — it's CJS in a TypeScript project and not wired into the
test runner.
@kimjune01 kimjune01 changed the title Remove manual test-fixes.js from tracked files Fix crashes from unmapped UIDs and invalid DNS lookups May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when starting neoss: no such user

1 participant