Source: python-ttn-client
Version: 1.2.1-2
Severity: serious
Tags: ftbfs
Justification: FTBFS

Dear maintainer,

During a test rebuild, python-ttn-client failed to rebuild.

It appears to require Internet access to run the tests, which is against
Debian policy.
https://www.debian.org/doc/debian-policy/ch-source.html#main-building-script-debian-rules

-------------------------------------------------------------------------------
[...]
* Building wheel...
Successfully built ttn_client-1.2.1-py3-none-any.whl
I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.12 with 
"installer" module
   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:311: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ttn-client/build; python3.12 -m pytest 
--no-cov
============================= test session starts ==============================
platform linux -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ttn-client/build
configfile: pyproject.toml
plugins: typeguard-4.3.0, timeout-2.3.1, asyncio-0.20.3, cov-5.0.0
asyncio: mode=Mode.STRICT
collected 12 items

tests/parsers/test_default.py ....                                       [ 33%]
tests/parsers/test_sensecap.py ....                                      [ 66%]
tests/test_client.py .F..                                                [100%]

=================================== FAILURES ===================================
__________________________ test_connection_auth_error __________________________

self = <aiohttp.connector.TCPConnector object at 0xffffaf46c680>
req = <aiohttp.client_reqrep.ClientRequest object at 0xffffb0f69760>
traces = []
timeout = ClientTimeout(total=600, connect=None, sock_read=None, 
sock_connect=None, ceil_threshold=5)

    async def _create_direct_connection(
        self,
        req: ClientRequest,
        traces: List["Trace"],
        timeout: "ClientTimeout",
        *,
        client_error: Type[Exception] = ClientConnectorError,
    ) -> Tuple[asyncio.Transport, ResponseHandler]:
        sslcontext = await self._get_ssl_context(req)
        fingerprint = self._get_fingerprint(req)
    
        host = req.url.raw_host
        assert host is not None
        # Replace multiple trailing dots with a single one.
        # A trailing dot is only present for fully-qualified domain names.
        # See https://github.com/aio-libs/aiohttp/pull/7364.
        if host.endswith(".."):
            host = host.rstrip(".") + "."
        port = req.port
        assert port is not None
        try:
            # Cancelling this lookup should not cancel the underlying lookup
            #  or else the cancel event will get broadcast to all the waiters
            #  across all connections.
>           hosts = await self._resolve_host(host, port, traces=traces)

/usr/lib/python3/dist-packages/aiohttp/connector.py:1301: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3/dist-packages/aiohttp/connector.py:911: in _resolve_host
    return await asyncio.shield(resolved_host_task)
/usr/lib/python3/dist-packages/aiohttp/connector.py:948: in 
_resolve_host_with_throttle
    addrs = await self._resolver.resolve(host, port, family=self._family)
/usr/lib/python3/dist-packages/aiohttp/resolver.py:37: in resolve
    infos = await self._loop.getaddrinfo(
/usr/lib/python3.12/asyncio/base_events.py:901: in getaddrinfo
    return await self.run_in_executor(
/usr/lib/python3.12/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

host = 'eu1.cloud.thethings.network', port = 443
family = <AddressFamily.AF_UNSPEC: 0>, type = <SocketKind.SOCK_STREAM: 1>
proto = 0, flags = <AddressInfo.AI_ADDRCONFIG: 32>

    def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
        """Resolve host and port into list of address info entries.
    
        Translate the host/port argument into a sequence of 5-tuples that 
contain
        all the necessary arguments for creating a socket connected to that 
service.
        host is a domain name, a string representation of an IPv4/v6 address or
        None. port is a string service name such as 'http', a numeric port 
number or
        None. By passing None as the value of host and port, you can pass NULL 
to
        the underlying C API.
    
        The family, type and proto arguments can be optionally specified in 
order to
        narrow the list of addresses returned. Passing zero as a value for each 
of
        these arguments selects the full range of results.
        """
        # We override this function since we want to translate the numeric 
family
        # and socket type values to enum constants.
        addrlist = []
>       for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E       socket.gaierror: [Errno -3] Temporary failure in name resolution

/usr/lib/python3.12/socket.py:976: gaierror

The above exception was the direct cause of the following exception:

dummy_client = <ttn_client.client.TTNClient object at 0xffffafb384d0>

    @pytest.mark.asyncio
    async def test_connection_auth_error(dummy_client):
        """Test that dummy credentials fail."""
    
        with pytest.raises(ttn_client.TTNAuthError):
>           await dummy_client.fetch_data()

tests/test_client.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
ttn_client/client.py:57: in fetch_data
    return await 
self.__storage_api_call(f"?last={fetch_last}&order=received_at")
ttn_client/client.py:71: in __storage_api_call
    session.get(
/usr/lib/python3/dist-packages/aiohttp/client.py:1353: in __aenter__
    self._resp = await self._coro
/usr/lib/python3/dist-packages/aiohttp/client.py:657: in _request
    conn = await self._connector.connect(
/usr/lib/python3/dist-packages/aiohttp/connector.py:564: in connect
    proto = await self._create_connection(req, traces, timeout)
/usr/lib/python3/dist-packages/aiohttp/connector.py:975: in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aiohttp.connector.TCPConnector object at 0xffffaf46c680>
req = <aiohttp.client_reqrep.ClientRequest object at 0xffffb0f69760>
traces = []
timeout = ClientTimeout(total=600, connect=None, sock_read=None, 
sock_connect=None, ceil_threshold=5)

    async def _create_direct_connection(
        self,
        req: ClientRequest,
        traces: List["Trace"],
        timeout: "ClientTimeout",
        *,
        client_error: Type[Exception] = ClientConnectorError,
    ) -> Tuple[asyncio.Transport, ResponseHandler]:
        sslcontext = await self._get_ssl_context(req)
        fingerprint = self._get_fingerprint(req)
    
        host = req.url.raw_host
        assert host is not None
        # Replace multiple trailing dots with a single one.
        # A trailing dot is only present for fully-qualified domain names.
        # See https://github.com/aio-libs/aiohttp/pull/7364.
        if host.endswith(".."):
            host = host.rstrip(".") + "."
        port = req.port
        assert port is not None
        try:
            # Cancelling this lookup should not cancel the underlying lookup
            #  or else the cancel event will get broadcast to all the waiters
            #  across all connections.
            hosts = await self._resolve_host(host, port, traces=traces)
        except OSError as exc:
            if exc.errno is None and isinstance(exc, asyncio.TimeoutError):
                raise
            # in case of proxy it is not ClientProxyConnectionError
            # it is problem of resolving proxy ip itself
>           raise ClientConnectorError(req.connection_key, exc) from exc
E           aiohttp.client_exceptions.ClientConnectorError: Cannot connect to 
host eu1.cloud.thethings.network:443 ssl:default [Temporary failure in name 
resolution]

/usr/lib/python3/dist-packages/aiohttp/connector.py:1307: ClientConnectorError
=============================== warnings summary ===============================
../../../../../../usr/lib/python3/dist-packages/_pytest/config/__init__.py:831
  /usr/lib/python3/dist-packages/_pytest/config/__init__.py:831: 
PytestAssertRewriteWarning: Module already imported so cannot be rewritten: 
pytest_asyncio
    self.import_plugin(import_spec)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_client.py::test_connection_auth_error - aiohttp.client_exce...
=================== 1 failed, 11 passed, 1 warning in 0.28s ====================
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_ttn-client/build; python3.12 -m pytest 
--no-cov
dh_auto_test: error: pybuild --test -i python{version} -p 3.12 returned exit 
code 13
make: *** [debian/rules:8: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2024-09-19T23:28:16Z

-------------------------------------------------------------------------------

The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here (for the next 30 days):
https://debusine.debian.net/artifact/800624/

About the archive rebuild: The build was made on debusine.debian.net,
on arm64 using sbuild.

You can find the build task here:
https://debusine.debian.net/work-request/39202/

If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.

Thanks,

Stefano

Reply via email to