Windows restarts and crashes

New in v23. This page covers what Starship does when the PC restarts under it, or when Starship itself stops without a clean exit, and what you should set up in Windows so it does not happen on an imaging night.

Twice on a real rig a forced Windows Update restart ended the night mid-run, with the mount left unparked. Everything below exists because of that.

The short version

Stop Windows restarting the PC at night

Windows Update restarts a PC outside its active hours. Active hours can cover at most 18 hours a day, so they cannot cover every hour. What you can do:

Starship only reads the state of Windows Update (whether a restart is pending, and the active hours). It never writes the registry and never changes these settings for you.

The pending-restart warning

While Windows has a restart pending, the Console shows a warning: Windows may restart this PC tonight outside its active hours. The health monitor lists it as the windows_restart item, and looks again every five minutes.

Starship counts a restart as pending when Windows Update or Windows component servicing has asked for one. Other pending file operations (installers, antivirus updates) are not counted, because they never make Windows restart the PC by itself.

Unattended starts are refused

With a restart pending, Starship refuses to start a run that is meant to be left alone unless you confirm:

The page asks: restart the PC first, or start anyway. Cancel does not start. OK starts with the risk accepted. From the API the same start is refused with restart_risk: true, and is accepted when sent again with confirm_restart_risk: true.

A sequence with no end time and no dawn gate is not refused. A blockscript set to run again every night is checked when you start it, not again at each dusk. If Starship cannot read the Windows state, nothing is refused.

A blockscript started by [blockscript] auto_start is refused the same way, and there is nobody at the console to confirm. Starship then sends a critical alert saying the blockscript was not started: start it by hand, or restart the PC.

When Windows ends the session

Starship asks Windows to tell it first, before the mount server and other programs. When the notice comes:

  1. It writes down that this was a Windows restart, so the next start (and the helper below) know it was not a crash.
  2. It tries to send one alert: the restart is happening and the commands are being sent now.
  3. It runs the fast make-safe (the four steps below).
  4. It writes what each step answered to starship.log.

The fast make-safe, in order:

A forced restart gives a program about five seconds and then ends it. Starship allows 3.5 seconds for the commands to be acknowledged. Nothing is read back. The mount may still be slewing to park and the roof still closing when Starship is ended. Check the rig after any Windows restart.

An enclosure that needs the mount parked first. Close is sent straight away only when you have told Starship the enclosure clears the mount in any position: [observatory] park_before_roof_close = false and roof_motion_requires_safe_mount off. Otherwise a close onto an unparked mount could strike the telescope, and there is no time to park first. In that case the enclosure is closed only if the mount already reads parked, and the report says NOT closed.

The same fast make-safe runs when the Starship console window is closed.

If Windows calls the shutdown off, Starship carries on running. The rig has still been made safe and the run has still been stopped; start again when you are ready.

What this cannot cover. If the PC loses power, the power button is held, or Windows crashes, no notice is sent and none of this runs. That case belongs to the helper below and to your hardware's own fail-safes (an enclosure controller that closes by itself, a mount with its own limits).

If Starship stops unexpectedly: the death watch

A separate small process watches Starship. If Starship disappears without a clean stop and does not come back, the helper:

It never opens anything. Park, tracking off and cover close are the only commands it knows. It does not close the roof or dome. It never acts while a Starship is running or starting.

On an installed (compiled) build the helper runs inside the crash watchdog that relaunches Starship. After an unclean stop it parks and closes first, then lets Starship be relaunched. A relaunched Starship sits idle, so without this the mount would track all night.

A deliberate restart (Save+Restart, a health-monitor restart) is not parked. The helper waits for Starship to come back, and acts only if it does not.

In manual mode ([safety] enabled = false) the helper stands down, because a person is at the rig. Set manual_mode = true to keep it.

A mount or cover connected over Alpaca is reached with plain HTTP. An Alpaca server that needs a login is not covered.

The death watch is new in v23.

Settings: [deathwatch]

Settings → Crash protection → If Starship stops unexpectedly has the first four. All are read when Starship starts: save, then restart Starship.

What the next start tells you

When the last run of Starship did not end by a normal stop, the next start says so once, in the log, in the Console's command log (PREVIOUS STOP) and as a critical alert:

Alerts that could not be sent

An alert that fails on every channel is kept and tried again: after 30 s, 1, 2, 5 and 10 minutes, then every 15 minutes. It is given up after 12 tries or 24 hours. A late alert is marked [delayed - first tried HH:MM]. At most 50 are kept.

The queue is a file in the install folder (starship.alerts.outbox.json), so it survives a restart. That is how the alert about a Windows restart, and the one the death watch queues, reach you after the network or the PC comes back.

Carrying on after a restart (opt-in)

Off by default. Turn it on in Settings → Sequencer defaults → Resume a sequence cut short by a restart ([sequencer] auto_resume_after_restart). The second field, auto_resume_max_age_h (default 6), is how old an interrupted run may be.

It is checked once, at start, after Starship has a safety verdict (it waits up to a minute for one). It resumes only when all of these hold:

It will not resume:

The resume is the same as pressing Resume: on_start runs again (open, unpark, cool), the run re-points at the interrupted target and skips the subs already taken. The journal and a warning alert say that it resumed and from which step. If nothing is resumed, the log says why.

Auto-resume is new in v23.

Files

In the install folder (the working directory):

See also

Astroworx Starship v23.1.2 · this page is the in-app help of that buildDownload · HTTP API