stablyai/orca · error · Error
Expected a positive integer, got "${rawValue}".
Error message
Expected a positive integer, got "${rawValue}". What it means
Thrown by readPositiveInteger when an env value for a numeric release-build setting (RELEASE_MAC_BUILD_POLL_SECONDS or RELEASE_MAC_BUILD_TIMEOUT_MINUTES) is present but not a positive integer. Empty/null falls back to the default; any other value is parsed with Number() and must satisfy Number.isInteger(value) && value > 0.
Source
Thrown at config/scripts/run-release-mac-build-workflow.mjs:206
return null
}
function formatApiError(data) {
if (typeof data?.message === 'string') {
return data.message
}
return JSON.stringify(data)
}
function readPositiveInteger(rawValue, defaultValue) {
if (rawValue == null || rawValue === '') {
return defaultValue
}
const value = Number(rawValue)
if (!Number.isInteger(value) || value <= 0) {
throw new Error(`Expected a positive integer, got "${rawValue}".`)
}
return value
}
function requiredEnv(value, name) {
if (value == null || value === '') {
throw new Error(`${name} is required.`)
}
return value
}
function sleepMilliseconds(milliseconds) {
return new Promise((resolve) => {
setTimeout(resolve, milliseconds)
})
}View on GitHub (pinned to 1136503c6a)
Solutions
- Set the env var to a positive integer with no units (e.g. RELEASE_MAC_BUILD_POLL_SECONDS=30).
- Leave it unset/empty to use the documented default (poll 30s, timeout 90m).
- Strip units and whitespace before exporting.
Example fix
# before RELEASE_MAC_BUILD_POLL_SECONDS=30s # after RELEASE_MAC_BUILD_POLL_SECONDS=30
Defensive patterns
Strategy: validation
Validate before calling
function parsePositiveIntEnv(rawValue, defaultValue, name) {
if (rawValue == null || rawValue === '') return defaultValue
const value = Number(rawValue)
if (!Number.isInteger(value) || value <= 0) {
throw new Error(`${name} must be a positive integer, got "${rawValue}"`)
}
return value
} Type guard
function isPositiveIntegerString(value) {
return typeof value === 'string' && /^\d+$/.test(value) && Number(value) > 0
} Try / catch
try {
options = readReleaseMacBuildWorkflowOptions(process.env)
} catch (err) {
if (/Expected a positive integer/.test(err.message)) {
// list the offending env var and acceptable values
process.exit(2)
}
throw err
} Prevention
- Document which env vars accept positive integers and their defaults.
- Reject units/whitespace at the source (strip in shell, not in code).
- Leave numeric env vars unset to use safe defaults rather than passing 0.
When it happens
Trigger: Setting RELEASE_MAC_BUILD_POLL_SECONDS=0, =-5, =1.5, =abc, or =30s. Number() yields a non-integer or non-positive value, failing the guard.
Common situations: Units included in the value ('30s'), decimals where integers are required, zero/negative mistaken as 'disabled', stray whitespace or quotes.
Related errors
- GITHUB_REPOSITORY must be in owner/repo form, got "${options
- Package version is not valid semver: ${baseVersion}
- Adhoc build timestamp is invalid.
- Adhoc label has no usable characters: ${JSON.stringify(label
- ${name} must be a positive integer, received ${value}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/017ac5100caa8ac7.
Report an issue: GitHub.