Duplicate blob when uploading via CLI

Đang mở
#1,650 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Tái hiện bằng dandi organize . rồi dandi upload ., sử dụng các phiên bản và API endpoint cục bộ được nêu. Bắt đầu với dandi/upload.py, dandi/files/bases.py và phần xử lý symlink của lệnh organize; xác minh rằng symlink do organize tạo ra không được upload hai lần và upload hoàn tất mà không có POST trùng lặp hoặc traceback.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

UX

I'm running a local instance of dandi-archive (master) using dandi-schema (master).

I've installed dandi cli via pip install dandi in a separate venv

pip freeze | grep dandi  
dandi==0.69.3
dandischema==0.11.1
$ dandi organize .
$ dandi upload . 
Output and traceback
2025-06-05 13:11:07,679 [    INFO] Found 3 files to consider
PATH                                                                     SIZE    ERRORS PROGRESS STATUS           MESSAGE                  
dandiset.yaml                                                            2.3 kB                  skipped          should be edited online  
...-unsorted-nac/sub-Temp-pref-F30-B30-5dpf-01-unsorted-nac_behavior.nwb 9.3 MB                  pre-validating                            
...mp-pref-F30-B30-5dpf-01-unsorted-nac_ses-20230808T111800_behavior.nwb 9.3 MB                  pre-validating                            
Summary:                                                                 18.7 MB                 1 skipped        1 should be edited online
                                                                                                 2 pre-validating                          
/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/hdmf/spec/namespace.py:583: UserWarning: Ignoring the following cached namespace(s) because another version is already loaded:
core - cached version: 2.4.0, loaded version: 2.8.0
The loaded extension(s) may not be compatible with the cached extension(s) in the file. Please check the extension documentation and ignore this warning if these versions are compatible.
  self.warn_for_ignored_namespaces(ignored_namespaces)
PATH                                                    SIZE    ERRORS PROGRESS STATUS                MESSAGE                              dandiset.yaml                                           2.3 kB                  skipped               should be edited online              
...-Temp-pref-F30-B30-5dpf-01-unsorted-nac_behavior.nwb 9.3 MB    0             ERROR                 Error 404 while sending POST reque...
...dpf-01-unsorted-nac_ses-20230808T111800_behavior.nwb 9.3 MB    0             ERROR                 Error 404 while sending POST reque...
Summary:                                                18.7 MB                 1 skipped             1 should be edited online            
                                                                                2 ERROR               2 Error some while sending POST re...
2025-06-05 13:11:08,841 [    INFO] Logs saved in /home/austin/.local/state/dandi-cli/log/2025.06.05-18.11.07Z-553648.log
Traceback (most recent call last):
  File "/home/austin/.pyenv/versions/tmp-dandi-cli/bin/dandi", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/click/decorators.py", line 45, in new_func
    return f(get_current_context().obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/dandi/cli/base.py", line 126, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/dandi/cli/cmd_upload.py", line 103, in upload
    upload(
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/dandi/upload.py", line 461, in upload
    raise upload_err
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/dandi/upload.py", line 359, in process_path
    for r in dfile.iter_upload(
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/dandi/files/bases.py", line 363, in iter_upload
    resp = client.post(
           ^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/dandi/dandiapi.py", line 317, in post
    return self.request("POST", path, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/austin/.pyenv/versions/3.11.12/envs/tmp-dandi-cli/lib/python3.11/site-packages/dandi/dandiapi.py", line 285, in request
    raise HTTP404Error(msg, response=result)
dandi.exceptions.HTTP404Error: Error 404 while sending POST request to http://localhost:8000/api/uploads/initialize/: {"detail":"Not found."}

The upload has made it into my dandiset locally, but we do have that traceback. Looking closer, I think this happens because dandi organize created a symlink, and dandi upload essentially tries to upload the same file twice.

Ngôn ngữ chính
Python
Star
28
Fork
37
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dandi/dandi-cli

Tất cả issue của dandi/dandi-cli

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.