-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
OSError: AF_UNIX path too long
under MacOS
#3572
Comments
This comment has been minimized.
This comment has been minimized.
I think we've already seen the issue with fs paths for unix sockets being too long in the past... �[1m�[31m_________________________ test_unix_connector[pyloop] __________________________�[0m
unix_server = <function unix_server.<locals>.go at 0x10bfd58c8>
unix_sockname = '/private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pytest-of-travis/pytest-0/test_unix_connector_pyloop_0/socket.sock'
�[1m @pytest.mark.skipif(not hasattr(socket, 'AF_UNIX'),�[0m
�[1m reason='requires UNIX sockets')�[0m
�[1m async def test_unix_connector(unix_server, unix_sockname) -> None:�[0m
�[1m async def handler(request):�[0m
�[1m return web.Response()�[0m
�[1m �[0m
�[1m app = web.Application()�[0m
�[1m app.router.add_get('/', handler)�[0m
�[1m> await unix_server(app)�[0m
�[1m�[31mtests/test_connector.py�[0m:2106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
�[1m�[31mtests/test_connector.py�[0m:60: in go
�[1m await site.start()�[0m
�[1m�[31maiohttp/web_runner.py�[0m:128: in start
�[1m ssl=self._ssl_context, backlog=self._backlog)�[0m
�[1m�[31m../../../.pyenv/versions/3.5.3/lib/python3.5/asyncio/coroutines.py�[0m:210: in coro
�[1m res = func(*args, **kw)�[0m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>
protocol_factory = <aiohttp.web_server.Server object at 0x10c0b8048>
path = '/private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pytest-of-travis/pytest-0/test_unix_connector_pyloop_0/socket.sock'
�[1m @coroutine�[0m
�[1m def create_unix_server(self, protocol_factory, path=None, *,�[0m
�[1m sock=None, backlog=100, ssl=None):�[0m
�[1m if isinstance(ssl, bool):�[0m
�[1m raise TypeError('ssl argument must be an SSLContext or None')�[0m
�[1m �[0m
�[1m if path is not None:�[0m
�[1m if sock is not None:�[0m
�[1m raise ValueError(�[0m
�[1m 'path and sock can not be specified at the same time')�[0m
�[1m �[0m
�[1m path = _fspath(path)�[0m
�[1m sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)�[0m
�[1m �[0m
�[1m # Check for abstract socket. `str` and `bytes` paths are supported.�[0m
�[1m if path[0] not in (0, '\x00'):�[0m
�[1m try:�[0m
�[1m if stat.S_ISSOCK(os.stat(path).st_mode):�[0m
�[1m os.remove(path)�[0m
�[1m except FileNotFoundError:�[0m
�[1m pass�[0m
�[1m except OSError as err:�[0m
�[1m # Directory may have permissions only to create socket.�[0m
�[1m logger.error('Unable to check or remove stale UNIX socket %r: %r', path, err)�[0m
�[1m �[0m
�[1m try:�[0m
�[1m> sock.bind(path)�[0m
�[1m�[31mE OSError: AF_UNIX path too long�[0m
�[1m�[31m../../../.pyenv/versions/3.5.3/lib/python3.5/asyncio/unix_events.py�[0m:281: OSError
�[1m�[31m____________________________ test_addresses[pyloop] ____________________________�[0m
make_runner = <function make_runner.<locals>.go at 0x10c39f6a8>
tmpdir = local('/private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pytest-of-travis/pytest-0/test_addresses_pyloop_0')
�[1m @pytest.mark.skipif(platform.system() == "Windows",�[0m
�[1m reason="Unix socket support is required")�[0m
�[1m async def test_addresses(make_runner, tmpdir) -> None:�[0m
�[1m _sock = get_unused_port_socket('127.0.0.1')�[0m
�[1m runner = make_runner()�[0m
�[1m await runner.setup()�[0m
�[1m tcp = web.SockSite(runner, _sock)�[0m
�[1m await tcp.start()�[0m
�[1m path = str(tmpdir / 'tmp.sock')�[0m
�[1m unix = web.UnixSite(runner, path)�[0m
�[1m> await unix.start()�[0m
�[1m�[31mtests/test_web_runner.py�[0m:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
�[1m�[31maiohttp/web_runner.py�[0m:128: in start
�[1m ssl=self._ssl_context, backlog=self._backlog)�[0m
�[1m�[31m../../../.pyenv/versions/3.5.3/lib/python3.5/asyncio/coroutines.py�[0m:210: in coro
�[1m res = func(*args, **kw)�[0m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>
protocol_factory = <aiohttp.web_server.Server object at 0x10c2d0240>
path = '/private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pytest-of-travis/pytest-0/test_addresses_pyloop_0/tmp.sock'
�[1m @coroutine�[0m
�[1m def create_unix_server(self, protocol_factory, path=None, *,�[0m
�[1m sock=None, backlog=100, ssl=None):�[0m
�[1m if isinstance(ssl, bool):�[0m
�[1m raise TypeError('ssl argument must be an SSLContext or None')�[0m
�[1m �[0m
�[1m if path is not None:�[0m
�[1m if sock is not None:�[0m
�[1m raise ValueError(�[0m
�[1m 'path and sock can not be specified at the same time')�[0m
�[1m �[0m
�[1m path = _fspath(path)�[0m
�[1m sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)�[0m
�[1m �[0m
�[1m # Check for abstract socket. `str` and `bytes` paths are supported.�[0m
�[1m if path[0] not in (0, '\x00'):�[0m
�[1m try:�[0m
�[1m if stat.S_ISSOCK(os.stat(path).st_mode):�[0m
�[1m os.remove(path)�[0m
�[1m except FileNotFoundError:�[0m
�[1m pass�[0m
�[1m except OSError as err:�[0m
�[1m # Directory may have permissions only to create socket.�[0m
�[1m logger.error('Unable to check or remove stale UNIX socket %r: %r', path, err)�[0m
�[1m �[0m
�[1m try:�[0m
�[1m> sock.bind(path)�[0m
�[1m�[31mE OSError: AF_UNIX path too long�[0m
�[1m�[31m../../../.pyenv/versions/3.5.3/lib/python3.5/asyncio/unix_events.py�[0m:281: OSError |
To fix this we'll need to use |
OSError: AF_UNIX path too long
under MacOS
@webknjaz if you want to provide some information adding a link without any comment is not very helpful |
Sorry, missed your prev comment. |
As a part of #3827 I've just skipped these two failed tests on MacOSX. |
@asvetlov it's not just macOS, all NIXes have different limits. You can hit it under Linux too. I almost have a PR for this. So stay tuned :) |
I don't care too much. |
Fixes #3572 Different OS kernels have different fs path length limitations for it. For Linux, it's 108, for HP-UX it's 92 (or higher) depending on its version. For most of the BSDs (Open, Free, macOS) it's mostly 104 but sometimes it can be down to 100. Ref: https://unix.stackexchange.com/a/367012/27133 This change implements a flexible socket path generator fixture which guarantees that it's fit into the memory space allocated by the kernel of the current OS runtime.
Disable a non-critical test known to fail on Darwin (see aio-libs/aiohttp#3572)
Fixes aio-libs#3572 Different OS kernels have different fs path length limitations for it. For Linux, it's 108, for HP-UX it's 92 (or higher) depending on its version. For most of the BSDs (Open, Free, macOS) it's mostly 104 but sometimes it can be down to 100. Ref: https://unix.stackexchange.com/a/367012/27133 This change implements a flexible socket path generator fixture which guarantees that it's fit into the memory space allocated by the kernel of the current OS runtime. (cherry picked from commit 8e9e39b)
Fixes #3572 Different OS kernels have different fs path length limitations for it. For Linux, it's 108, for HP-UX it's 92 (or higher) depending on its version. For most of the BSDs (Open, Free, macOS) it's mostly 104 but sometimes it can be down to 100. Ref: https://unix.stackexchange.com/a/367012/27133 This change implements a flexible socket path generator fixture which guarantees that it's fit into the memory space allocated by the kernel of the current OS runtime. (cherry picked from commit 8e9e39b)
Fixes #3572 Different OS kernels have different fs path length limitations for it. For Linux, it's 108, for HP-UX it's 92 (or higher) depending on its version. For most of the BSDs (Open, Free, macOS) it's mostly 104 but sometimes it can be down to 100. Ref: https://unix.stackexchange.com/a/367012/27133 This change implements a flexible socket path generator fixture which guarantees that it's fit into the memory space allocated by the kernel of the current OS runtime. (cherry picked from commit 8e9e39b)
Surprisingly Travis fails on MacOS: https://travis-ci.com/aio-libs/aiohttp/builds/98188999?utm_medium=notification&utm_source=email
Looks like it is the result of my #3548 PR.
I have no Mac available, the investigation can be slow.
If somebody can run tests locally on Mac and debug what is wrong -- it would be awesome and save my personal time a lot.
The text was updated successfully, but these errors were encountered: