Skip to content

Fail the upload when finish_upload returns no cluster ID - #955

Merged
caglarpir merged 1 commit into
mapillary:mainfrom
caglarpir:fix-finish-without-cluster-id
Nov 18, 2026
Merged

caglarpir merged 1 commit into
mapillary:mainfrom
caglarpir:fix-finish-without-cluster-id

Conversation

@caglarpir

@caglarpir caglarpir commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

When finish_upload answers 200 without a cluster ID, nothing was created. The server answered so for an organization that the account is not a member of, until a server fix this week; it now answers with an HTTP error. upload took such an answer as finished: it reported the files as uploaded, exited 0 and wrote them to the upload history, so later runs skipped them as already uploaded although nothing was created.

A response without a cluster ID now raises HTTPContentError, as other unexpected responses do. The upload stops with exit code 17, nothing is counted as uploaded, and nothing is written to the upload history, so running the upload again retries it. The error reads:

==> Upload summary
Nothing uploaded. Bye.
HTTPContentError: Cluster ID not found in the response, so the upload was not finished: POST https://graph.mapillary.com/finish_upload => 200 OK: {}

Tested live before the server fix: one image uploaded with --organization_key set to an organization the account is not a member of. Without this change it was reported as uploaded and written to the upload history; with it, the upload failed with exit code 17 and nothing was written. Unit tests check that a response without a cluster ID ({}, null, or not an object) raises and emits no upload_finished (which the history and the summary hook on). They fail on main, and they fail if upload_finished is emitted before the error.

Not changed: as for HTTP errors from finish_upload, no upload_failed event is emitted, only the earlier upload_end and then the exit code.

When finish_upload answers 200 without a cluster ID, nothing was
created. The server answered so for an organization that the account is
not a member of, until a server fix this week; it now answers with an
HTTP error. upload took such an answer as finished: it reported the
files as uploaded, exited 0 and wrote them to the upload history, so
later runs skipped them as already uploaded although nothing was
created.

A response without a cluster ID now raises HTTPContentError, as other
unexpected responses do: the upload stops with exit code 17, and nothing
is counted as uploaded or written to the history.
@caglarpir
caglarpir force-pushed the fix-finish-without-cluster-id branch from 5399a21 to f6e8372 Compare November 18, 2026 13:48
@caglarpir
caglarpir merged commit 5327c58 into mapillary:main Nov 18, 2026
16 checks passed
caglarpir added a commit that referenced this pull request Nov 18, 2026
When finish_upload answered without a cluster ID, as for an organization
that the account is not a member of, upload wrote the files to the upload
history with "cluster_id": null, although nothing was uploaded. #955 stops
writing such records, but the ones already written still made upload skip
the files as already uploaded, and check_upload_history report them so.

A record whose summary has the cluster ID null is now not taken as
uploaded, by the duplicate check of upload, by check_upload_history and
by the lookup of images uploaded in other sequences; upload logs that it
ignores it. Only an explicit null counts: records written before 0.14.0
have no cluster ID and still count as uploaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant