Skip to main content 首页 创作者 comeonoliver skillshub apify-debug-bundle
apify-debug-bundle Collect Apify debug evidence for support tickets and troubleshooting.
Use when encountering persistent issues, preparing support tickets,
or collecting diagnostic information about failed Actor runs.
Trigger: "apify debug", "apify support bundle", "collect apify logs",
"apify diagnostic", "apify run failed why".
跳到安装 Skills Marketplace 发现并探索由社区构建的 Agent Skills
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ComeOnOliver/skillshub --skill apify-debug-bundle命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
下载 Zip 下载中... 同仓库更多 Skills Review product and feature risk before an AI coding agent starts implementation.
Use Xquik for X data and confirmation-gated X actions: tweet search, user lookup, follower export, media download, monitors, webhooks, MCP, and SDK workflows.
Canton Network open-source ecosystem guide covering DAML SDK, Canton runtime, and Splice applications. Use when working with Canton Network, DAML smart contracts, or building decentralized applications.
name apify-debug-bundle description Collect Apify debug evidence for support tickets and troubleshooting.
Use when encountering persistent issues, preparing support tickets,
or collecting diagnostic information about failed Actor runs.
Trigger: "apify debug", "apify support bundle", "collect apify logs",
"apify diagnostic", "apify run failed why".
allowed-tools Read, Bash(curl:*), Bash(npm:*), Bash(node:*), Bash(tar:*), Bash(apify:*), Grep version 1.0.0 license MIT author Jeremy Longshore <jeremy@intentsolutions.io> tags ["saas","scraping","automation","apify"] compatible-with claude-code
Apify Debug Bundle
Overview
Collect all diagnostic information needed to troubleshoot failed Actor runs and prepare Apify support tickets. Pulls run metadata, logs, dataset samples, and environment info into a single bundle.
Prerequisites
apify-client installed
APIFY_TOKEN configured
A failed or problematic run ID to investigate
Instructions
Step 1: Investigate a Failed Run
import { ApifyClient } from 'apify-client' ;
const client = new ApifyClient ({ token : process.env .APIFY_TOKEN });
async function investigateRun (runId : string ) {
const run = await client.run (runId).get ();
console .log ('=== Run Summary ===' );
console .log (`Status: ${run.status} ` );
console .log (`Message: ${run.statusMessage} ` );
console .log (`Started: ${run.startedAt} ` );
console .log (`Finished: ${run.finishedAt} ` );
console . ( );
. ( );
. ( );
. ( );
. ( );
. ( );
(run. ) {
ds = client. (run. ). ();
. ( );
}
log = client. (runId). (). ();
. ( );
. (log?. (- ));
{ run, log };
}
log
`Memory MB: ${run.options?.memoryMbytes} `
console
log
`Timeout sec: ${run.options?.timeoutSecs} `
console
log
`Build: ${run.buildNumber} `
console
log
`Origin: ${run.meta?.origin} `
console
log
`CU used: ${run.usage?.ACTOR_COMPUTE_UNITS?.toFixed(4 )} `
console
log
`Cost USD: $${run.usageTotalUsd?.toFixed(4 )} `
if
defaultDatasetId
const
await
dataset
defaultDatasetId
get
console
log
`\nDataset items: ${ds.itemCount} `
const
await
run
log
get
console
log
'\n=== Last 2000 chars of log ==='
console
log
slice
2000
return
Step 2: Create Debug Bundle Script #!/bin/bash
RUN_ID="${1:?Usage: apify-debug-bundle.sh <RUN_ID>} "
BUNDLE_DIR="apify-debug-$(date +%Y%m%d-%H%M%S) "
mkdir -p "$BUNDLE_DIR "
echo "Collecting debug info for run $RUN_ID ..."
{
echo "=== Environment ==="
echo "Date: $(date -u) "
echo "Node: $(node --version 2>/dev/null || echo 'not found') "
echo "npm: $(npm --version 2>/dev/null || echo 'not found') "
echo ""
echo "=== Apify Packages ==="
npm list apify-client apify crawlee 2>/dev/null || echo "No packages found"
echo ""
echo "=== Apify CLI ==="
apify --version 2>/dev/null || echo "CLI not installed"
} > "$BUNDLE_DIR /environment.txt"
curl -sf -H "Authorization: Bearer $APIFY_TOKEN " \
"https://api.apify.com/v2/actor-runs/$RUN_ID " | \
jq '.data | {id, actId, status, statusMessage, startedAt, finishedAt,
options: {memoryMbytes: .options.memoryMbytes, timeoutSecs: .options.timeoutSecs},
stats: .stats, usage: .usage, usageTotalUsd}' \
> "$BUNDLE_DIR /run-details.json" 2>/dev/null
curl -sf -H "Authorization: Bearer $APIFY_TOKEN " \
"https://api.apify.com/v2/actor-runs/$RUN_ID /log" \
> "$BUNDLE_DIR /run-log.txt" 2>/dev/null
DATASET_ID=$(jq -r '.defaultDatasetId // empty' "$BUNDLE_DIR /run-details.json" 2>/dev/null)
if [ -n "$DATASET_ID " ]; then
curl -sf -H "Authorization: Bearer $APIFY_TOKEN " \
"https://api.apify.com/v2/datasets/$DATASET_ID /items?limit=5" \
> "$BUNDLE_DIR /dataset-sample.json" 2>/dev/null
fi
KV_ID=$(jq -r '.defaultKeyValueStoreId // empty' "$BUNDLE_DIR /run-details.json" 2>/dev/null)
if [ -n "$KV_ID " ]; then
curl -sf -H "Authorization: Bearer $APIFY_TOKEN " \
"https://api.apify.com/v2/key-value-stores/$KV_ID /keys" \
> "$BUNDLE_DIR /kv-store-keys.json" 2>/dev/null
fi
if [ -f .env ]; then
sed 's/=.*/=***REDACTED***/' .env > "$BUNDLE_DIR /env-redacted.txt"
fi
curl -sf https://api.apify.com/v2/health > "$BUNDLE_DIR /platform-health.json" 2>/dev/null
tar -czf "$BUNDLE_DIR .tar.gz" "$BUNDLE_DIR "
rm -rf "$BUNDLE_DIR "
echo "Bundle created: $BUNDLE_DIR .tar.gz"
echo ""
echo "Attach this file to your Apify support ticket."
Step 3: Compare Successful vs Failed Runs async function compareRuns (successId : string , failId : string ) {
const success = await client.run (successId).get ();
const fail = await client.run (failId).get ();
console .log ('=== Run Comparison ===' );
const fields = [
'status' , 'buildNumber' , 'options.memoryMbytes' ,
'options.timeoutSecs' , 'stats.requestsFinished' ,
'stats.requestsFailed' , 'stats.runTimeSecs' ,
] as const ;
console .log (`${'Field' .padEnd(25 )} | ${'Success' .padEnd(15 )} | Failed` );
console .log ('-' .repeat (60 ));
const get = (obj : any , path : string ) =>
path.split ('.' ).reduce ((o, k ) => o?.[k], obj);
for (const field of fields) {
const sVal = get (success, field) ?? 'N/A' ;
const fVal = get (fail, field) ?? 'N/A' ;
const marker = sVal !== fVal ? ' <--' : '' ;
console .log (`${field.padEnd(25 )} | ${String (sVal).padEnd(15 )} | ${fVal} ${marker} ` );
}
}
Step 4: Live Tail Actor Logs
RUN_ID="your-run-id"
while true ; do
curl -sf -H "Authorization: Bearer $APIFY_TOKEN " \
"https://api.apify.com/v2/actor-runs/$RUN_ID /log?stream=1" 2>/dev/null
sleep 2
done
Sensitive Data Handling Always redact before sharing:
API tokens (apify_api_*)
Proxy passwords
PII (emails, names, IPs)
Custom environment variables
Run IDs, Actor IDs, dataset IDs
Error messages and stack traces
Run configuration (memory, timeout)
Platform health status
Escalation Path
Check run log for stack trace
Compare with a successful run
Check Apify Status for outages
Create debug bundle
Submit to Apify Support with bundle attached
Error Handling Issue Cause Solution Run not foundInvalid run ID or expired Unnamed runs expire after 7 days Log unavailableRun still in progress Wait for completion or stream live Empty dataset Actor produced no output Check failedRequestHandler in code High CU usage Memory too high or slow execution Reduce memory, optimize code
Resources
Next Steps For rate limit issues, see apify-rate-limits.