Skip to content

Latest commit

 

History

History
901 lines (673 loc) · 36.9 KB

troubleshooting.md

File metadata and controls

901 lines (673 loc) · 36.9 KB

Troubleshooting Guide

Solutions to common issues when running HolyClaude.


Common Issues

Web UI breaks under a Tailscale or reverse-proxy subpath

Symptom: Serving at root works, but a path mount such as /holyclaude loads a broken page or requests /assets, /api, /ws, /shell, /sw.js, or /manifest.json from the hostname root.

Cause: The proxy mounted HolyClaude under a path, but the container was not told which base path to use.

Fix: Set the base path and recreate the container:

environment:
  - HOLYCLAUDE_BASE_PATH=/holyclaude

Then publish the same path through Tailscale Serve:

sudo tailscale serve --bg --https=443 --set-path=/holyclaude http://127.0.0.1:3001

Do not add a trailing slash. If you serve HolyClaude at the hostname root, leave HOLYCLAUDE_BASE_PATH unset.


SSH does not start

Symptom: HOLYCLAUDE_SSH_ENABLE=true is set, but port 22 is not listening inside the container.

Cause: SSH fails closed when the public-key file is missing, empty, writable by claude, or mounted from an unsafe path such as /home/claude/.claude or /workspace.

Fix: Mount a separate read-only public-key file:

volumes:
  - ./data/ssh/authorized_keys:/run/holyclaude-ssh/authorized_keys:ro
environment:
  - HOLYCLAUDE_SSH_ENABLE=true

Create it from a public key, not a private key:

mkdir -p data/ssh
cp ~/.ssh/id_ed25519.pub data/ssh/authorized_keys

Then recreate the container:

docker compose up -d

Mosh connects over SSH but cannot reach the session

Symptom: SSH works, but Mosh hangs after authentication or reports that it cannot contact the server.

Cause: Mosh uses SSH to start mosh-server, then switches to UDP. The default HolyClaude example uses UDP 60000-60010. If that range is not mapped and reachable, the SSH part can work while the Mosh session cannot.

Fix: Enable Mosh and map the UDP range:

ports:
  - "127.0.0.1:2222:22"
  - "127.0.0.1:60000-60010:60000-60010/udp"
environment:
  - HOLYCLAUDE_SSH_ENABLE=true
  - HOLYCLAUDE_MOSH_ENABLE=true

Connect with the same range:

mosh --ssh="ssh -p 2222" -p 60000:60010 claude@127.0.0.1

Keep the UDP range behind localhost, VPN, Tailscale, or a firewall rule.


SSH host key changed after container recreate

Symptom: Your SSH client warns that the host identification changed.

Cause: SSH host keys live in /var/lib/holyclaude-ssh/host_keys. If that path is not backed by a named volume or bind mount, recreating the container can generate new host keys.

Fix: Add the SSH state volume:

services:
  holyclaude:
    volumes:
      - holyclaude-ssh:/var/lib/holyclaude-ssh

volumes:
  holyclaude-ssh:

If the old container was trusted and expected to be replaced, remove the old host key from your SSH client's known_hosts entry for that host and port.


CloudCLI shows wrong default directory

Symptom: CloudCLI web UI opens to /home/claude instead of /workspace.

Cause: A custom or modified CloudCLI service script did not set WORKSPACES_ROOT=/workspace before launching CloudCLI.

Fix: Already handled in HolyClaude. The s6 run script uses with-contenv, exports WORKSPACES_ROOT=/workspace, then starts CloudCLI as the claude user. If you've modified the s6 service scripts, keep that export before the cloudcli --port 3001 command.


CloudCLI says "Failed to browse filesystem"

Symptom: The CloudCLI folder picker cannot open ~, /workspace, or a broad NAS mount such as /volume2/docker:/workspace.

Cause: HolyClaude 1.3.3 could remove CloudCLI's expandWorkspacePath helper while disabling CloudCLI's in-container self-update path. That left the patched runtime calling a helper that was no longer defined.

Fix: Update to HolyClaude 1.3.4 or newer:

docker compose pull
docker compose up -d

Broad NAS mounts are supported, but remember that /workspace is the CloudCLI boundary. Anything readable under that mount is visible to authenticated CloudCLI users. Prefer a narrower project mount when you do not want the whole NAS folder tree exposed inside CloudCLI.


CloudCLI Web Terminal shows black squares or missing characters

Symptom: The Web Terminal is unreadable. Box drawing, emoji, CJK text, or CLI banners show as black squares, missing letters, or broken characters.

