Add integrity check after upload
Given that there is a very small probability (0.1%) that a file may not be uploaded correctly after being uploaded, yet it shows as successfully uploaded without any error prompts, and the webpage does not display any abnormal status of the file. However, for faulty files, it is impossible to know if they were uploaded correctly unless a download test is performed.
I am curious if it is possible to add an option, such as --check-integrity-after-uploaded. This process would involve downloading the uploaded file immediately after the upload of a single file is completed. It only needs to ensure that the accessed download link can correctly download the header bytes of the file. For example, if 1KB of data is received, it can be determined that the uploaded file has been stored correctly, and then the download process can be immediately terminated.
How about using a separate command rclone check?
The goal is to verify that the file can be downloaded, but at the same time, only a small portion of the file needs to be downloaded to ensure that the server has stored the file correctly.
If rclone check --download is used, the entire file will be downloaded, and I'm not sure if it's possible to only download the file header for verification.
If rclone copy is used, verification can be done later, but in the case of using rclone move, the original file has already been lost.
Sorry for the late reply.
Our upload process initially included a listing step after upload, mainly to get metadata and confirm existence. We later switched to getting metadata directly from the upload API response to save an API call per upload, as the metadata was sufficient.
You're right that an integrity check is important.
Rather than requiring a download of file data (even just the header or a partial chunk) just for verification, would using a lightweight check like the original listing step (to confirm existence and basic properties) be a viable alternative? This is less resource-intensive.
If that level of check isn't enough, we can definitely look into adding a dedicated integrity verification option as you proposed.
What are your thoughts on using a listing check first?
Although the directory listing API returns a property c whose value is not 0, indicating that there is an exception with the file.
c=1 👉 文件内含违规内容 👉 "file contains prohibited content"
c=2 👉 系统处理中,暂不支持操作 👉 "system processing; operation not supported at this time"
Due to the poor architectural design of 115 and some legacy issues that prevent certain files from being correctly downloaded, I am not sure that performing only the above checks is sufficient to ensure the integrity of the uploaded files.
Finally, thank you for your great work to make 115 great again.
Can you try with binary here? https://github.com/wiserain/rclone/actions/runs/14898961527
If you append --115-check-upload then it will check each upload file by download of 1byte.
It is hard to test, given that the probability of a file being non-downloadable after being uploaded is extremely low. The code looks fine.
Since the directory listing API is triggered when --115-check-upload is added, could we also check whether the field c is non-zero? In the case of c=1, it becomes fatal the file cannot be downloaded, and re-uploading is ineffective.
Regarding the handling based on the value of c:
- You mentioned that when
c=1, re-uploading is ineffective and it's a fatal condition for that file. If we detectc=1for an uploaded file using this check, how should the CLI proceed? Should this immediately halt the entire upload process with a fatal error for that file (and potentially the job), or be handled in a different way? - What about other non-zero values of
c, such asc=2? Would retrying the upload for that specific file be a viable strategy in those cases, or are there specific behaviors expected for different non-zerocvalues?
Looking forward to your guidance on the desired error handling logic here.
When c=1, it means that the file's hash is completely blocked by 115. This usually occurs with some advertisement files, extremely censored pornographic content, certain movie content, or horror content. There is no need to retry uploading such a file, but it should not interrupt the entire upload process.
When c=2, it is feasible to retry uploading the file. I suspected that this may occur when the server encounters an error while processing the file, though this error might not immediately be reflected in the file properties after a successful upload.
Additionally, when c is not equal to 0, it should also be taken into account in other file processing scenarios (e.g., during download or move operations), where files of this type should not be allowed to perform any operations other than deletion.
So far, no cases have been observed where the value of c is anything other than 0, 1, or 2.
Please quick review https://github.com/wiserain/rclone/pull/51 and let me know if it meets your expectations.
LGTM