dandi / dandi/dandi-cli

"File etag changed" error when reuploading existing nwb files

Open
#764 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
28
Forks
37
Avg merge
1d 17h
Merged PRs (30d)
9

Description

### Bug description
Not sure if this is a bug or if I'm doing something wrong?

I've made some changes to a nwb files for a dandiset I created last year (https://gui.dandiarchive.org/#/dandiset/000039). I'm trying to reupload the updated nwb files using the dandi cli, but when I try `dandi upload` command 10 of the 100 nwb files produce an ERROR message with " File etag changed". The other 90 nwb files indicate the uploading was completed but I don't see anything changes on the repo.

### How to reproduce
I first use pynwb to generate 100 nwb session files for ophys data we have, and save them in dir __output_contrast_090121/__. The nwb generation is not producing any issues and I'm able to open/read the files as expected. Then to reupload them I do the following:

```
$ dandi validate output_contrast_090121/ # Summary: No validation errors among 100 file(s)
$ dandi download https://dandiarchive.org/dandiset/000039/draft
$ cd 000039/
$ find . -type l -exec unlink {} \; # if I don't do this the next step give a 100 paths already exists warning
$ dandi organize ../output_contrast_090121/ -f dry
$ dandi organize ../output_contrast_090121/ # Organized 100 paths.
$ dandi upload
```
The upload runs for ~20 minutes and most of the nwb files have a "100% done" with "exists (older) - reuploading" message. But 10 produce an "ERROR" status (can't read the message in the cli). However none of the files are being re-uploaded.

### Your personal set up
I'm using a new anaconda environment, pynwb and dandi were last installed using pip on sept 01, 2021.

- OS: Ubuntu 18.04

- Version(s): dandi 0.27.0, Python 3.7.11

- Full environment

```
_libgcc_mutex 0.1 main
appdirs 1.4.4
attrs 21.2.0
blas 1.0 mkl
blessings 1.7
ca-certificates 2021.7.5 h06a4308_1
cached-property 1.5.2
certifi 2021.5.30 py37h06a4308_0
cffi 1.14.6
charset-normalizer 2.0.4
ci-info 0.2.0
click 8.0.1
click-didyoumean 0.0.3
cryptography 3.4.8
cycler 0.10.0 py37_0
dandi 0.27.0
dandischema 0.3.2
dbus 1.13.18 hb2f20db_0
dnspython 2.1.0
email-validator 1.1.3
etelemetry 0.2.2
expat 2.4.1 h2531618_2
fasteners 0.16.3
fontconfig 2.13.1 h6c09931_0
freetype 2.10.4 h5ab3b9f_0
fscacher 0.1.4
giflib 5.2.1 h7b6447c_0
glib 2.69.1 h5202010_0
gst-plugins-base 1.14.0 h8213a91_2
gstreamer 1.14.0 h28cd5cc_2
h5py 3.4.0
hdmf 3.1.1
humanize 3.11.0
icu 58.2 he6710b0_3
idna 3.2
importlib-metadata 4.8.1
intel-openmp 2021.3.0 h06a4308_3350
jeepney 0.7.1
joblib 1.0.1
jpeg 9b h024ee3a_2
jsonschema 3.2.0
keyring 23.1.0
keyrings.alt 4.1.0
kiwisolver 1.3.1 py37h2531618_0
krb5 1.19.2 hac12032_0
lcms2 2.12 h3be6417_0
ld_impl_linux-64 2.35.1 h7274673_9
libedit 3.1.20210714 h7f8727e_0
libffi 3.3 he6710b0_2
libgcc-ng 9.1.0 hdf63c60_0
libpng 1.6.37 hbc83047_0
libpq 12.2 h553bfba_1
libstdcxx-ng 9.1.0 hdf63c60_0
libtiff 4.2.0 h85742a9_0
libuuid 1.0.3 h1bed415_2
libwebp 1.2.0 h89dd481_0
libwebp-base 1.2.0 h27cfd23_0
libxcb 1.14 h7b6447c_0
libxml2 2.9.10 hb55368b_3
lz4-c 1.9.3 h295c915_1
matplotlib 3.3.4 py37h06a4308_0
matplotlib-base 3.3.4 py37h62a2d02_0
mkl 2021.3.0 h06a4308_520
mkl-service 2.4.0 py37h7f8727e_0
mkl_fft 1.3.0 py37h42c9631_2
mkl_random 1.2.2 py37h51133e4_0
ncurses 6.2 he6710b0_1
numexpr 2.7.3
numpy 1.21.2
numpy 1.20.3 py37hf144106_0
numpy-base 1.20.3 py37h74d4b33_0
olefile 0.46 py_0
openssl 1.1.1k h27cfd23_0
packaging 21.0
pandas 1.3.2
pcre 8.45 h295c915_0
pillow 8.3.1 py37h5aabda8_0
pip 21.2.2 py37h06a4308_0
psycopg2 2.8.6 py37h3c74f83_1
pycparser 2.20
pycryptodomex 3.10.1
pydantic 1.8.2
pynwb 2.0.0
pyout 0.7.1
pyparsing 2.4.7 pyhd3eb1b0_0
pyqt 5.9.2 py37h05f1152_2
pyrsistent 0.18.0
python 3.7.11 h12debd9_0
python-dateutil 2.8.2 pyhd3eb1b0_0
pytz 2021.1
qt 5.9.7 h5867ecd_1
readline 8.1 h27cfd23_0
requests 2.26.0
ruamel.yaml 0.17.16
ruamel.yaml.clib 0.2.6
scipy 1.7.1
SecretStorage 3.3.1
semantic-version 2.8.5
setuptools 52.0.0 py37h06a4308_0
sip 4.19.8 py37hf484d3e_0
six 1.16.0 pyhd3eb1b0_0
sqlite 3.36.0 hc218d9a_0
tables 3.6.1
tenacity 8.0.1
tk 8.6.10 hbc83047_0
tornado 6.1 py37h27cfd23_0
tqdm 4.62.2
typing-extensions 3.10.0.2
urllib3 1.26.6
wheel 0.37.0 pyhd3eb1b0_0
xz 5.2.5 h7b6447c_0
zipp 3.5.0
zlib 1.2.11 h7b6447c_3
zstd 1.4.9 haebb681_0
```

- Logs
I get the ERROR multiple times in the log, here is one example.

```
2021-09-01T17:24:03-0700 [INFO ] dandi 3287:140014276904704 sub-754469470/sub-754469470_ses-769811903_behavior+ophys.nwb: Asset successfully uploaded
2021-09-01T17:24:17-0700 [INFO ] dandi 3287:140014012835584 sub-666839638/sub-666839638_ses-695464266_behavior+ophys.nwb: Asset successfully uploaded
2021-09-01T17:24:18-0700 [WARNING ] dandi 3287:140013450815232 Failed to extract NWB metadata from /allen/programs/braintv/workgroups/neuralcoding/kaeld/targetedconstrast_nwb/000039/sub-710318403/sub-710318403_ses-731095575_behavior+ophys.nwb: ValueError: not able to parse the age: 19 weeksD, no rules to convert: D
2021-09-01T17:24:18-0700 [ERROR ] dandi 3287:140013450815232 Error uploading sub-710318403/sub-710318403_ses-731095575_behavior+ophys.nwb:
Traceback (most recent call last):
File "/allen/programs/braintv/workgroups/modelingsdk/local/miniconda3/envs/dandi/lib/python3.7/site-packages/dandi/upload.py", line 262, in process_path
path, metadata, jobs=jobs_per_file, replace_asset=extant
File "/allen/programs/braintv/workgroups/modelingsdk/local/miniconda3/envs/dandi/lib/python3.7/site-packages/dandi/dandiapi.py", line 772, in iter_upload_raw_asset
f"{filepath}: File etag changed; was originally"
RuntimeError: /allen/programs/braintv/workgroups/neuralcoding/kaeld/targetedconstrast_nwb/000039/sub-710318403/sub-710318403_ses-731095575_behavior+ophys.nwb: File etag changed; was originally ddce42382c7fc662e05e32509582296d-2 but is now 483786afda20b801e0ab35d8631b08a9-2

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.