simvue-io / simvue-io/python-api

Sender will fail to upload file artifact if it changes between creation and sending

オープン
#870 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug offline
主要言語
Python
スター
4
フォーク
1
平均マージ
5日 8時間
マージ済み PR(30日)
4

説明

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:

  1. Create a run in offline mode
  2. Create a file
  3. Do run.save_file()
  4. Change the contents of the file
  5. 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、run.save_file() からキャッシュされたアーティファクト JSON を経由して sender() に至るまでのアーティファクトの流れを追跡し、チェックサムとファイル内容がいつ読み取られるかに注目します。issue にあるオフラインモードの手順を再現し、save_file() の後に変更されたファイルが BadDigest エラーなしで正常にアップロードされることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
backend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。