Cause: Older HolyClaude images built the CloudCLI Web Terminal plugin with string-based PTY output handling and a narrow xterm.js font stack. Split multibyte PTY chunks could reach the browser as malformed text, and WebGL glyph rendering could still choose a weak fallback font.

Fix: Update to HolyClaude 1.3.5 or newer:

docker compose pull
docker compose up -d

HolyClaude now patches the baked Web Terminal plugin before build so PTY output is decoded from raw UTF-8 bytes and xterm.js gets explicit terminal font fallbacks.

If the updated image still shows black squares in one browser, disable the WebGL terminal renderer for that browser profile:

localStorage.setItem('web-terminal-disable-webgl', 'true')

Then close and reopen the Web Terminal tab. This keeps the Docker image the same; it only changes the renderer preference stored by your browser for CloudCLI.


SQLite "database is locked" errors

Symptom: Constant lock errors from CloudCLI account database or other SQLite databases.

Cause: SQLite uses file-level locking that CIFS/SMB doesn't support properly.

Fix: Don't store SQLite databases on network mounts. HolyClaude keeps .cloudcli in container-local storage for this reason. If you're using your own SQLite databases in /workspace on a network mount, move them to a local path.

If you want the CloudCLI account to persist across rebuilds, use a Docker-local named volume for /home/claude/.cloudcli (see the README's Data & Persistence section). Use the default local storage, not an NFS/SMB volume driver or remote-storage options. A volume name alone does not guarantee local storage. Never bind-mount .cloudcli to a NAS, SMB, or NFS path.


CloudCLI reports "unable to open database file"

Symptom: CloudCLI repeatedly reports unable to open database file after /home/claude/.cloudcli is mounted.

Cause: The mounted directory or an existing SQLite file is not writable by the container's runtime UID/GID. This is an ownership or read-only mount problem, not SQLite network locking.

Fix: Upgrade to v1.5.3 or later. HolyClaude now prepares the directory, repairs existing local-volume ownership during root-starting Docker startup, and stops before CloudCLI starts if the runtime user still cannot write it.

For an older image, repair a local named volume once:

docker compose run --rm --user root --entrypoint sh holyclaude \
  -c 'mkdir -p /home/claude/.cloudcli && chown -R "${PUID:-1000}:${PGID:-1000}" /home/claude/.cloudcli'
docker compose up -d

Do not use this command against NAS, SMB/CIFS, or NFS storage. For rootless Podman, use the provided keep-id Compose file with :Z; do not add :U unless you intentionally want Podman to rewrite host ownership.


Chromium crashes or blank pages

Symptom: Playwright tests fail, screenshots are blank, Lighthouse hangs.

Cause: Usually insufficient shared memory. Docker defaults to 64MB. If the process exits immediately with SIGTRAP or exit 133, treat that as a separate browser/runtime failure instead of a shared-memory symptom.

Fix: Ensure shm_size: 2g or higher in your docker-compose file. If running many concurrent tabs, increase to 4g. If you still get an immediate SIGTRAP, re-check the browser build path before only raising shm.

In v1.5.5, direct Chromium, Node Playwright, Python Playwright, and CloudCLI Browser Use all use the pinned Debian Chromium security build baked into the image. /usr/bin/chromium is the supported command; a runtime playwright install is not part of the repair path.


File watchers not detecting changes

Symptom: Hot reload doesn't work. Dev servers don't pick up file changes.

Cause: Running on SMB/CIFS mounts which don't support inotify.

Fix: Add polling environment variables:

environment:
  - CHOKIDAR_USEPOLLING=1
  - WATCHFILES_FORCE_POLLING=true

Note: Polling uses more CPU than inotify. Only enable when needed.


Telegram notifications do not arrive

Symptom: notify-on exists and NOTIFY_TELEGRAM is set, but no Telegram message arrives.

Cause: Telegram uses Apprise's tgram:// URL scheme. Older HolyClaude docs showed a shorter Telegram scheme that Apprise rejects.

Fix: Use the current Telegram format:

environment:
  - NOTIFY_TELEGRAM=tgram://bot_token/chat_id

Legacy Telegram values are normalized for compatibility, but tgram:// is the supported format for new setups.

Check the setup without sending a message:

docker compose exec holyclaude /usr/local/bin/notify.py test --dry-run --debug

If the dry run passes but Telegram still does not receive the real test, run the same command without --dry-run, then check the bot token, chat ID, and container network access.


Permission denied errors

Symptom: Can't write files, git operations fail, npm install fails.

Cause: Usually one of these:

  • Docker-style PUID/PGID doesn't match your host user
  • Docker auto-created ./workspace as root:root on first start because the directory did not exist yet

Fix for Docker: Set PUID and PGID to match your host user:

# On your host, check your IDs
id -u  # This is your PUID
id -g  # This is your PGID

Then in your compose file:

environment:
  - PUID=1000
  - PGID=1000

HolyClaude also auto-fixes the top-level /workspace ownership on boot if Docker created it as root. If you still have permission errors after startup, the remaining mismatch is in your host files, not the container's workspace mount point.

Fix for rootless Podman on SELinux: Use the Podman compose profile:

mkdir -p data/claude data/cloudcli workspace
podman compose -f docker-compose.podman-rootless.yaml up -d

Rootless Podman maps container IDs through /etc/subuid and /etc/subgid by default, so PUID=1000 does not guarantee host-visible UID 1000. The Podman profile uses userns_mode: "keep-id:uid=1000,gid=1000" and :Z labels so host and container edits both work under the same user. Keep :Z; it handles SELinux labeling. Do not add :U to /workspace; it recursively rewrites host ownership for the container namespace and can make normal host editing fail.

On Synology, QNAP, SMB/CIFS, and some NFS mounts, chmod and chown from inside the container may be ignored by the host filesystem. Use the NAS share settings, mount options, or matching PUID/PGID values to make ./data/claude and ./workspace writable.


rm -rf * doesn't delete dotfiles

Symptom: Bootstrap sentinel (.holyclaude-bootstrapped) survives deletion, so bootstrap never re-runs.

Cause: Bash glob * doesn't match dotfiles (files starting with .).

Fix: Target the sentinel directly:

rm ./data/claude/.holyclaude-bootstrapped

Never delete the entire ./data/claude/ directory — this wipes your credentials.


claude: command not found after mounting a home directory

Symptom: CloudCLI reports that the Claude Code native binary is unavailable, or a terminal exits with claude: command not found.

Cause: HolyClaude installs Claude Code at /home/claude/.local/bin/claude. A bind mount over /home or /home/claude hides /home/claude/.local and the other application files supplied by the image. An API key can authenticate an available CLI, but it cannot replace a hidden executable.

Fix: Do not mount /home or /home/claude. /home/claude/.local is image-owned. Keep the original host directory as a backup, copy the supported persistent state into a fresh selective mount, and leave the backup in place until the recovered container and credentials have been checked.

Run the command from the Compose project directory that owns the affected holyclaude service. Set home_mount_target to the container destination used by the old broad mount. The default /home matches the reported Compose configuration. Use /home/claude only when the old mount targeted that exact path. Before stopping anything, the command requires exactly one retained Compose container and verifies that its bind-mount source resolves to old_home at that exact destination. A wrong directory, missing or ambiguous container, named volume, or different source/destination exits without moving host data.

Then verify and stop that exact container, and stage the old home without deleting it:

# HolyClaude host-side home recovery
set -euo pipefail
umask 077
: "${old_home:=/mnt/docker/holyclaude/home}"
: "${new_claude:=/mnt/docker/holyclaude/data/claude}"
: "${home_mount_target:=/home}"

case "$home_mount_target" in
  /home) source_suffix=/claude ;;
  /home/claude) source_suffix= ;;
  *)
    echo "Expected home_mount_target to be /home or /home/claude" >&2
    exit 1
    ;;
