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

Nightly build is failing #869

Closed
github-actions bot opened this issue Dec 31, 2024 · 1 comment
Closed

Nightly build is failing #869

github-actions bot opened this issue Dec 31, 2024 · 1 comment

Comments

@github-actions
Copy link
Contributor

The Nightly workflow is failing.
The tests failed.
Log:

============================= test session starts ==============================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /home/runner/work/siphon/siphon
configfile: pyproject.toml
collected 291 items

tests/cdmr/test_cdmremote.py FFFF [ 1%]
tests/cdmr/test_cdmremotefeature.py EEE [ 2%]
tests/cdmr/test_coveragedataset.py FF [ 3%]
tests/cdmr/test_dataset.py EEEEEEEFFFFFFFFFFFFFFFFFFFFFFFFFFEEEEEEEEEE [ 17%]
tests/cdmr/test_ncstream.py ..F.. [ 19%]
tests/cdmr/test_xarray.py F [ 19%]
tests/test_acis.py FFFFF [ 21%]
tests/test_catalog.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 34%]
tests/test_catalog_access.py FFFFFFFFFFFFFFFF [ 39%]
tests/test_http_util.py FF..............F.FFF. [ 47%]
tests/test_iastate.py FFFFFFFF [ 50%]
tests/test_igra2.py FFFF [ 51%]
tests/test_metadata.py ........................................... [ 66%]
tests/test_ncss.py .....EEEEEEEEEEEEE [ 72%]
tests/test_ncss_dataset.py ......................................FFFF [ 86%]
tests/test_ndbc.py FFFFFFFFFFF. [ 91%]
tests/test_radarsever.py ...EEEEEEEEEFFFFFFF [ 97%]
tests/test_wyoming.py FFFFFFF [100%]

==================================== ERRORS ====================================
_____________________ ERROR at setup of test_feature_type ______________________

@pytest.fixture
@recorder.use_cassette('cdmrf_header')
def cdmrf():
    """Set up all tests to point to the same dataset."""
  return CDMRemoteFeature('http://localhost:8080/thredds/cdmrfeature/grid/'
                            'test/HRRR_CONUS_2p5km_20160309_1600.grib2')

tests/cdmr/test_cdmremotefeature.py:20:


