Root CauseWhat broke, why, and the fix.

firebase deploy hosting shipped a new screen after the API deployment failed

· firebase, deployment, debugging
ⓘ Operated by TechAthletes. Every post here is a bug we hit in our own work — symptom, root cause, fix. Nothing is sponsored and we are not paid to mention any tool.

Key points

  • Hosting published a new screen even though the API deployment had failed, because the deployment commands did not make the screen depend on the server’s success. (Source: our own measurement, 2026-09-29)
  • The older API ignored the unfamiliar tracking parameter and fell back to incrementing visits, giving the new event a different meaning. (Source: our own measurement, 2026-09-29)
  • No actual visits occurred during the affected period, and the recorded count remained unchanged. That outcome did not validate the deployment procedure. (Source: our own measurement, 2026-09-29)
  • The resulting procedure puts the server first, checks its actual behavior, and releases the screen only after that check succeeds. (Source: our own measurement, 2026-09-29)

The screen shipped after the API deployment failed

On September 29, a change added an intermediate call to action to a short mock exam. The feature needed coordinated changes on the server and in the screen.

The server endpoint, /api/trackFunnel, was supposed to accept new milestones, including mock_mid_cta_view, and record them in steps. The static pages under /mock/** would send the milestone through a beacon after the visitor answered three questions.

An intermediate CTA view is a tracking milestone sent when the mock-exam screen displays its call to action after three answers.

The deployment attempt put the server deployment and the screen release into the following command sequence, reproduced from the record:

firebase deploy --only functions:api ... 2>&1 | tail -4
npm run build 2>&1 | tail -2 && firebase deploy --only hosting:production ...

The API deployment failed. Hosting nevertheless published the new screen. Production therefore contained the new event sender alongside the old event receiver.

That combination was the incident’s essential failure. The screen had been changed to send information that the deployed server did not yet interpret as intended. Although the commands appeared in server-first order, that order did not enforce the dependency between the releases.

(Source: our own measurement, 2026-09-29)

The command sequence did not enforce the intended order

The mistaken assumption was that placing the server command before the screen command was enough to make the release proceed safely. The second line did not inspect the outcome of the first line.

There was an && in the sequence, but it connected the build portion of the second line to the Hosting deployment. It did not connect the API deployment to the subsequent screen release. Failure in the API deployment therefore did not prevent that second line from running.

The distinction matters because the dependency belonged to the feature, not merely to the arrangement of commands. The screen required the new server behavior. A sequence that continued after the server failed did not preserve that requirement.

The record identifies semicolons and separate lines as unsuitable ways to express this dependency: they allow the later command to run despite an earlier failure. It recommends separate commands with an explicit success check, or an && connection that stops the later operation when the preceding one fails — the behavior POSIX's Shell Command Language specification defines for AND-OR lists, where the right-hand command of && runs only when the left-hand command's exit status is zero.

For this change, the needed condition was more specific than “the server deployment was attempted.” The new server behavior had to be available before the screen started sending the new milestone.

The old server accepted the event with the wrong meaning

The old server did not understand the new step parameter. Instead of rejecting the request, it ignored the unfamiliar parameter and entered a branch that incremented the visit count.

That made the mismatch a measurement problem. A display of the intermediate CTA would be interpreted as another visit. The event intended to describe progress within the mock exam would change the number used to represent arrival.

The affected number was also part of the evidence used to judge the change. If those events had occurred during the mismatch, the feature would have altered its own evaluation data through an unintended server branch.

The record explicitly distinguishes this behavior from a visible request failure. A missing or failing function can make a mismatch apparent. Here, the old implementation accepted the request under a different meaning. It did not produce an error that would reveal the problem through error logs.

The release exposed that failure mode, but the recorded outcome was zero actual harm. There were no real visits during the affected period. The checked value was exactly the same as the value saved immediately before the CTA appeared.

Those observations establish the outcome of this incident: the counts did not change. They do not establish that the deployment sequence was sound. The record attributes the absence of harm to fortunate timing, while retaining the deployment procedure as the problem.

(Source: our own measurement, 2026-09-29)

The deployment signals did not establish readiness

The deployment record also contained conflicting signals. The CLI reported:

Functions deploy had errors

At the same time, the function’s status temporarily appeared as:

ACTIVE

Neither the presence of a function nor an apparently active status answered the question that mattered to the screen: did the deployed server actually support the new behavior?

The resulting procedure therefore requires a request to the real endpoint. It explicitly says not to rely only on the CLI’s exit code or success indication. Until the new route behaves as expected when called, the server change is not treated as released.

This separates two checks that the incident had allowed to blur together. A deployment tool reports on a deployment operation. The feature requires a particular behavior from the deployed application. The latter was the prerequisite for publishing the new screen.

The supplied record does not identify why the API deployment failed. Its demonstrated cause for the mismatched release is narrower: the screen deployment continued without requiring successful deployment and verification of the server change.

The revised procedure makes the screen wait

The procedure recorded after the incident divides the release into separate stages. First, deploy only the server:

firebase deploy --only functions:api --project <p> --non-interactive

Next, call the new route separately and verify that it behaves as expected. The record includes a direct HTTP check as part of that stage. The point is to inspect the deployed endpoint before proceeding, rather than infer its readiness from the deployment display.

Only after that verification should the screen be built and published:

npm run build && firebase deploy --only hosting:production --project <p> --non-interactive

The compatibility argument is explicit. When backward compatibility is preserved, deploying the server first leaves the old screen using the behavior it already understands. It simply does not use the newly added capability.

Deploying the screen first creates the opposite combination: a new screen calling functionality that the server does not yet provide. In this incident, the older server’s fallback made that combination capable of producing incorrect counts without an error.

Rollback follows the same dependency in reverse. When reverting both parts, restore the screen first and then restore the server. This avoids leaving a new screen talking to an older server during the rollback.

The lesson: verify what the old receiver does

For a change that touches both the server and the screen, check the deployment sequence against the actual dependency. Does a failed server release prevent the screen from being published? Is there a separate check of the deployed behavior before the screen proceeds?

Then inspect the receiving code. In this case, the decisive behavior was its treatment of an unfamiliar parameter: ignoring it caused the request to enter the visit-counting branch. A successful-looking request was therefore insufficient evidence that the event had been recorded correctly.

The corresponding check in another environment is concrete: examine what the currently deployed server does with the request that the new screen will send. Check whether an unknown key is rejected, ignored, or accepted through a default branch with another meaning.

Finally, keep the observed outcome separate from the quality of the procedure. Here, unchanged counts established that the exposed mismatch caused no actual measurement damage during the affected period. The release sequence still needed correction because it had allowed the incompatible pair into production.

The usable rule from this incident is to deploy the server, verify its real behavior, and only then publish the screen that depends on it.

Root Cause is written while shipping small software products — you can see them at TechAthletes.

All posts →

Get new posts by email

We email you only when a new post goes up here. You can unsubscribe at any time.

Privacy policy