Crosstalk-Solutions/project-nomad · error

Failed to start update

Error message

Failed to start update

What it means

Raised in handleStartUpdate when api.startSystemUpdate() resolves falsy or with success !== true, or when the request itself rejects. The catch block normalizes the error to err.response?.data?.error || err.message || 'Failed to start update'.

Source

Thrown at admin/inertia/pages/settings/update.tsx:129

        // During container restart, we'll lose connection - this is expected
        // Show a notice to inform the user that this is normal
        setShowConnectionLostNotice(true)
        // Continue polling to detect when the container comes back up
        console.log('Polling update status (container may be restarting)...')
      }
    }, 2000)

    return () => clearInterval(interval)
  }, [isUpdating])

  const handleStartUpdate = async () => {
    try {
      setError(null)
      seenAdvancedStageRef.current = false
      setIsUpdating(true)
      const response = await api.startSystemUpdate()
      if (!response || !response.success) {
        throw new Error('Failed to start update')
      }
    } catch (err: any) {
      setIsUpdating(false)
      setError(err.response?.data?.error || err.message || 'Failed to start update')
    }
  }

  const handleViewLogs = async () => {
    try {
      const response = await api.getSystemUpdateLogs()
      if (!response) {
        throw new Error('Failed to fetch update logs')
      }
      setLogs(response.logs)
      setShowLogs(true)
    } catch (err) {
      setError('Failed to fetch update logs')
    }

View on GitHub (pinned to 0bd1c6f4f9)

Solutions

  1. Check the response body's error field (already surfaced via setError) and the backend update-controller logs
  2. Disable the button while isUpdating to prevent duplicate submissions
  3. Verify an update manifest/channel is configured and disk space is sufficient
  4. Ensure the API client follows redirects and surfaces JSON errors, not silent HTML

Example fix

// before
const response = await api.startSystemUpdate()
if (!response || !response.success) {
  throw new Error('Failed to start update')
}
// after
const response = await api.startSystemUpdate()
if (!response?.success) {
  throw new Error(response?.error || 'Failed to start update')
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (isUpdating || !canStart) return

Try / catch

try {
  const r = await api.startSystemUpdate()
  if (!r?.success) throw new Error(r?.error || 'Failed to start update')
} catch (err: any) {
  setIsUpdating(false)
  setError(err.response?.data?.error || err.message || 'Failed to start update')
}

Prevention

When it happens

Trigger: POST to start the system update rejected: another update already running (409), insufficient disk space, missing update manifest, or the update service not enabled on this build.

Common situations: Double-clicking the Update button firing two requests, admin session expired so middleware returns a redirect/HTML login page, or the update channel not configured on dev builds.

Related errors


AI-assisted analysis of Crosstalk-Solutions/project-nomad@0bd1c6f4f9 (2026-08-27). Data as JSON: /api/errors/eb16b1cf7ba6dda2. Report an issue: GitHub.