Failed to extract metadata: Indexing elements must be in increasing order
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
Línea de trabajo
Comienza en dandi/pynwb_utils.py, en _get_session_duration(), especialmente en la línea indicada en el traceback, y reproduce el fallo con el archivo NWB mencionado mediante dandi upload. Compara sus datos de temporización de la sesión con los de los dos archivos que se cargan correctamente. El trabajo estará terminado cuando la extracción de metadatos y la carga dejen de fallar para este archivo, con cobertura para el caso notificado si se identifica una ubicación de prueba existente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello,
I've made some nwb files and am trying to upload them to DANDI using dandi upload. I have three of them. Two upload just fine. The other one hits this error trace:
2026-05-28T16:06:11+0100 [WARNING ] dandi 923713:127939540670144 Failed to extract NWB metadata from /home/nolanlab/fromgit/nolanlab_nwb/001854/sub-M22/sub-M22_ses-D34OF2_ecephys+behavior.nwb: TypeError: Indexing elements must be in increasing order
2026-05-28T16:06:11+0100 [ERROR ] dandi 923713:127939540670144 Error uploading /home/nolanlab/fromgit/nolanlab_nwb/001854/sub-M22/sub-M22_ses-D34OF2_ecephys+behavior.nwb:
Traceback (most recent call last):
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/upload.py", line 392, in process_path
metadata = dfile.get_metadata(
~~~~~~~~~~~~~~~~~~^
digest=file_etag, ignore_errors=allow_any_path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
).model_dump(mode="json", exclude_none=True)
^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/files/bases.py", line 494, in get_metadata
metadata = nwb2asset(self.filepath, digest=digest)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/metadata/nwb.py", line 149, in nwb2asset
metadata = get_metadata(nwb_path)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/fscacher/cache.py", line 164, in fingerprinter
ret = fingerprinted(*args, **kwargs_)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/joblib/memory.py", line 607, in __call__
return self._cached_call(args, kwargs, shelving=False)[0]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/joblib/memory.py", line 562, in _cached_call
return self._call(call_id, args, kwargs, shelving)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/joblib/memory.py", line 832, in _call
output = self.func(*args, **kwargs)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/fscacher/cache.py", line 100, in fingerprinted
return f(path, *args, **kwargs)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/metadata/nwb.py", line 106, in get_metadata
meta.update(_get_pynwb_metadata(r))
~~~~~~~~~~~~~~~~~~~^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/pynwb_utils.py", line 279, in _get_pynwb_metadata
session_duration = _get_session_duration(nwb)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/pynwb_utils.py", line 350, in _get_session_duration
start = float(np.min(np.r_[st_data[0], st_data[idxs[:-1]]]))
~~~~~~~^^^^^^^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/hdmf/container.py", line 1002, in __getitem__
return self.get(args)
~~~~~~~~^^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/hdmf/common/table.py", line 61, in get
return super().get(key)
~~~~~~~~~~~^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/hdmf/container.py", line 1010, in get
return self.data[args]
~~~~~~~~~^^^^^^
File "h5py/_objects.pyx", line 56, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 57, in h5py._objects.with_phil.wrapper
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/h5py/_hl/dataset.py", line 893, in __getitem__
selection = sel.select(self.shape, args, dataset=self)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/h5py/_hl/selections.py", line 82, in select
return selector.make_selection(args)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "h5py/_selector.pyx", line 282, in h5py._selector.Selector.make_selection
File "h5py/_selector.pyx", line 215, in h5py._selector.Selector.apply_args
TypeError: Indexing elements must be in increasing order
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/upload.py", line 396, in process_path
raise UploadError("failed to extract metadata: %s" % str(e))
dandi.exceptions.UploadError: failed to extract metadata: Indexing elements must be in increasing order
2026-05-28T16:06:11+0100 [DEBUG ] urllib3.connectionpool 923713:127941258118976 Starting new HTTPS connection (1): rig.mit.edu:443
2026-05-28T16:06:16+0100 [DEBUG ] dandi 923713:127941258118976 Caught exception failed to extract metadata: Indexing elements must be in increasing order
Traceback (most recent call last):
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/upload.py", line 392, in process_path
metadata = dfile.get_metadata(
~~~~~~~~~~~~~~~~~~^
digest=file_etag, ignore_errors=allow_any_path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
).model_dump(mode="json", exclude_none=True)
^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/files/bases.py", line 494, in get_metadata
metadata = nwb2asset(self.filepath, digest=digest)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/metadata/nwb.py", line 149, in nwb2asset
metadata = get_metadata(nwb_path)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/fscacher/cache.py", line 164, in fingerprinter
ret = fingerprinted(*args, **kwargs_)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/joblib/memory.py", line 607, in __call__
return self._cached_call(args, kwargs, shelving=False)[0]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/joblib/memory.py", line 562, in _cached_call
return self._call(call_id, args, kwargs, shelving)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/joblib/memory.py", line 832, in _call
output = self.func(*args, **kwargs)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/fscacher/cache.py", line 100, in fingerprinted
return f(path, *args, **kwargs)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/metadata/nwb.py", line 106, in get_metadata
meta.update(_get_pynwb_metadata(r))
~~~~~~~~~~~~~~~~~~~^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/pynwb_utils.py", line 279, in _get_pynwb_metadata
session_duration = _get_session_duration(nwb)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/pynwb_utils.py", line 350, in _get_session_duration
start = float(np.min(np.r_[st_data[0], st_data[idxs[:-1]]]))
~~~~~~~^^^^^^^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/hdmf/container.py", line 1002, in __getitem__
return self.get(args)
~~~~~~~~^^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/hdmf/common/table.py", line 61, in get
return super().get(key)
~~~~~~~~~~~^^^^^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/hdmf/container.py", line 1010, in get
return self.data[args]
~~~~~~~~~^^^^^^
File "h5py/_objects.pyx", line 56, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 57, in h5py._objects.with_phil.wrapper
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/h5py/_hl/dataset.py", line 893, in __getitem__
selection = sel.select(self.shape, args, dataset=self)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/h5py/_hl/selections.py", line 82, in select
return selector.make_selection(args)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "h5py/_selector.pyx", line 282, in h5py._selector.Selector.make_selection
File "h5py/_selector.pyx", line 215, in h5py._selector.Selector.apply_args
TypeError: Indexing elements must be in increasing order
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/cli/base.py", line 126, in wrapper
return f(*args, **kwargs)
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/cli/cmd_upload.py", line 113, in upload
upload_(
~~~~~~~^
paths,
^^^^^^
...<9 lines>...
validation_log_path=companion,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/upload.py", line 505, in upload
raise upload_err
File "/home/nolanlab/fromgit/nolanlab_nwb/.venv/lib/python3.13/site-packages/dandi/upload.py", line 396, in process_path
raise UploadError("failed to extract metadata: %s" % str(e))
dandi.exceptions.UploadError: failed to extract metadata: Indexing elements must be in increasing order
I don't know what this means, or how to proceed.
Strange things:
dandi validateruns fine.- the metadata is generated in the same way for all nwb files, so I don' t understand why only one of them would fail.
- When I open the nwb file using pynwb, it looks fine and all the metadata looks reasonable.
Any advice very welcome!
- Lenguaje dominante
- Python
- Estrellas
- 29
- Forks
- 37
- Merge medio
- 1 d 10 h
- PR fusionados (30 d)
- 17
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dandi/dandi-cli
-
pynwb metadata: get neurodata typesQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
`metadata.nwb.get_metadata()` validates the whole BIDS dataset for every NWB file, then discards the resultPosiblemente ocupada @CodyCBakerPhD la tomó hace 9 días. AbiertoBIDS performance
dandi/dandi-cli#1962 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
BIDS bug
Dificultad 3/5 Medio día Aptitud para principiantes 45/100
dandi/dandi-cli#1961 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
dandi/dandi-cli#1920 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
Todos los issues de dandi/dandi-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
aws-samples/sample-per-model-bedrock#464 ·
Los mantenedores suelen responder en 1 día
-
lesson-submission pending-review
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Ikalus1988/MisakaNet#3789 ·
Los mantenedores suelen responder en 1 día
-
Python Volcengine provider returns failures instead of raising themPosiblemente ocupada @Ricardo-M-L la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
agent-infra/sandbox#248 ·
-
[Bug] cloud JSON directory loading assumes a Key field in fsspec listingsPosiblemente ocupada @Ricardo-M-L la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
hiyouga/LlamaFactory#10910 ·
Los mantenedores suelen responder en 1 día
-
Bundled uv is never updated and trusts the compromised eMudhra certificatesPosiblemente ocupada @FabienDanieau la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100