Unable to update a registered file

Abierto
#85 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
api, backend

Línea de trabajo

Empieza por tests/test_versioning.py, especialmente por test_register_update_file y update_file, y luego sigue la solicitud a través de nexussdk/files.py y nexussdk/utils/http.py. Reproduce la actualización contra el entorno de stage e inspecciona la URL PUT y los parámetros generados. Se considera terminado cuando actualizar un archivo registrado crea la nueva versión solicitada sin el error de conexión.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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".

Lenguaje dominante
Python
Estrellas
6
Forks
10
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

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 BlueBrain/nexus-python-sdk

Todos los issues de BlueBrain/nexus-python-sdk

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.