-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContentLength and Body length mismatch #8606
Comments
In my case I did not need the old upload. The more recent upload finished fine, so I removed the old upload. Take this with a grain of salt as it only works when the filesize in the metadata is correct. There might be other problems, so if you encounter this bug be sure to post your error message and the upload .info content and give us a chance to look at it. Rough steps to fix this manually:
Now for some CLI magic: First dump the current metadata of the node
Should produce sth like this:
If the rm /var/lib/ocis/storage/users/uploads/b6a1b52a-ad4b-44d7-a19d-be9d92e2ee5c* and then unset the postprocessing flag on disk:
dumping the node metadata again we should see a This leaves the postprocessing service. It keeps track of the status of uploads. If the postprocessing is restarted it would have no effect, because we deleted the upload session. To properly clean up the postprocessing we would have to remove the upload id from the nats store that holds all postprocessing events. Or we just leave it in there ... |
an attempt to fix it is in cs3org/reva#4615 needs a proper review |
cs3org/reva#4615 was merged, new test cases were added in cs3org/reva#4625 They are tracked in #8848 |
Describe the bug
TL;dr
Running ocis v4.05 I encountered this log line:
The upload session will fail with this error every time I restart the postprocessing with
ocis postprocessing restart --upload-id b6a1b52a-ad4b-44d7-a19d-be9d92e2ee5c
. The upload metadata state seems to corrupted. The blob size on disk (body length) does not match the ContentLength (The node size). I think reading the node size for the upload from the current node size is painfully wrong. 😞We need to double check this can no longer happen with the upload session refactoring in v5.
Long version:
The
could not store object
error comes from the s3 blobstore:Which is called by
upload.Finalize()
which logs thefailed to upload file to blostore
messageCalled by the postprocessing of decomposedfs
All the error messages from the log line are in this trace. The root cause is a mismatch between the size we think we want to store and the actual bytes in the local file:
🤔
The session is finished: size and offset in the senssion data are the same:
So 4548689 is the correct length and we pass it as the node.Blobsize to the PutObject call. I think 👀
Since we have a
"sizediff": "4548689"
the file was empty or did not exist before.I am thinking that maybe a subsequent upload with 5075072 bytes now interferes with this upload? Following the code in the minio s3 client we can see that the node.Blobsize is passed as size and becomes the ContentLength header ... but why would the node.Blobsize be different than what the upload session metadata says?!? 👀
ok the upload we see has
it tinks it is a new file... but there is a bug where we read the node.Blobsize from the existing node again and then use it as a parameter for the Upload. In decomposedfs.go, before making the Finalize() call
We actually read the node from disk:
but this node might already have a different blobsize set when a second upload finished before the first.
I assume the file exists with a size of 5075072 bytes ... but it is stuck in postprocessing by the upload
b6a1b52a-ad4b-44d7-a19d-be9d92e2ee5c
. Now I need to understand how we can unlock that mess ...🤦
Steps to reproduce
I'm not sure. The log line is a followup error of other things going wrong. I assumo two uploads were in process, but the second larger one (5075072 ) finished before the first (4548689).
Expected behavior
Uploads should become versions of a node regardless of the order in which the postprocessing finishes.
Actual behavior
The data used to finish the upload is broken and we pass the wrong node size into the putobject function.
Setup
ocis v4.0.5 with s3ng and postprocessing enabled
The text was updated successfully, but these errors were encountered: