Every OTA failure I've seen comes down to the same three facts: networks lie, power fails, and an update that isn't atomic leaves you with a machine that's neither the old version nor the new one.
Robots get all of that, plus a few new problems. They used to run fixed programs. Now they run models that decide what to do many times a second from what they see, and those models change often. A robot is also usually in the middle of doing something physical when the update arrives. So there's more to ship, more often, and a worse time to get it wrong.
Here's the checklist. Each item is a failure we've seen in the field, followed by what you need in place so it doesn't hurt you. It's long on purpose. Skip what doesn't apply to your fleet.
The short answer: A safe OTA update checks preconditions before it changes anything, resumes downloads and verifies checksums, and journals every step so it survives power cuts without running a step twice. When something fails, it undoes the completed steps in reverse, using only what's already on the robot. And every release goes out in phases, never to everyone at once.
Before the update starts
Most bad updates are decided before the first byte downloads. Check first, change later.
- The robot is in the middle of a task. An update that restarts the arm controller mid-pick drops the part, or worse. The application has to be able to say "busy, come back later" (for example a
busy flag with a reason and a timeout), and the update has to wait for it, not interrupt it. - The disk is almost full. Downloads fail at 97%, extractions leave partial folders, and a full disk takes down logging and DDS shared memory with it. Check free space as a precondition, and keep a floor the download never crosses.
- The battery is low. A mobile robot at 12% that starts a 20-minute update can die halfway. Make battery level a precondition.
- The robot is on cellular. A 3 GB model over a SIM plan is an expensive surprise. Wait for an unmetered network, or for a window when you're fine paying.
- It's the middle of a shift. Customers care when their robots are down. Set a maintenance window per site, and let the update wait for it.
- The preconditions never hold. If the robot never gets free disk or a window before the release expires, the update should fail cleanly, with nothing changed, and say why.
- The robot's agent is too old for the release. If the release uses a step the agent on that robot doesn't know, find out before sending, and name the robots that need an agent update first. Don't send a job the robot will half understand.
- The fleet isn't one fleet. Some robots are arm64 Jetsons, some are amd64 boxes, some have a second camera, some run an older OS image. Don't keep five copies of the release. Keep one workflow with conditions per step (architecture, OS, tags, a file existing, a command succeeding), and let non-matching steps skip.
- You've never run this release on real hardware. Do a dry run on one real robot: evaluate every step, report which would run and which would skip and why, check that secrets, images, URLs and disk space are all there. Change nothing. It catches the missing registry credential before it fails on 200 robots.
- A secret isn't available to this robot. A registry login or API key scoped to one site won't exist for robots at another. The dry run should catch it. If it doesn't, the step should fail with the secret's name, never print its value.
While it runs
Now the update is running, on a machine you can't see, over a network you don't control.
- The download drops at 80%. Resume with range requests instead of starting over. Verify sha256 before using the file. Cache verified files by hash, so a retry or rollback doesn't download again.
- The power is cut mid-step. The update must keep a journal on disk: which steps finished, which was running. After the restart, it resumes from there. A step that finished never runs a second time. A step that was interrupted either finishes or is rolled back, but the robot never stays in between.
- The agent itself is killed mid-step. Subtle one. The step's process may still be running when the agent comes back. If the agent starts the step again, two copies run side by side, for example two
apt processes fighting over the lock. The resumed job has to wait for the interrupted process to finish first. - The update needs a reboot in the middle. A kernel module or a driver might need one. The workflow should reboot as a step and continue after the restart, not end there.
- A step hangs forever.
apt waiting on a prompt, a pull from a registry that stopped answering. Every step needs a timeout that kills the step and everything it started. Flaky steps get retries, with limits. - A file is half written when the power goes. Write to a temporary file and rename it into place. Renames are atomic, writes aren't.
- A second release arrives while the first is running. Two jobs changing the same robot at once is how you get a state nobody tested. Queue the second one until the first finishes.
- A robot was offline for a week. When it comes back, it shouldn't run a week-old job from a rollout that has since moved on. Give jobs an expiry, and let the rollout send it a current release instead.
When it fails
Something will fail. What matters is where the robot ends up.
- Undo every completed step, in reverse. Each step type has to know how to undo itself: restore the previous file, put back the previous container, reinstall the removed package, switch the link back. If step 5 of 7 fails, steps 4 to 1 are undone in that order.
- Put services back the way they were. If a service was running and enabled before, it must be running and enabled after the rollback. It sounds obvious. It's easy to restore the files and leave the service stopped.
- Run your own rollback steps after the undo. Some things only you know: turn off maintenance mode on the cell controller, tell the warehouse system the robot is back. An HTTP call with its own undo call covers a lot of these.
- A failure after a reboot still rolls back. If the check that fails runs after the restart, the rollback has to work after the restart too, including containers set to
restart: always that came up on the new image at boot. - The rollback must not need the network. If going back requires pulling the old image or downloading the old file, it fails exactly when the network is the problem. Keep what you need for rollback on the robot.
Docker Compose specifics
If your robot runs as a compose stack (it should, see the production software stack for AI-powered robots), a few rules:
- Update the stack, not container by container. One step that brings the whole project to the new compose file and
.env, and one undo that takes it all back. Replacing containers one at a time leaves windows where perception is new and the policy is old. - Success means every service is healthy. Use
docker compose up --wait, which only returns success when services are running and healthy. That only works if each service has a real healthcheck. Without one, "healthy" means "the process started". - Undo to exactly the previous images. Before the change, tag the images the project is running now, so you can return to them even if the registry tag moved. This matters most with mutable tags. If you deploy
:stable, the moment someone pushes a new :stable, that tag no longer points at what your robots were running. - Restore `.env` too. Versions usually live in
.env. Rolling back the compose file but not .env gives you the old structure with new versions. - Don't mix tools on one container. If compose manages a container and something else replaces it with
docker run, the next docker compose up will recreate it from the compose file and quietly undo your change. Pick one owner per container. For compose projects, it's compose. - Prune carefully. Image pruning to save disk can delete the image you'd roll back to. Prune after a release is confirmed, never during.
ROS 2 workspace specifics
Not everything is in a container. Many robots run a colcon workspace directly, or mount one into a container. Treat it like model weights.
- Never build in place. Running
colcon build in the workspace the robot is running from means that for minutes, install/ is half new. A node that restarts in that window loads a mix. Deploy each version into its own folder (/opt/ws/v42) and switch a current link atomically, like you would for models. - Build in CI when you can. Ship the built
install/ space for each architecture. Building on the robot works, but takes long on an ARM board, needs every build dependency installed there, and can fail on one robot for reasons you can't reproduce. If you must build on the robot, build into the new versioned folder, never the live one. - Know what doesn't roll back. System packages that
rosdep installs during a build won't be removed by rolling back the workspace. Install ROS packages as their own step (with their own undo), or bake them into the base image. - Restart the launch, then wait for the graph. "The launch process is running" means nothing. Wait until the expected nodes are present and key topics are publishing at their normal rates (camera at 30 Hz, joint states at 100 Hz), then call it done. If they don't come back within a timeout, fail and roll back.
- On rollback, restart last. Undo all the files first, then restart the launch, so it comes up on the old workspace in one go.
- Parameters are part of the release. Setting a parameter in the YAML file and on the live node are two different things. Do both when you need both, and undo both. Some parameters are read-only at runtime, so treat a refused parameter as a failure, not a success.
- Don't assume `/opt/ros` or domain 0. RoboStack or conda installs live elsewhere, and robots on shared networks use other domain IDs. The update should use the same environment as the running nodes, or
ros2 commands will talk to an empty graph and report success.
Network changes
Changing Wi-Fi credentials, an APN or a static IP over the air is the fastest way to lose a robot. Get it wrong and the robot is now unreachable, so you can't send the fix.
- Arm the revert before you write anything. Save the old config and a revert deadline on disk first.
- Confirm over the new network. The change counts only if the robot reaches your platform over it within a couple of minutes.
- Revert from more than one place. If confirmation doesn't come, the old config goes back, whether the update process is still alive or not. A separate watchdog that survives the main agent crashing is what makes this safe. If the old config can't be put back, reboot.
- One network change at a time.
The agent itself
The thing doing the updates needs updating too, and if that breaks, nothing else can be fixed remotely.
- Update the agent A/B. Install the new version beside the old one, switch, and only keep it after it reconnects and reports healthy.
- Have a rescuer. A small separate process that rolls back to the previous agent if the new one doesn't come up.
- Ship agent updates alone, in phases. Not in the same release as an app update. A broken agent should stop at the first few robots.
The rollout around it
Everything above is about one robot. A fleet adds one more rule: never update everyone at once. Send the release to a few robots, check them against the robots that didn't get it yet, then continue. Halt automatically when failures cross a threshold or the updated robots get worse. Amit covers that in phased rollouts and automatic rollback. For model updates specifically, see how to update a VLA model on robots remotely.
The one-page version
- Wait for busy robots, free disk, battery, unmetered network and the maintenance window. Fail cleanly if they never come.
- Refuse releases a robot's agent can't run. Dry-run new releases on one real robot.
- One workflow for the mixed fleet, with conditions per step.
- Resume downloads, check sha256, cache by hash.
- Journal every step. Resume after power cuts. Never run a step twice.
- Timeouts and retries on every step. One job at a time per robot.
- Undo every step in reverse on failure, then your own rollback steps. Restore services to their previous state.
- Keep everything needed for rollback on the robot.
- Compose: whole stack, healthchecks, back to exactly the previous images and
.env. - ROS: versioned workspaces with an atomic switch, wait for nodes and topic rates, restart last on rollback.
- Network changes revert on their own if the robot can't reach home.
- Agent updates are A/B, with a rescuer, in their own release.
- Phase every rollout and halt automatically.
How PhysicalFleet handles it
We built PhysicalFleet's OTA around this list. A release is a workflow of steps, each with its own undo, including compose.up, ros.workspace.deploy, ros.launch.restart and network.apply with auto-revert. The agent resumes after reboots and power cuts, never runs a step twice, waits for pf busy, and can preview a release on one device without changing anything. See OTA updates.
If there's a failure you've hit in the field that's not on this list, send it to me. I'll add it.
Common questions
What happens if a robot loses power during an OTA update?
If the update keeps a journal on disk, the robot knows which steps finished and which one was running, and picks up from there after it boots. A finished step never runs again, and an interrupted step either finishes or is rolled back. Without a journal and atomic writes, you can end up with a robot that's neither the old version nor the new one.
How do I update a ROS 2 workspace on a robot safely?
Never run colcon build in the workspace the robot is running from. Deploy each version into its own folder, ideally an install space built in CI for each architecture, and switch a current link atomically. Then restart the launch and wait until the expected nodes are present and key topics are back at their normal rates before you call it done.
How do I roll back a Docker Compose update to the exact previous images?
Before the update, tag the images the project is running now, so you can return to them even if a registry tag has moved. Roll back the compose file and the .env file together, since that's usually where the versions live. Don't prune images until the release is confirmed, or you may delete the one you need to go back to.
How do I change Wi-Fi settings on a remote robot without losing it?
Save the old config and a revert deadline on disk before changing anything. The change only counts if the robot reaches your platform over the new network within a couple of minutes. If it doesn't, the old config goes back on its own, ideally from a watchdog that survives the main agent crashing. Make one network change at a time.
How do I stop an update from interrupting a robot in the middle of a task?
Let the application report that it's busy, with a reason and a timeout, and make the update wait until it isn't. Add the other preconditions too: free disk, battery level, an unmetered network and the site's maintenance window. If they never hold before the release expires, the update should fail cleanly with nothing changed.