{"record":{"id":"d33461ec74f14e46","repo":"louislam/uptime-kuma","slug":"unknown-octopush-version","errorCode":null,"errorMessage":"Unknown Octopush version!","messagePattern":"Unknown Octopush version!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/notification-providers/octopush.js","lineNumber":68,"sourceCode":"\n                let config = {\n                    headers: {\n                        \"cache-control\": \"no-cache\",\n                    },\n                    params: data,\n                };\n                config = this.getAxiosConfigWithProxy(config);\n\n                // V1 API returns 200 even on error so we must check\n                // response data\n                let response = await axios.post(urlV1, {}, config);\n                if (\"error_code\" in response.data) {\n                    if (response.data.error_code !== \"000\") {\n                        this.throwGeneralAxiosError(`Octopush error ${JSON.stringify(response.data)}`);\n                    }\n                }\n            } else {\n                throw new Error(\"Unknown Octopush version!\");\n            }\n\n            return okMsg;\n        } catch (error) {\n            this.throwGeneralAxiosError(error);\n        }\n    }\n}\n\nmodule.exports = Octopush;\n","sourceCodeStart":50,"sourceCodeEnd":79,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/notification-providers/octopush.js#L50-L79","documentation":"The Octopush provider branches on notification.octopushVersion to build either the V2 or V1 request; the else branch throws 'Unknown Octopush version!' when the version is neither of the supported values. This is a pure configuration guard before any HTTP call for the unsupported branch.","triggerScenarios":"notification.octopushVersion is unset, an empty string, or a value other than the two supported constants (e.g. a typo like 'v1'/'v2' lowercase vs the expected casing, or '3').","commonSituations":"The version dropdown/field was left at its default placeholder; a config migration changed the stored value; user typed a free-form value instead of choosing from the supported set.","solutions":["Set notification.octopushVersion to exactly one of the two supported values exposed in the Octopush notification form.","If the form/options were customized, verify the version selector still emits the expected constants.","Save the notification and re-run the test send."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const supported = [/* the two version constants from the form */];\nif (!supported.includes(notification.octopushVersion)) {\n    throw new Error(`octopushVersion must be one of: ${supported.join(\", \")}`);\n}","typeGuard":"/** @param {unknown} v */\nfunction isSupportedOctopushVersion(v, supported) {\n    return typeof v === \"string\" && supported.includes(v);\n}","tryCatchPattern":null,"preventionTips":["Constrain the version field to a fixed set in the UI (dropdown, not free text).","Validate at save time so the user learns before a real alert fires.","After a config migration, re-check stored version values."],"tags":["config","validation","octopush","version"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}