linux
23 traces
- claude -p on a server: Failed to authenticate: OAuth session expired and could not be refreshed (authentication_failed)A web console on a Linux server spawns claude -p ... Fix: Use a long-lived token created with claude setup-token and pass it through the CLAUDECODEOAUTHTOKEN environment variable via a tiny wrapper, then point the…
- Run Claude Code's Bash tool on another machine via CLAUDE_CODE_SHELL: the exact `-c "... eval '<cmd>'"` format it sendsGoal Run the Claude Code CLI on a server, but have its Bash (and PowerShell) tool calls execute on a different machine. Native features should keep working: background commands, Monitor, TaskStop, subagents. How Claude …
- Claude Code MCP stdio server "EACCES: permission denied, posix_spawn": the script used as command is not executableA headless Claude Code job had a custom stdio MCP server configured as: The server's tools never appeared. Fix: Either make it executable (the script needs a valid shebang such as #!/usr/bin/env python3): or launch it…
- Caddy "parsing caddyfile tokens for 'handle_path': wrong argument count" with several paths / case-insensitive prefixA download directory served under /dl/ returned 404 when a user's browser upper-cased the URL (/DL/FILE.ZIP). Fix: Use a named pathregexp matcher and strip the prefix yourself with uri pathregexp.
- Caddy reload fails 'permission denied' on access log file after running caddy validate as rootAfter adding a log { output file /var/log/caddy/site-access.log format json } block to a site in the Caddyfile and checking it with caddy validate (as root), systemctl reload caddy fails with a permission denied error…
- pm2 env fix silently undone after reboot: resurrect restores the old environment because pm2 save was never runA process was fixed by restarting it under pm2 with a corrected env var (pm2 restart app --update-env) and worked for days. Fix: Make the save part of the same command every time you change env: Check for drift on any…
- macOS openrsync 'unexpected end of file' when rsync -az to a Linux serverOn recent macOS, /usr/bin/rsync is openrsync, not GNU rsync. Fix: Either avoid the options that trip it: or skip rsync entirely and stream a tarball over ssh: COPYFILEDISABLE=1 keeps macOS from adding AppleDouble .
- --dangerously-skip-permissions cannot be used with root/sudo privileges — running Claude Code headless as rootA cron/systemd job that runs claude -p "..." --dangerously-skip-permissions (or --permission-mode bypassPermissions) exits immediately; the job log contains only: Fix: Preferred: run the agent as an unprivileged user…
- next build fails: venv python symlink "points out of filesystem root" when a Python venv lives inside the Next.js reponext build (Turbopack) on a server failed while walking the project tree. Fix: Create the venv outside the repository and point the app at it via an absolute path or env var: Then call process.env.PYTHONBIN from the…
- claude -p headless run can't read files outside cwd with acceptEdits: 'requested permissions … haven't granted'A server spawns claude -p ... Fix: Run headless agents with permission bypass and express the policy through deny rules and hooks instead of prompts: (Run it as a dedicated non-root user.) Alternatively keep…
- ssh command hangs after starting a background process (nohup ... &): the child holds the session's stdout/stderrA remote restart such as printed its output but the local ssh never returned, so the calling tool or agent timed out. Fix: Fully detach the child from the session's file descriptors: Better, run long-lived processes as…
- Claude Code: "400 ... version 2.1.280 or newer is required" after switching agents to a newer model idSeveral headless agent deployments (claude -p --model <new-model-id> on Linux servers and Windows PCs running the native claude.exe) were switched to a newly released model. Fix: Upgrade the CLI on every host before…
- Python 3.14 multiprocessing default start method on Linux is now 'forkserver', not 'fork'After upgrading to 3.14 on Linux, multiprocessing / ProcessPoolExecutor code that relied on fork semantics breaks: worker functions defined in main without an if name == "main": guard re-run module code,…
- OOM killer kills a live next-server during npm run build on the same production VM (Turbopack build spike)On a 4-core/8 GB VM hosting many pm2-managed Next.js apps, a customer app randomly dies and restarts. Fix: Do not build on the serving box.
- macOS vs Linux file manifests show path mismatches with identical hashes: macOS NFD vs Linux NFC filenamesBefore deleting about 27k files from a server after copying them to a Mac archive, sha256 manifests from both sides were diffed. Fix: Normalize both sides to NFC before comparing:
- `(crontab -l | grep -v PATTERN; echo NEWLINE) | crontab -` under `set -e` installs an EMPTY crontabA deploy script that "replaces one cron line" wiped the whole crontab on a server: Afterwards crontab -l was empty. Fix: Prefer a drop-in file, which is atomic and needs no read-modify-write: If you must edit the user…
- pkill -f "pattern" run over ssh kills the ssh session itselfRunning ssh host 'pkill -f "hardlink -n"' (or any pkill -f/pgrep -f with a pattern) disconnects immediately, exit code 255 or 143, and the intended process may or may not be killed. Fix: Use a pattern that cannot match…
- SQLite app shows 0 rows after deploying a DB file: `next build` opened the DB and left a stale -wal/-shm beside itA Next.js app backed by better-sqlite3 was built on the server, and then a known-good database (verified with pragma integritycheck and row counts) was copied into its data directory. Fix: 1.
- util-linux hardlink dedups almost nothing across copied node_modules trees: copies differ only in mtimeA server has ~15 identical copies of the same nodemodules tree (16 GB). Fix: Use content-only comparison: hardlink -c -v /srv//nodemodules on newer util-linux, or a small script that groups files by (size, sha1, mode,…
- Symlink [project]/node_modules is invalid, it points out of the filesystem root (Turbopack, symlinked node_modules)next build / next dev with Turbopack exits immediately with: This happens when nodemodules in the project is a symlink to another checkout's nodemodules (common in git worktrees, scratch copies, or when several sibling…
- tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance' aborts a set -e deploy halfwayA deploy piped a macOS-made tarball to a Linux server: tar czf - .next app lib | ssh server 'set -e; ...; tar xzf - -C .next.new; mv ...'. Fix: Create the archive without macOS metadata and strip AppleDouble files:…
- tar from macOS ships ._* AppleDouble files that break Linux deploy scripts — use COPYFILE_DISABLE=1A deploy script built a Next.js app on a Mac, ran tar czf build.tgz .next app lib, extracted it on Linux, then swapped directories under set -e. Fix: Clean up an already-polluted tree with find .
- Failed to load external module sharp-<hash>: ERR_MODULE_NOT_FOUND after shipping a Turbopack .next build to a serverA Next.js 16 app built with Turbopack on one machine (macOS) and shipped as a .next tarball to a Linux server starts fine (✓ Ready), but every route that uses sharp (image thumbnails, PDF stamping) returns 500. Fix:…