esac

[ -d "$old_home" ] && [ ! -L "$old_home" ] || {
  echo "Expected a real directory: $old_home" >&2
  exit 1
}
old_home="$(realpath -- "$old_home")"
: "${backup:=${old_home}.backup-$(date +%Y%m%d-%H%M%S)}"
source_home="$backup$source_suffix"

compose_ids="$(docker compose ps -a -q holyclaude)" || {
  echo "Could not resolve the holyclaude Compose service. Run this from its Compose project directory." >&2
  exit 1
}
set -- $compose_ids
if [ "$#" -ne 1 ]; then
  echo "Expected exactly one holyclaude Compose container; found $#" >&2
  exit 1
fi
compose_container="$1"

mount_records="$(docker inspect --format '{{range .Mounts}}{{printf "%s\t%s\t%s\n" .Type .Source .Destination}}{{end}}' "$compose_container")" || {
  echo "Could not inspect Compose container: $compose_container" >&2
  exit 1
}
verified_mounts=0
while IFS="$(printf '\t')" read -r mount_type mount_source mount_destination; do
  [ "$mount_type" = bind ] || continue
  [ "$mount_destination" = "$home_mount_target" ] || continue
  resolved_mount_source="$(realpath -- "$mount_source" 2>/dev/null)" || continue
  [ "$resolved_mount_source" = "$old_home" ] || continue
  verified_mounts=$((verified_mounts + 1))
done <<EOF
$mount_records
EOF
if [ "$verified_mounts" -ne 1 ]; then
  echo "Container $compose_container does not have exactly one verified bind mount from $old_home to $home_mount_target" >&2
  exit 1
fi

if [ -e "$backup" ] || [ -L "$backup" ] || [ -e "$new_claude" ] || [ -L "$new_claude" ]; then
  echo "Refusing an existing backup or durable target" >&2
  exit 1
fi
docker stop "$compose_container" >/dev/null
move_status=0
mv -T -n -- "$old_home" "$backup" || move_status=$?
if [ -e "$old_home" ] || [ -L "$old_home" ] || [ ! -d "$backup" ] || [ -L "$backup" ]; then
  echo "Host paths changed while stopping the container; old home was not moved" >&2
  exit 1
fi
if [ "$move_status" -ne 0 ]; then
  echo "Moving the old home failed with status $move_status; inspect $backup and restore it before retrying" >&2
  exit 1
fi

[ -d "$source_home" ] && [ ! -L "$source_home" ] || {
  echo "Expected a real directory: $source_home" >&2
  exit 1
}

new_parent="${new_claude%/*}"
if [ -L "$new_parent" ] || { [ -e "$new_parent" ] && [ ! -d "$new_parent" ]; }; then
  echo "Refusing unsafe durable parent: $new_parent" >&2
  exit 1
fi
install -d -m 0700 "$new_parent"
stage="$(mktemp -d "${new_claude}.recovery-stage.XXXXXX")"
trap 'rm -rf -- "$stage"' EXIT HUP INT TERM

migrate_state() {
  source="$1"
  relative_target="$2"
  kind="$3"
  target="$stage/$relative_target"
  if [ -L "$target" ]; then
    echo "Refusing symbolic link durable target: $target" >&2
    return 1
  fi
  if [ -e "$target" ]; then
    if [ "$kind" = file ] && [ ! -f "$target" ]; then
      echo "Expected regular file durable target: $target" >&2
      return 1
    fi
    if [ "$kind" = directory ] && [ ! -d "$target" ]; then
      echo "Expected directory durable target: $target" >&2
      return 1
    fi
  fi
  if [ -L "$source" ]; then
    if [ "$(readlink -- "$source")" = "/home/claude/.claude/$relative_target" ]; then
      if { [ "$kind" = file ] && [ -f "$target" ]; } || { [ "$kind" = directory ] && [ -d "$target" ]; }; then
        return 0
      fi
    fi
    echo "Refusing symbolic link source: $source" >&2
    return 1
  fi
  [ -e "$source" ] || return 0
  if [ "$kind" = file ] && [ ! -f "$source" ]; then
    echo "Expected regular file source: $source" >&2
    return 1
  fi
  if [ "$kind" = directory ] && [ ! -d "$source" ]; then
    echo "Expected directory source: $source" >&2
    return 1
  fi
  if [ -e "$target" ] || [ -L "$target" ]; then
    if [ "$relative_target" = .claude.json.persist ] && [ -f "$target" ] && [ ! -L "$target" ] && cmp -s -- "$source" "$target"; then
      return 0
    fi
    echo "Refusing to replace existing durable state: $target" >&2
    return 1
  fi
  cp -a -- "$source" "$target"
}

[ ! -L "$source_home/.claude" ] || {
  echo "Refusing symbolic link source: $source_home/.claude" >&2
  exit 1
}
if [ -e "$source_home/.claude" ] && [ ! -d "$source_home/.claude" ]; then
  echo "Expected directory source: $source_home/.claude" >&2
  exit 1
fi
if [ -d "$source_home/.claude" ]; then
  cp -a -- "$source_home/.claude/." "$stage/"
fi

if [ -L "$stage/.config" ] || { [ -e "$stage/.config" ] && [ ! -d "$stage/.config" ]; }; then
  echo "Refusing unsafe durable directory: $stage/.config" >&2
  exit 1
fi
install -d -m 0700 "$stage/.config"

migrate_state "$source_home/.bash_aliases" .bash_aliases file
migrate_state "$source_home/.gitconfig" .gitconfig file
migrate_state "$source_home/.config/git" .config/git directory
migrate_state "$source_home/.config/gh" .config/gh directory
migrate_state "$source_home/.codex" .codex directory
migrate_state "$source_home/.gemini" .gemini directory
migrate_state "$source_home/.cursor" .cursor directory
migrate_state "$source_home/.claude.json" .claude.json.persist file

