{
  "id": "cicd/gradle-daemon-stopped",
  "signature": "org.gradle.launcher.daemon.server.DaemonExpirationPeriodicCheck: Daemon will be stopped at the end of the build after running for 3 hours",
  "signature_zh": "org.gradle.launcher.daemon.server.DaemonExpirationPeriodicCheck：守护进程将在运行 3 小时后于构建结束时停止",
  "regex": "org\\.gradle\\.launcher\\.daemon\\.server\\.DaemonExpirationPeriodicCheck: Daemon will be stopped at the end of the build after running for \\d+ hours",
  "domain": "cicd",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "Gradle's daemon process is automatically terminated due to idle timeout or maximum age limits configured in gradle.properties, causing subsequent builds to restart the daemon and lose cached state.",
  "root_cause_type": "generic",
  "root_cause_zh": "Gradle 的守护进程由于在 gradle.properties 中配置的空闲超时或最大年龄限制而自动终止，导致后续构建重启守护进程并丢失缓存状态。",
  "versions": [
    {
      "version": "Gradle 8.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Gradle 8.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Gradle 7.6.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Set org.gradle.daemon=false in gradle.properties to disable daemon entirely",
      "why_fails": "Disabling the daemon removes the caching benefit entirely, making builds significantly slower in CI environments.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase the daemon heap size with -Xmx to prevent memory-related stops",
      "why_fails": "Heap size does not affect the idle timeout or age-based expiration; the daemon will still stop after the configured duration.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Restart the CI worker node to clear the daemon lock file",
      "why_fails": "Restarting the node resets the daemon but does not address the underlying configuration causing the expiration.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase daemon idle timeout in gradle.properties: `org.gradle.daemon.idletimeout=7200000` (2 hours)",
      "success_rate": 0.85,
      "how": "Increase daemon idle timeout in gradle.properties: `org.gradle.daemon.idletimeout=7200000` (2 hours)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set daemon max age to a higher value: `org.gradle.daemon.registry.base.expiration=86400000` (24 hours) in gradle.properties",
      "success_rate": 0.8,
      "how": "Set daemon max age to a higher value: `org.gradle.daemon.registry.base.expiration=86400000` (24 hours) in gradle.properties",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the `--no-daemon` flag for short-lived CI builds to avoid daemon overhead, and rely on build cache instead: `gradle build --no-daemon --build-cache`",
      "success_rate": 0.75,
      "how": "Use the `--no-daemon` flag for short-lived CI builds to avoid daemon overhead, and rely on build cache instead: `gradle build --no-daemon --build-cache`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase daemon idle timeout in gradle.properties: `org.gradle.daemon.idletimeout=7200000` (2 hours)",
    "Set daemon max age to a higher value: `org.gradle.daemon.registry.base.expiration=86400000` (24 hours) in gradle.properties",
    "Use the `--no-daemon` flag for short-lived CI builds to avoid daemon overhead, and rely on build cache instead: `gradle build --no-daemon --build-cache`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.gradle.org/current/userguide/gradle_daemon.html",
  "official_doc_section": null,
  "error_code": "GDAEMONEXPIRED",
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.78,
  "resolvable": "partial",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}