{"record":{"id":"17061104d6175fd6","repo":"Pumpkin-MC/Pumpkin","slug":"failed-to-query-update-api-0","errorCode":null,"errorMessage":"Failed to query update API: {0}","messagePattern":"Failed to query update API: (.+?)","errorType":"exception","errorClass":"UpdateError","httpStatus":null,"severity":"warning","filePath":"crates/pumpkin-plugin-utils/src/updater.rs","lineNumber":19,"sourceCode":"//! Non-blocking update checks against the marketplace `/api/v1/rest/check-update` endpoint.\n\nuse crate::{\n    http::{HttpClient, HttpError},\n    models::CheckUpdateResponse,\n};\nuse thiserror::Error;\nuse tracing::debug;\n\n/// Update checking errors.\n#[derive(Debug, Error)]\npub enum UpdateError {\n    /// Plugin has not been initialized.\n    #[error(\n        \"Plugin-utils has not been initialized (call pumpkin_plugin_utils::init(context) first)\"\n    )]\n    NotInitialized,\n    /// HTTP error when querying update endpoint.\n    #[error(\"Failed to query update API: {0}\")]\n    Http(#[from] HttpError),\n    /// JSON parsing error from response.\n    #[error(\"Failed to parse update response JSON: {0}\")]\n    Json(#[from] serde_json::Error),\n}\n\n/// Checks for plugin updates against the Pumpkin Marketplace API.\npub struct UpdateChecker {\n    http_client: HttpClient,\n}\n\nimpl Default for UpdateChecker {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\nimpl UpdateChecker {","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin-plugin-utils/src/updater.rs#L1-L37","documentation":"UpdateError::Http wraps an HttpError raised while calling the Pumpkin Marketplace update endpoint. The library throws it from UpdateChecker::check when the HTTP request itself fails (DNS, connection, TLS, non-success transport). It is converted automatically via #[from] HttpError, so the message embeds the underlying HTTP error text.","triggerScenarios":"Calling pumpkin_plugin_utils::updater's UpdateChecker::check (or check_for_updates helper) when the network request to the Pumpkin Marketplace API fails: no network, DNS failure, TLS error, server unreachable, or client misconfiguration.","commonSituations":"Server host is offline or behind a firewall blocking outbound HTTPS; Marketplace API is temporarily down; corporate proxy interference; wrong API base URL after a version change.","solutions":["Verify the host has outbound HTTPS access to the Pumpkin Marketplace API (curl the endpoint manually).","Retry the update check later or wrap it in error-tolerant logic so a failed check doesn't break the plugin.","Check the embedded HttpError message for the root cause (DNS vs connection vs TLS) and fix networking/proxy accordingly.","If a custom API base URL is configured, confirm it is correct for your server version."],"exampleFix":"// before\nlet latest = update_checker.check().unwrap();\n// after\nmatch update_checker.check() {\n    Ok(latest) => log::info!(\"latest version: {}\", latest),\n    Err(UpdateError::Http(e)) => log::warn!(\"update check skipped (network): {e}\"),\n    Err(e) => log::warn!(\"update check failed: {e}\"),\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match update_checker.check() {\n    Ok(info) => /* notify */,\n    Err(UpdateError::Http(e)) => log::warn!(\"network failure checking updates: {e}\"),\n    Err(e) => log::warn!(\"update check failed: {e}\"),\n}","preventionTips":["Never panic on update-check failures; log and continue.","Confirm outbound HTTPS connectivity on the server host before enabling update checks.","Run the check periodically with backoff rather than at every startup."],"tags":["network","http","plugin-updates"],"backgroundTag":"http-request-failed","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}