Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 tests started to fail due to expired shub https certificate! #267

Closed
2 tasks done
yarikoptic opened this issue Aug 29, 2024 · 1 comment
Closed
2 tasks done

3 tests started to fail due to expired shub https certificate! #267

yarikoptic opened this issue Aug 29, 2024 · 1 comment
Assignees

Comments

@yarikoptic
Copy link
Member

yarikoptic commented Aug 29, 2024

From june 26 to 27 we started to have 3 tests to fail with a sample fail looking like

______________________________________________________________________________________________________ test_container_files ______________________________________________________________________________________________________
datalad_container/tests/test_run.py:94: in test_container_files
    ds.containers_add(
/usr/lib/python3/dist-packages/datalad/distribution/dataset.py:507: in apply_func
    return f(*args, **kwargs)
/usr/lib/python3/dist-packages/datalad/interface/base.py:773: in eval_func
    return return_func(*args, **kwargs)
/usr/lib/python3/dist-packages/datalad/interface/base.py:763: in return_func
    results = list(results)
/usr/lib/python3/dist-packages/datalad/interface/base.py:940: in _execute_command_
    raise IncompleteResultsError(
E   datalad.support.exceptions.IncompleteResultsError: Command did not complete successfully. 2 failed:
E   [{'action': 'containers_add',
E     'message': ('no image at %s',
E                 '/home/yoh/.tmp/datalad_temp_test_container_files8gz9m6xr/righthere'),
E     'path': '/home/yoh/.tmp/datalad_temp_test_container_files8gz9m6xr/righthere',
E     'status': 'error',
E     'type': 'file'},
E    {'action': 'containers_add',
E     'message': ('no image at %s',
E                 '/home/yoh/.tmp/datalad_temp_test_container_files8gz9m6xr/righthere'),
E     'path': '/home/yoh/.tmp/datalad_temp_test_container_files8gz9m6xr/righthere',
E     'status': 'error',
E     'type': 'file'}]
------------------------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------------------------
INFO     datalad:log.py:432 Clear progress bars
INFO     datalad:log.py:432 Refresh progress bars
INFO     datalad.customremotes:base.py:110 Initializing special remote datalad
======================================================================================================== warnings summary ========================================================================================================
../../../../../usr/lib/python3/dist-packages/datalad/tests/utils_pytest.py:76
  /usr/lib/python3/dist-packages/datalad/tests/utils_pytest.py:76: PytestUnknownMarkWarning: Unknown pytest.mark.network - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    return getattr(pytest.mark, name)

../../../../../usr/lib/python3/dist-packages/datalad/tests/utils_pytest.py:76
  /usr/lib/python3/dist-packages/datalad/tests/utils_pytest.py:76: PytestUnknownMarkWarning: Unknown pytest.mark.skip_if_no_network - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    return getattr(pytest.mark, name)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================================================================================== short test summary info =====================================================================================================
FAILED datalad_container/tests/test_run.py::test_container_files - datalad.support.exceptions.IncompleteResultsError: Command did not complete successfully. 2 failed:

so nothing really hinting on what is going on! Looking at what image we are trying to get, and calling singularity directly:

❯ singularity pull shub://datalad/datalad-container:testhelper
FATAL:   While pulling shub image: error fetching image to cache: failed to get manifest for: shub://datalad/datalad-container:testhelper: no response received from singularity hub

gives us a little clarity, but above we should have reported that -- that singularity failed to pull or smth like that instead of that image is not there! Then running with --debug got actual URL

❯ singularity --debug pull shub://datalad/datalad-container:testhelper
DEBUG   [U=47521,P=72252]  persistentPreRun()            Singularity version: 4.1.2
DEBUG   [U=47521,P=72252]  persistentPreRun()            Parsing configuration file /etc/singularity/singularity.conf
DEBUG   [U=47521,P=72252]  maybeReExec()                 Checking whether to re-exec
DEBUG   [U=47521,P=72252]  handleConfDir()               /home/yoh/.singularity already exists. Not creating.
DEBUG   [U=47521,P=72252]  getCacheParentDir()           environment variable SINGULARITY_CACHEDIR not set, using default image cache
DEBUG   [U=47521,P=72252]  GetManifest()                 shub request: https://singularity-hub.org/api/container/datalad/datalad-container:testhelper
FATAL   [U=47521,P=72252]  pullRun()                     While pulling shub image: error fetching image to cache: failed to get manifest for: shub://datalad/datalad-container:testhelper: no response received from singularity hub
❯ echo $?
255

to then realize that

image

So, ideally it is fixed by (in this order)

@yarikoptic yarikoptic self-assigned this Aug 29, 2024
yarikoptic added a commit to yarikoptic/datalad that referenced this issue Aug 29, 2024
Inspired by datalad/datalad-container#267

Before this change

    > datalad -l debug download-url shub://datalad/datalad-container:testhelper
    ...
    download_url(error): /home/yoh/.tmp/datalad_temp_test_container_files0tvyery_/ (file) [AccessFailedError(Failed to establish a new session 1 times. )] [Failed to establish a new session 1 times. ]
    [DEBUG  ] could not perform all requested actions: IncompleteResultsError(Command did not complete successfully. 1 failed:
    [{'action': 'download_url',
      'error_message': 'Failed to establish a new session 1 times. ',
      'exception': Failed to establish a new session 1 times.  [download_url.py:__call__:202,base.py:download:533,shub.py:access:50,shub.py:_resolve_url:39,base.py:fetch:643,shub.py:access:50,base.py:access:174,base.py:_fetch:589,http.py:get_downloader_session:633,http.py:get_downloader_session:618,sessions.py:get:602,sessions.py:request:589,sessions.py:send:703,adapters.py:send:517],
      'exception_traceback': '[download_url.py:__call__:202,base.py:download:533,shub.py:access:50,shub.py:_resolve_url:39,base.py:fetch:643,shub.py:access:50,base.py:access:174,base.py:_fetch:589,http.py:get_downloader_session:633,http.py:get_downloader_session:618,sessions.py:get:602,sessions.py:request:589,sessions.py:send:703,adapters.py:send:517]',
      'message': 'AccessFailedError(Failed to establish a new session 1 times. )',
      'path': '/home/yoh/.tmp/datalad_temp_test_container_files0tvyery_/',
      'status': 'error',
      'type': 'file'}])

so no information about actual problem is provided even in DEBUG output.
With this change we get at least full record containing it:

    [DEBUG  ] could not perform all requested actions: IncompleteResultsError(Command did not complete successfully. 1 failed:
    [{'action': 'download_url',
      'error_message': 'Failed to establish a new session 1 times. ',
      'exception': Failed to establish a new session 1 times.  -caused by- HTTPSConnectionPool(host='singularity-hub.org', port=443): Max retries exceeded with url: /api/container/datalad/datalad-container:testhelper (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1000)'))) [download_url.py:__call__:202,base.py:download:533,shub.py:access:50,shub.py:_resolve_url:39,base.py:fetch:643,shub.py:access:50,base.py:access:174,base.py:_fetch:589,http.py:get_downloader_session:633,http.py:get_downloader_session:618,sessions.py:get:602,sessions.py:request:589,sessions.py:send:703,adapters.py:send:517],
      'exception_traceback': '[download_url.py:__call__:202,base.py:download:533,shub.py:access:50,shub.py:_resolve_url:39,base.py:fetch:643,shub.py:access:50,base.py:access:174,base.py:_fetch:589,http.py:get_downloader_session:633,http.py:get_downloader_session:618,sessions.py:get:602,sessions.py:request:589,sessions.py:send:703,adapters.py:send:517]',
      'message': 'AccessFailedError(Failed to establish a new session 1 times. )',
      'path': '/home/yoh/.tmp/datalad_temp_test_container_files0tvyery_/',
      'status': 'error',
      'type': 'file'}])
yarikoptic added a commit to yarikoptic/datalad that referenced this issue Aug 29, 2024
… remotes

Inspired by

- datalad/datalad-container#267

but to be of benefit, requires review/merge/release of

- Lykos153/AnnexRemote#106

But should be safe otherwise since ATM (without the above PR) AnnexRemote simply ignores the message
@yarikoptic
Copy link
Member Author

we are green again:

❯ python -m pytest  --tb=short datalad_container/tests/test_run.py
=============================================================================== test session starts ================================================================================
platform linux -- Python 3.12.4, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/yoh/proj/datalad/datalad-container
configfile: pyproject.toml
plugins: cov-5.0.0
collected 9 items                                                                                                                                                                  

datalad_container/tests/test_run.py .........      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant