Repository navigation
fix(datasets): throw when finalizing a dataset upload fails - #187
Merged
Merged
Conversation
upload_dataset and upload_project_dataset ignored the status of the close-version request (_restcall does not throw on non-2xx), so a failed finalize (e.g. a 504 from the edge proxy) went unnoticed and the upload returned a dataset whose new version was never committed. Check the status and throw via _throw_invalidresponse, which surfaces as "Finalizing upload failed".
…pload _close_dataset_version(::UUID, ...) had its condition inverted: it added "filename" to the close request only when local_path was nothing, so real uploads never sent it. Match the src/datasets.jl version.
…a dataset version
_open_dataset_version already runs _check_internal_error on its response;
do the same in both _close_dataset_version methods so a legacy
{"success": false, "internal_error": true} close response fails the
upload instead of being accepted.
…close Check the close response status outside of the try block that wraps transport errors, so that 401/403 surface as InvalidAuthentication and PermissionError (as they do for the open request) instead of being wrapped in a generic JuliaHubError.
pfitzseb
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
upload_datasetandupload_project_datasetignored the status of the request that finalizes (closes) the new dataset version. The code comment said_close_dataset_versionthrows on non-200, but_restcallusesstatus_exception=false, so it never did. A failed finalize went unnoticed: the upload appeared to succeed, but the new version was never committed and the dataset reported size 0.Seen on the 2026-10-19 JuliaHub nightly against nightly-juliahub (run 39187276590). The close request reached websrvr, but RestAPIService didn't answer within 60s (
499 0 60.001; an earlier version of this description wrongly said it never reached the server), andtest/datasets-large-live.jl:24failed with0 == 220200960instead of a clear error.Separately, the project-dataset
_close_dataset_version(::UUID, ...)had an inverted condition: it addedfilenameto the close request only whenlocal_pathwasnothing, so real uploads never sent it.Change
upload_datasetandupload_project_datasetcheck the close response and throw via_throw_invalidresponse, which surfaces asJuliaHubError("Finalizing upload failed", ...).src/projects.jl: sendfilenamewhenlocal_pathis set, matchingsrc/datasets.jl.Not changed
The close call still doesn't run
_check_internal_error, unlike the open call, so a finalize failure reported inside a 200 response would still be missed.Testing
Pkg.test()on Julia 1.12: 2313/2313 pass. With thesrc/changes reverted, the new close-status tests fail.