move_status=0
mv -T -n -- "$stage" "$new_claude" || move_status=$?
if [ -e "$stage" ] || [ -L "$stage" ] || [ ! -d "$new_claude" ] || [ -L "$new_claude" ]; then
  echo "Durable target changed before install: $new_claude" >&2
  exit 1
fi
if [ "$move_status" -ne 0 ]; then
  echo "Installing the durable target failed with status $move_status; inspect $new_claude before retrying" >&2
  exit 1
fi
printf 'Original home retained at %s\n' "$backup"

This stages the complete recovery before installing data/claude. Exact HolyClaude-managed links are accepted only when their real durable targets were copied from .claude; other links and wrong source types are rejected. Identical live and saved Claude session files are accepted. Different copies stop recovery so you can choose which state to retain without losing either. Other target collisions also stop recovery. The backup remains unchanged after the move. If the command stops after that move, confirm that both $old_home and $new_claude are absent, move $backup back to $old_home, resolve the reported conflict without discarding either copy, and rerun the command. Never delete the backup to clear an error.

Then replace the broad home mount with selective mounts and recreate the container:

services:
  holyclaude:
    volumes:
      - /mnt/docker/holyclaude/data/claude:/home/claude/.claude
      - /mnt/docker/holyclaude/workspace:/workspace
      # Optional: Docker-local persistence for the CloudCLI account database.
      - cloudcli-data:/home/claude/.cloudcli

volumes:
  cloudcli-data:
docker compose up -d --force-recreate
docker compose logs holyclaude
docker compose exec holyclaude claude --version

HolyClaude does not download or reinstall Claude Code at startup. If the executable is hidden, startup stops with the affected path and mount guidance.

The persistent paths are deliberately narrower than the user home:

Live container path Durable location Persistence behavior
/home/claude/.claude ./data/claude Primary bind mount for Claude settings, credentials, memory, hooks, and redirected CLI state
/home/claude/.claude.json ./data/claude/.claude.json.persist Restored from and synchronized into the .claude bind mount
/home/claude/.codex ./data/claude/.codex Symlinked to .claude/.codex on every boot
/home/claude/.gemini ./data/claude/.gemini Symlinked to .claude/.gemini on every boot
/home/claude/.cursor ./data/claude/.cursor Managed alias to .claude/.cursor only when the live path is absent; an existing real directory or custom link remains user-managed
/home/claude/.bash_aliases ./data/claude/.bash_aliases Migrated and symlinked to .claude/.bash_aliases for interactive shell aliases
/home/claude/.gitconfig ./data/claude/.gitconfig Migrated and symlinked unless explicitly overridden
/home/claude/.config/git ./data/claude/.config/git Migrated and symlinked unless explicitly overridden
/home/claude/.config/gh ./data/claude/.config/gh Migrated and symlinked unless explicitly overridden; may contain a token
/home/claude/.cloudcli cloudcli-data named volume Optional CloudCLI account database persistence on Docker-local storage
/workspace ./workspace Projects and working files
/home/claude/.local None Application files are image-owned and replaced by image upgrades

Inspect and migrate an existing /home/claude/.cursor before relying on ./data/claude/.cursor for Cursor persistence.

If startup reports that .claude, .codex, .gemini, or .cursor must be a real directory, keep the mounted data as your backup and inspect the paths without following links:

docker compose run --rm --no-deps --entrypoint sh holyclaude -lc '
for path in /home/claude/.claude /home/claude/.claude/.codex /home/claude/.codex /home/claude/.claude/.gemini /home/claude/.gemini /home/claude/.claude/.cursor /home/claude/.cursor; do
  if [ -L "$path" ]; then printf "%s -> %s\n" "$path" "$(readlink "$path")"; else ls -ld "$path" 2>/dev/null || true; fi
done
'

Do not delete or replace these paths until you have identified which copy contains your settings and credentials. HolyClaude only manages its exact generated top-level aliases, such as /home/claude/.codex -> /home/claude/.claude/.codex, and only when the durable directory chain is intact. Other dangling links, link loops, linked durable directories, and conflicting managed state stop startup with the affected paths shown so you can preserve and reconcile the state outside the container. A separate real directory mounted at a top-level CLI path remains user-managed.

If the old broad mount contains CloudCLI account data under $source_home/.cloudcli ($backup/claude/.cloudcli for /home, or $backup/.cloudcli for /home/claude), keep the backup until that account has been migrated separately or you have confirmed that a fresh CloudCLI login is acceptable. Do not copy its SQLite database while CloudCLI is running, and do not place it on network storage.


Too many levels of symbolic links on Synology

Symptom: Startup stops while checking .claude or .codex and reports Too many levels of symbolic links.

Cause: A bind-mounted state path contains a self-referencing link, a multi-link loop, a dangling link, or a linked directory where HolyClaude requires a real directory. HolyClaude v1.6.0 and later detects unsafe CLI state before UID/GID changes. It does not repair existing link loops. The exact layout and origin reported in issue #97 are not yet known, so do not assume that the reporter mounted ./data/claude or that the container's top-level .codex has a separate host mapping.

Stop the affected container first. Keep the current bind directory and every backup unchanged. This read-only diagnostic requires the container to be stopped, derives the actual bind source for /home/claude/.claude, and refuses missing, duplicate, or non-bind mount metadata before it examines the host path.

# HolyClaude stopped-container link-loop diagnostic
set -euo pipefail
container=holyclaude
destination=/home/claude/.claude

running="$(docker inspect --format '{{.State.Running}}' "$container")" || {
  echo "Could not inspect container: $container" >&2
  exit 1
}
[ "$running" = false ] || {
  echo "Stop $container before running this diagnostic" >&2
  exit 1
}

mount_records="$(docker inspect --format '{{range .Mounts}}{{printf "%s\t%s\t%s\n" .Type .Source .Destination}}{{end}}' "$container")" || {
  echo "Could not inspect mounts for container: $container" >&2
  exit 1
}
mount_count=0
mount_type=
mount_source=
while IFS="$(printf '\t')" read -r candidate_type candidate_source candidate_destination; do
  [ "$candidate_destination" = "$destination" ] || continue
  mount_count=$((mount_count + 1))
  mount_type="$candidate_type"
  mount_source="$candidate_source"
done <<EOF
$mount_records
EOF
[ "$mount_count" -eq 1 ] || {
  echo "Expected exactly one mount at $destination; found $mount_count" >&2
  exit 1
}
[ "$mount_type" = bind ] || {
  echo "Expected a bind mount at $destination; found $mount_type" >&2
  exit 1
}
case "$mount_source" in
  /*) ;;
  *)
    echo "Expected an absolute bind source: $mount_source" >&2
    exit 1
    ;;
esac

path_cursor=
path_remainder="${mount_source#/}"
while [ -n "$path_remainder" ]; do
  case "$path_remainder" in
    */*) path_component="${path_remainder%%/*}"; path_remainder="${path_remainder#*/}" ;;
    *) path_component="$path_remainder"; path_remainder= ;;
  esac
  [ -n "$path_component" ] || continue
  case "$path_component" in
    .|..)
      echo "Refusing non-canonical bind source: $mount_source" >&2
      exit 1
      ;;
  esac
  path_cursor="$path_cursor/$path_component"
  ls -ld -- "$path_cursor" || {
    echo "Bind source does not exist: $mount_source" >&2
    exit 1
  }
  [ ! -L "$path_cursor" ] || {
    echo "Refusing symbolic link in bind source path: $path_cursor" >&2
    exit 1
  }
done
[ -d "$mount_source" ] || {
  echo "Expected a real directory bind source: $mount_source" >&2
  exit 1
}
printf 'Verified bind source: %s\n' "$mount_source"

codex_path="$mount_source/.codex"
if [ -e "$codex_path" ] || [ -L "$codex_path" ]; then
  ls -ld -- "$codex_path"
  if [ -L "$codex_path" ]; then
    printf '%s -> %s\n' "$codex_path" "$(readlink -- "$codex_path")"
  fi
else
  printf 'No .codex entry at %s\n' "$codex_path"
fi

This host-side check does not inspect the container's top-level .codex. Mount metadata cannot prove that path's filesystem type or give it a separate host mapping. Do not use docker cp here because even an archive-listing pipeline streams the credential tree. If any prerequisite fails, stop there. Do not recurse through the source, inspect credential contents, delete or relink anything, run chown, restart the container, or update the image as part of diagnosis.

Include the deployed image digest and the sanitized startup diagnostic when reporting the result. Get the digest from the stopped container's image identity:

image_id="$(docker inspect --format '{{.Image}}' holyclaude)"
docker image inspect --format '{{json .RepoDigests}}' "$image_id"

Sanitize the startup diagnostic before sharing it. Keep the exact error and affected container paths, but remove tokens, account names, NAS share names, and unrelated environment values. The diagnostic identifies the current topology; it does not prove the cause of issue #97 or confirm a fix. Preserve the bind source and backups for a separate recovery decision.


