BlueBrain / BlueBrain/nexus-python-sdk
Unable to update a registered file
- 主要言語
- Python
- スター
- 6
- フォーク
- 10
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
### Expected behavior
After I registered a new file in nexus, I want to update the content of a file (create a new version).
### Actual Behavior (please include screenshot if possible)
When trying to update the file, I get the following error
```
tests/test_versioning.py:135: in test_register_update_file
self.update_file(nexus, config, file_id)
tests/test_versioning.py:59: in update_file
file_id = file_id, filepath=file_path2, rev=1)
../../../../Envs/nexus/src/nexus-python-sdk/nexussdk/files.py:173: in update
return http_put(path, body=file_obj, data_type="file", rev=rev, storage=storage_id)
../../../../Envs/nexus/src/nexus-python-sdk/nexussdk/utils/http.py:166: in http_put
response = requests.put(full_url, headers=header, files=body, params=kwargs)
../../../../Envs/nexus/lib/python3.6/site-packages/requests/api.py:131: in put
return request('put', url, data=data, **kwargs)
../../../../Envs/nexus/lib/python3.6/site-packages/requests/api.py:60: in request
return session.request(method=method, url=url, **kwargs)
../../../../Envs/nexus/lib/python3.6/site-packages/requests/sessions.py:533: in request
resp = self.send(prep, **send_kwargs)
../../../../Envs/nexus/lib/python3.6/site-packages/requests/sessions.py:646: in send
r = adapter.send(request, **kwargs)
../../../../Envs/nexus/lib/python3.6/site-packages/requests/adapters.py:498: in send
raise ConnectionError(err, request=request)
E requests.exceptions.ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
```
### Steps to reproduce the problem
1. I register a file 'brain.jpg' into nexus. That works, an ID example is https://staging.nexus.ocp.bbp.epfl.ch/v1/files/gpfs_tests/gpfs_tests/d7df3f2c-b5ea-431e-a75b-03760ac6dbbd
2. I try to update the version of that resource by using the python sdk as follows:
```
nexus.files.update(org_label="gpfs_tests", project_label="gpfs_tests", file_id = "https://staging.nexus.ocp.bbp.epfl.ch/v1/resources/gpfs_tests/gpfs_tests/_/d7df3f2c-b5ea-431e-a75b-03760ac6dbbd", filepath="/home/adietz/Work/10_NSE/1.10_gpfs_nexus/autotests/resources/DSC00728.JPG", rev=1)
```
This creates a `put` request for the url `http://staging.nexus.ocp.bbp.epfl.ch/v1/files/gpfs_tests/gpfs_tests/https%3A%2F%2Fstaging.nexus.ocp.bbp.epfl.ch%2Fv1%2Fresources%2Fgpfs_tests%2Fgpfs_tests%2F_%2F6272720f-0c5a-4691-a2ff-a01c4a8d8bce` with params = `{'rev': 1, 'storage': None}`
### Optional infrastructural data (user, platform, browser, environment, ...)
stage environment, org: "gpfs_tests", project: "gpfs_tests".
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
tests/test_versioning.py、特に test_register_update_file と update_file から始め、次に nexussdk/files.py と nexussdk/utils/http.py を通じてリクエストを追跡します。stage 環境に対して更新を再現し、生成された PUT URL とパラメータを調べます。登録済みファイルを更新すると、接続エラーなしで要求された新しいバージョンが作成されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100