simvue-io / simvue-io/python-api
Sender will fail to upload file artifact if it changes between creation and sending
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4
- Forks
- 1
- Avg merge
- 5d 8h
- Merged PRs (30d)
- 4
Description
Description of Bug
When creating an Artifact via run.save_file(), the checksum is calculated and stored in the artifact JSON in the cache, along with the path to the file. If that file is then changed between the time when it was asked to be saved by the user, and when it is actually sent by the sender(), the checksum will no longer match the file, and so the upload will fail. You'll get back an error like:
E RuntimeError: uploading artifact 'test_file_artifact_6c49f901' to object storage failed for url '[https://simvue-ci.s3.amazonaws.com/'](https://simvue-ci.s3.amazonaws.com/%27) with status 400: <?xml version="1.0" encoding="UTF-8"?>
E <Error><Code>BadDigest</Code><Message>The SHA256 you specified did not match the calculated checksum.</Message></Error>
Steps To Reproduce
Steps to reproduce the behavior:
- Create a run in offline mode
- Create a file
- Do
run.save_file() - Change the contents of the file
- Run
sender()
Expected behavior
The file should be uploaded (I guess as it was when the user called save_file()
Actual Behaviour
Error due to mismatched checksum
Setup
- OS: Ubuntu 22.04
- Python version 3.10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the artifact flow from run.save_file() through the cached artifact JSON to sender(), focusing on when the checksum and file contents are read. Reproduce the offline-mode steps from the issue and verify that a file changed after save_file() uploads successfully without a BadDigest error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100