Docker creates .claude.json as a directory

Symptom: Claude Code CLI crashes on startup with cryptic errors.

Cause: If the bind-mount target doesn't exist as a file before container start, Docker creates it as a directory.

Fix: Already handled in entrypoint.sh — it restores the saved session file first, or creates a safe default file when no saved session exists. If you're running a custom setup, ensure ~/.claude.json is a file and keep the durable copy in ~/.claude/.claude.json.persist.


Claude Code asks to re-login after rebuild

Symptom: After docker compose down && up, Claude Code prompts for OAuth / API key again.

Cause: Versions before v1.3.6 could let a fresh container default file overwrite the saved ~/.claude/.claude.json.persist copy before restore happened.

Fix: Upgrade to v1.3.6 or later:

docker compose pull
docker compose up -d

HolyClaude now restores ./data/claude/.claude.json.persist before startup can create a fresh default file. It also refuses to replace a valid saved session with empty, invalid, or onboarding-only state.

If you still lose the session, check that ./data/claude/ is writable by the container user. On Synology, QNAP, SMB/CIFS, or other NAS-backed mounts, Unix permission changes from inside the container are best effort. Fix the host share ownership or set PUID/PGID to match the account that owns the mounted folder.


Git identity or gh auth disappears after recreate

Symptom: git config --global values or gh auth status work in one container but disappear after the container is removed and recreated.

Fix: If you are upgrading from an older image and the current container still has Git or gh state, migrate it before Compose replaces the container. First inspect which paths exist in the old container:

docker compose exec holyclaude sh -lc '
  for path in /home/claude/.gitconfig /home/claude/.config/git /home/claude/.config/gh; do
    if [ -e "$path" ] || [ -L "$path" ]; then ls -ld "$path"; fi
  done
'

Make an encrypted backup of ./data/claude with a backup tool you trust before continuing. The command below does not create that backup. It copies any existing live state into a temporary directory inside the already credential-bearing ./data/claude mount, follows live symlinks, checks all three durable targets before moving anything, and removes the temporary directory when it exits:

(
set -euo pipefail
umask 077

ensure_directory() {
  path="$1"
  if [ -L "$path" ]; then
    echo "Refusing symlinked durable directory: $path" >&2
    return 1
  fi
  if [ -e "$path" ] && [ ! -d "$path" ]; then
    echo "Refusing non-directory durable path: $path" >&2
    return 1
  fi
  mkdir -p "$path"
  if [ -L "$path" ] || [ ! -d "$path" ]; then
    echo "Durable directory changed while preparing migration: $path" >&2
    return 1
  fi
}

ensure_directory ./data
ensure_directory ./data/claude
ensure_directory ./data/claude/.config

stage="$(mktemp -d ./data/claude/.holyclaude-v1.5.5-stage.XXXXXX)"
trap 'rm -rf "$stage"' EXIT HUP INT TERM

copy_if_present() {
  source="$1"
  name="$2"
  if docker compose exec -T holyclaude sh -c '
    if [ -e "$1" ] || [ -L "$1" ]; then exit 0; fi
    exit 3
  ' sh "$source"; then
    docker compose cp -L "holyclaude:$source" "$stage/$name"
  else
    status="$?"
    if [ "$status" -eq 3 ]; then return 0; fi
    echo "Could not inspect live state: $source" >&2
    return "$status"
  fi
}

check_target() {
  source="$1"
  target="$2"
  [ -e "$source" ] || return 0
  if [ -e "$target" ] || [ -L "$target" ]; then
    echo "Refusing to replace existing durable state: $target" >&2
    return 1
  fi
}

move_if_staged() {
  source="$1"
  target="$2"
  [ -e "$source" ] || return 0
  mv -T -n "$source" "$target"
  if [ -e "$source" ] || [ -L "$source" ]; then
    echo "Durable target changed before move: $target" >&2
    return 1
  fi
}

copy_if_present /home/claude/.gitconfig .gitconfig
copy_if_present /home/claude/.config/git git
copy_if_present /home/claude/.config/gh gh

check_target "$stage/.gitconfig" ./data/claude/.gitconfig
check_target "$stage/git" ./data/claude/.config/git
check_target "$stage/gh" ./data/claude/.config/gh

move_if_staged "$stage/.gitconfig" ./data/claude/.gitconfig
move_if_staged "$stage/git" ./data/claude/.config/git
move_if_staged "$stage/gh" ./data/claude/.config/gh

docker compose pull
docker compose up -d
)

