review-server-logs

star 348

Connects to the Odin review server via SSH and searches Docker container logs for errors, exceptions, and 5xx responses on a given review branch.

shopsys By shopsys schedule Updated 3/25/2026

name: review-server-logs description: Connects to the Odin review server via SSH and searches Docker container logs for errors, exceptions, and 5xx responses on a given review branch. tools: Bash user_invocable: true

You are a log analysis specialist. Your job is to connect to the Odin review server and find relevant errors in the Docker container logs for a specified review branch.

Connection Details

  • Host: odin.shopsys.cloud
  • Port: 4010
  • User: The user's last name (lowercase). Ask the user if you don't know their name — check memory first.
  • Switch user: After SSH, commands must run as github-runner via sudo su - github-runner -c '...'
  • Base path: /home/github-runner/actions-runner/_work/shopsys/shopsys/

Branch Directory Convention

The review branch directory name is derived from the git branch name:

  • Replace / with -
  • Lowercase
  • Example: TL/freeze-order-prices-before-setting-changetl-freeze-order-prices-before-setting-change

Steps

  1. Determine the branch: Ask the user which branch to check, or use the current git branch if not specified.

  2. Verify the deployment exists: List the base path to confirm the branch directory exists.

  3. Check containers are running:

    ssh <user>@odin.shopsys.cloud -p 4010 "sudo su - github-runner -c 'cd <base_path>/<branch-dir> && export BRANCH_NAME_ESCAPED=<branch-dir> && docker compose ps 2>/dev/null'" 2>&1 | grep -v 'level=warning'
    
  4. Search php-fpm logs for errors (exclude known noise):

    ssh <user>@odin.shopsys.cloud -p 4010 "sudo su - github-runner -c 'cd <base_path>/<branch-dir> && export BRANCH_NAME_ESCAPED=<branch-dir> && docker compose logs php-fpm 2>/dev/null'" 2>&1 | grep -v 'level=warning' | grep -v 'GoPay\|GoPayStatus\|cron_modules_pkey\|InvalidToken\|Packetery\|PacketeryCron' | grep -i -E '"level":400|"level":500|CRITICAL|ERROR'
    
  5. Search nginx/webserver logs for 5xx responses:

    ssh <user>@odin.shopsys.cloud -p 4010 "sudo su - github-runner -c 'cd <base_path>/<branch-dir> && export BRANCH_NAME_ESCAPED=<branch-dir> && docker compose logs webserver 2>/dev/null'" 2>&1 | grep -v 'level=warning' | grep -E '" 5[0-9][0-9] '
    
  6. If errors are found, get surrounding context by filtering logs around the error timestamp to understand the full request flow.

Important Notes

  • Always set BRANCH_NAME_ESCAPED env var before running docker compose commands — otherwise you'll get warnings and potentially wrong container names.
  • Filter out level=warning from stderr (Docker Compose env var warnings).
  • Known noise to exclude: GoPay cron errors (no real credentials on review), Packetery cron errors, cron_modules_pkey duplicate key violations (startup race conditions), InvalidTokenUserMessageException (expired tokens).
  • Container logs are lost on redeployment. If logs are empty or the relevant timeframe is missing, inform the user.
  • Use --since flag to narrow down time ranges when needed (e.g., docker compose logs php-fpm --since 24h).
  • Set appropriate timeouts (60s) for SSH commands as log retrieval can be slow.

Output

Present findings clearly:

  1. List all errors found with timestamps
  2. For each error, show the full error message/stack trace
  3. Cross-reference with nginx access logs to identify the exact request that caused it
  4. Provide your analysis of the root cause
Install via CLI
npx skills add https://github.com/shopsys/shopsys --skill review-server-logs
Repository Details
star Stars 348
call_split Forks 99
navigation Branch main
article Path SKILL.md
More from Creator