/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/http_util.py:383: in init
self._get_metadata()
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/cdmr/cdmremotefeature.py:22: in _get_metadata
self.metadata = self.fetch_header()
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/cdmr/cdmremotefeature.py:28: in fetch_header
return self._parse_messages(self.get_query(query).content)[0]
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/http_util.py:406: in get_query
return self.get(url, query)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/http_util.py:482: in get
resp = self._session.get(path, params=params)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/sessions.py:602: in get
return self.request("GET", url, **kwargs)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/sessions.py:703: in send
r = adapter.send(request, **kwargs)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/adapters.py:667: in send
resp = conn.urlopen(
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/urllib3/connectionpool.py:787: in urlopen
response = self._make_request(


self = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f1020dbc4d0>
conn = <vcr.patch.VCRRequestsHTTPConnection/home/runner/work/siphon/siphon/tests/cdmr/fixtures/cdmrf_header object at 0x7f1020dbc470>
method = 'GET'
url = '/thredds/cdmrfeature/grid/test/HRRR_CONUS_2p5km_20160309_1600.grib2?req=header'
body = None
headers = {'User-Agent': 'Siphon (0.10.0.post14+g9a6471e.d20241231)', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive'}
retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)
timeout = Timeout(connect=None, read=None, total=None), chunked = False
response_conn = <vcr.patch.VCRRequestsHTTPConnection/home/runner/work/siphon/siphon/tests/cdmr/fixtures/cdmrf_header object at 0x7f1020dbc470>
preload_content = False, decode_content = False, enforce_content_length = True

def _make_request(
    self,
    conn: BaseHTTPConnection,
    method: str,
    url: str,
    body: _TYPE_BODY | None = None,
    headers: typing.Mapping[str, str] | None = None,
    retries: Retry | None = None,
    timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
    chunked: bool = False,
    response_conn: BaseHTTPConnection | None = None,
    preload_content: bool = True,
    decode_content: bool = True,
    enforce_content_length: bool = True,
) -> BaseHTTPResponse:
    """
    Perform a request on a given urllib connection object taken from our
    pool.

    :param conn:
        a connection from one of our connection pools

    :param method:
        HTTP request method (such as GET, POST, PUT, etc.)

    :param url:
        The URL to perform the request on.

    :param body:
        Data to send in the request body, either :class:`str`, :class:`bytes`,
        an iterable of :class:`str`/:class:`bytes`, or a file-like object.

    :param headers:
        Dictionary of custom headers to send, such as User-Agent,
        If-None-Match, etc. If None, pool headers are used. If provided,
        these headers completely replace any pool-specific headers.

    :param retries:
        Configure the number of retries to allow before raising a
        :class:`~urllib3.exceptions.MaxRetryError` exception.

        Pass ``None`` to retry until you receive a response. Pass a
        :class:`~urllib3.util.retry.Retry` object for fine-grained control
        over different types of retries.
        Pass an integer number to retry connection errors that many times,
        but no other types of errors. Pass zero to never retry.

        If ``False``, then retries are disabled and any exception is raised
        immediately. Also, instead of raising a MaxRetryError on redirects,
        the redirect response will be returned.

    :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.

    :param timeout:
        If specified, overrides the default timeout for this one
        request. It may be a float (in seconds) or an instance of
        :class:`urllib3.util.Timeout`.

    :param chunked:
        If True, urllib3 will send the body using chunked transfer
        encoding. Otherwise, urllib3 will send the body using the standard
        content-length form. Defaults to False.

    :param response_conn:
        Set this to ``None`` if you will handle releasing the connection or
        set the connection to have the response release it.

    :param preload_content:
      If True, the response's body will be preloaded during construction.

    :param decode_content:
        If True, will attempt to decode the body based on the
        'content-encoding' header.

    :param enforce_content_length:
        Enforce content length checking. Body returned by server must match
        value of Content-Length header, if present. Otherwise, raise error.
    """
    self.num_requests += 1

    timeout_obj = self._get_timeout(timeout)
    timeout_obj.start_connect()
    conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout)

    try:
        # Trigger any extra validation we need to do.
        try:
            self._validate_conn(conn)
        except (SocketTimeout, BaseSSLError) as e:
            self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
            raise

    # _validate_conn() starts the connection to an HTTPS proxy
    # so we need to wrap errors with 'ProxyError' here too.
    except (
        OSError,
        NewConnectionError,
        TimeoutError,
        BaseSSLError,
        CertificateError,
        SSLError,
    ) as e:
        new_e: Exception = e
        if isinstance(e, (BaseSSLError, CertificateError)):
            new_e = SSLError(e)
        # If the connection didn't successfully connect to it's proxy
        # then there
        if isinstance(
            new_e, (OSError, NewConnectionError, TimeoutError, SSLError)
        ) and (conn and conn.proxy and not conn.has_connected_to_proxy):
            new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
        raise new_e

    # conn.request() calls http.client.*.request, not the method in
    # urllib3.request. It also calls makefile (recv) on the socket.
    try:
        conn.request(
            method,
            url,
            body=body,
            headers=headers,
            chunked=chunked,
            preload_content=preload_content,
            decode_content=decode_content,
            enforce_content_length=enforce_content_length,
        )

    # We are swallowing BrokenPipeError (errno.EPIPE) since the server is
    # legitimately able to close the connection after sending a valid response.
    # With this behaviour, the received response is still readable.
    except BrokenPipeError:
        pass
    except OSError as e:
        # MacOS/Linux
        # EPROTOTYPE and ECONNRESET are needed on macOS
        # https://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
        # Condition changed later to emit ECONNRESET instead of only EPROTOTYPE.
        if e.errno != errno.EPROTOTYPE and e.errno != errno.ECONNRESET:
            raise

    # Reset the timeout for the recv() on the socket
    read_timeout = timeout_obj.read_timeout

    if not conn.is_closed:
        # In Python 3 socket.py will catch EAGAIN and return None when you
        # try and read into the file pointer created by http.client, which
        # instead raises a BadStatusLine exception. Instead of catching
        # the exception and assuming all BadStatusLine exceptions are read
        # timeouts, check for a zero timeout before making the request.
        if read_timeout == 0:
            raise ReadTimeoutError(
                self, url, f"Read timed out. (read timeout={read_timeout})"
            )
        conn.timeout = read_timeout

    # Receive the response from the server
    try:
        response = conn.getresponse()
    except (BaseSSLError, OSError) as e:
        self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
        raise

    # Set properties that are used by the pooling layer.
    response.retries = retries
    response._connection = response_conn  # type: ignore[attr-defined]
    response._pool = self  # type: ignore[attr-defined]

    log.debug(
        '%s://%s:%s "%s %s %s" %s %s',
        self.scheme,
        self.host,
        self.port,
        method,
        url,
      response.version_string,
        response.status,
        response.length_remaining,
    )

E AttributeError: 'VCRHTTPResponse' object has no attribute 'version_string'

/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/urllib3/connectionpool.py:551: AttributeError
_________________________ ERROR at setup of test_data __________________________

@pytest.fixture
@recorder.use_cassette('cdmrf_header')
def cdmrf():
    """Set up all tests to point to the same dataset."""
  return CDMRemoteFeature('http://localhost:8080/thredds/cdmrfeature/grid/'
                            'test/HRRR_CONUS_2p5km_20160309_1600.grib2')

tests/cdmr/test_cdmremotefeature.py:20:


/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/http_util.py:383: in init
self._get_metadata()
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/cdmr/cdmremotefeature.py:22: in _get_metadata
self.metadata = self.fetch_header()
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/cdmr/cdmremotefeature.py:28: in fetch_header
return self._parse_messages(self.get_query(query).content)[0]
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/http_util.py:406: in get_query
return self.get(url, query)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/siphon/http_util.py:482: in get
resp = self._session.get(path, params=params)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/sessions.py:602: in get
return self.request("GET", url, **kwargs)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/sessions.py:703: in send
r = adapter.send(request, **kwargs)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/requests/adapters.py:667: in send
resp = conn.urlopen(
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/urllib3/connectionpool.py:787: in urlopen
response = self._make_request(


self = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f1020dbec30>
conn = <vcr.patch.VCRRequestsHTTPConnection/home/runner/work/siphon/siphon/tests/cdmr/fixtures/cdmrf_header object at 0x7f1020dbeb70>
method = 'GET'
url = '/thredds/cdmrfeature/grid/test/HRRR_CONUS_2p5km_20160309_1600.grib2?req=header'
body = None
headers = {'User-Agent': 'Siphon (0.10.0.post14+g9a6471e.d20241231)', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive'}
retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)
timeout = Timeout(connect=None, read=None, total=None), chunked = False
response_conn = <vcr.patch.VCRRequestsHTTPConnection/home/runner/work/siphon/siphon/tests/cdmr/fixtures/cdmrf_header object at 0x7f1020dbeb70>
preload_content = False, decode_content = False, enforce_content_length = True

def _make_request(
    self,
    conn: BaseHTTPConnection,
    method: str,
    url: str,
    body: _TYPE_BODY | None = None,
    headers: typing.Mapping[str, str] | None = None,
    retries: Retry | None = None,
    timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
    chunked: bool = False,
    response_conn: BaseHTTPConnection | None = None,
    preload_content: bool = True,
    decode_content: bool = True,
    enforce_content_length: bool = True,
) -> BaseHTTPResponse:
    """
    Perform a request on a given urllib connection object taken from our
    pool.

    :param conn:
        a connection from one of our connection pools

    :param method:
        HTTP request method (such as GET, POST, PUT, etc.)

    :param url:
        The URL to perform the request on.

    :param body:
        Data to send in the request body, either :class:`str`, :class:`bytes`,
        an iterable of :class:`str`/:class:`bytes`, or a file-like object.

    :param headers:
        Dictionary of custom headers to send, such as User-Agent,
        If-None-Match, etc. If None, pool headers are used. If provided,
        these headers completely replace any pool-specific headers.

    :param retries:
        Configure the number of retries to allow before raising a
        :class:`~urllib3.exceptions.MaxRetryError` exception.

        Pass ``None`` to retry until you receive a response. Pass a
        :class:`~urllib3.util.retry.Retry` object for fine-grained control
        over different types of retries.
        Pass an integer number to retry connection errors that many times,
        but no other types of errors. Pass zero to never retry.

        If ``False``, then retries are disabled and any exception is raised
        immediately. Also, instead of raising a MaxRetryError on redirects,
        the redirect response will be returned.

    :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.

    :param timeout:
        If specified, overrides the default timeout for this one
        request. It may be a float (in seconds) or an instance of
        :class:`urllib3.util.Timeout`.

    :param chunked:
        If True, urllib3 will send the body using chunked transfer
        encoding. Otherwise, urllib3 will send the body using the standard
        content-length form. Defaults to False.

    :param response_conn:
        Set this to ``None`` if you will handle releasing the connection or
        set the connection to have the response release it.

    :param preload_content:
      If True, the response's body will be preloaded during construction.

    :param decode_content:
        If True, will attempt to decode the body based on the
        'content-encoding' header.

    :param enforce_content_length:
        Enforce content length checking. Body returned by server must match
        value of Content-Length header, if present. Otherwise, raise error.
    """
    self.num_requests += 1

    timeout_obj = self._get_timeout(timeout)
    timeout_obj.start_connect()
    conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout)

    try:
        # Trigger any extra validation we need to do.
        try:
            self._validate_conn(conn)
        except (SocketTimeout, BaseSSLError) as e:
            self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
            raise

    # _validate_conn() starts the connection to an HTTPS proxy
    # so we need to wrap errors with 'ProxyError' here too.
    except (
        OSError,
        NewConnectionError,
        TimeoutError,
        BaseSSLError,
        CertificateError,
        SSLError,
    ) as e:
        new_e: Exception = e
        if isinstance(e, (BaseSSLError, CertificateError)):
            new_e = SSLError(e)
        # If the connection didn't successfully connect to it's proxy
        # then there
        if isinstance(
            new_e, (OSError, NewConnectionError, TimeoutError, SSLError)
        ) and (conn and conn.proxy and not conn.has_connected_to_proxy):
            new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
        raise new_e

    # conn.request() calls http.client.*.request, not the method in
    # urllib3.request. It also calls makefile (recv) on the socket.
    try:
        conn.request(
            method,
            url,
            body=body,
            headers=headers,
            chunked=chunked,
            preload_content=preload_content,
            decode_content=decode_content,
            enforce_content_length=enforce_content_length,
        )

    # We are swallowing BrokenPipeError (errno.EPIPE) since the server is
    # legitimately able to close the connection after sending a valid response.
    # With this behaviour, the received response is still readable.
    except BrokenPipeError:
        pass
    except OSError as e:
        # MacOS/Linux
        # EPROTOTYPE and ECONNRESET are needed on macOS
        # https://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
        # Condition changed later to emit ECONNRESET instead of only EPROTOTYPE.
        if e.errno != errno.EPROTOTYPE and e.errno != errno.ECONNRESET:
            raise

    # Reset the timeout for the recv() on the socket
    read_timeout = timeout_obj.read_timeout

    if not conn.is_closed:
        # In Python 3 socket.py will catch EAGAIN and return None when you
</pre></details>
@dopplershift
Copy link
Member

Should be fixed with the merge of #868.

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

No branches or pull requests

1 participant