HolyClaude v1.5.5 stores global Git config, XDG Git config, and GitHub CLI config below the existing ./data/claude mount. Once the old state is moved there, replacement containers link to it on every boot.

If startup reports both a live and durable path, preserve both and decide which one to keep. HolyClaude refuses to merge or overwrite conflicting configuration automatically.

./data/claude/.config/gh/hosts.yml can contain a plaintext GitHub token when no system credential store is available. HolyClaude sets and verifies mode 0600 at startup. A filesystem that ignores that mode change causes startup to stop, so fix the host mount permissions before retrying. Do not commit data/claude, share it broadly, or store it in an unencrypted backup.


Claude Code installer hangs during build

Symptom: curl -fsSL https://claude.ai/install.sh | bash hangs indefinitely during docker build.

Cause: Installer prompts or behaves differently when WORKDIR is root-owned.

Fix: Already handled in the Dockerfile — WORKDIR /workspace and USER claude are set before the installer runs.


Bootstrap doesn't re-run after image update

Symptom: New settings/memory from updated image aren't applied.

Cause: Sentinel file .holyclaude-bootstrapped exists, so bootstrap is skipped.

Fix:

rm ./data/claude/.holyclaude-bootstrapped
docker compose restart holyclaude

CloudCLI self-update is blocked

Symptom: cloudcli update, the web UI update button, or a manual npm global install tries to replace the CloudCLI files inside the container.

Cause: HolyClaude ships a patched @cloudcli-ai/cloudcli runtime. Replacing it from inside the running container can remove the HolyClaude patches and leave source/runtime paths mismatched. Older images could fail with:

Cannot find package '@/shared' imported from .../@cloudcli-ai/cloudcli/server/index.js

Fix: Recreate the container from the HolyClaude image and use Docker for updates:

docker compose pull
docker compose up -d

Do not run cloudcli update or npm install -g @cloudcli-ai/cloudcli@latest inside the container. HolyClaude disables that self-update path so the patched CloudCLI runtime stays intact.


Codex chat returns to new session

Symptom: A new Codex chat creates the session and sends the first prompt, then CloudCLI returns to the new session view a few seconds later. Reopening the created session manually still works.

Cause: Older images could receive a successful Codex completion event without an explicit success exit code. That left the first-turn session finalization path different from Claude, Cursor, and Gemini.

Fix: Update HolyClaude with Docker:

docker compose pull
docker compose up -d

HolyClaude keeps a Docker-build CloudCLI patch for this path. In v1.4.4 that guard also covers CloudCLI 1.36.x provider-normalized turn_complete events, so successful Codex turns include explicit exitCode: 0, success: true, and aborted: false fields.


Desloppify setup warns and skips a target

Symptom: Container startup logs show a Desloppify warning for opencode, an invalid target, or OPENCODE_CONFIG_DIR.

Cause: HOLYCLAUDE_DESLOPPIFY_SETUP only configures global skill files. HolyClaude skips unsafe or unavailable targets instead of blocking startup.

Fix: Use one of the supported values:

environment:
  - HOLYCLAUDE_DESLOPPIFY_SETUP=all

all means claude,codex,gemini. OpenCode is full-image only and must be requested as opencode. Do not combine claude and opencode; OpenCode can already discover Claude-compatible skills from ~/.claude/skills, so HolyClaude skips opencode to avoid duplicate skill discovery.

Desloppify itself remains installed. Run scans manually from a project:

desloppify scan --path .
desloppify next

After scanning, add .desloppify/ to that project's .gitignore.



SMB/CIFS Gotchas

If your volumes are on a Samba/CIFS network share (common with Hyper-V VMs, NAS devices):

No inotify support

File watchers must use polling:

- CHOKIDAR_USEPOLLING=1
- WATCHFILES_FORCE_POLLING=true

No symlinks (without mfsymlinks)

npm global installs and Python .local can break. This is why HolyClaude keeps .npm and .local in container-local storage — don't mount them on network shares.

If you need symlinks on CIFS, add mfsymlinks to your mount options:

//server/share /mnt/share cifs mfsymlinks,... 0 0

SQLite file locking fails

Any SQLite database on CIFS will get "database is locked" errors. Keep SQLite databases on local storage.

No Unix permissions

chmod/chown can silently succeed but not actually change permissions on CIFS. Use uid=, gid=, file_mode=, and dir_mode= in mount options, or fix the NAS share owner/group directly.


Getting Help

If your issue isn't covered here:

  1. Check the GitHub Issues for existing reports
  2. Open a new issue with:
    • Your docker-compose file (redact API keys)
    • Output of docker logs holyclaude
    • What you expected vs what happened