Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Failed to extract metadata: Indexing elements must be in increasing order

Abierto
#1,864 8 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python
Área
cli

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 validate runs 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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dandi/dandi-cli

Todos los issues de dandi/dandi-cli

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.