Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

OSError: [Errno 97] Address family not supported by protocol #13

Closed
AlphaJack opened this issue Nov 28, 2020 · 4 comments
Closed

OSError: [Errno 97] Address family not supported by protocol #13

AlphaJack opened this issue Nov 28, 2020 · 4 comments

Comments

@AlphaJack
Copy link

I was successfully using Dovecot + Radicale + radicale-dovecot-auth-git on my old server, but after restoring the setup using the same exact configurations, I get "Error: 500 Internal Server Error" from the web GUI, and the following messages from syslog when a client tries to connect:

# [...]

 [2020-11-28 16:24:37 +0100] [335/Thread-8] [DEBUG] Script name overwritten by client: '/radicale'
 [2020-11-28 16:24:37 +0100] [335/Thread-8] [DEBUG] Sanitized script name: '/radicale'
 [2020-11-28 16:24:37 +0100] [335/Thread-8] [DEBUG] Sanitized path: '/'
 [2020-11-28 16:24:37 +0100] [335/Thread-8] [ERROR] An exception occurred during PROPFIND request on '/': [Errno 97] Address family not supported by protocol
 Traceback (most recent call last):
   File "/usr/lib/python3.8/site-packages/radicale/app/__init__.py", line 105, in __call__
     status, headers, answers = self._handle_request(environ)
   File "/usr/lib/python3.8/site-packages/radicale/app/__init__.py", line 227, in _handle_request
     user = self._auth.login(login, password) or "" if login else ""
   File "/usr/lib/python3.8/site-packages/radicale_dovecot_auth/__init__.py", line 64, in login
     return login if self.is_authenticated(login, password) else ""
   File "/usr/lib/python3.8/site-packages/radicale_dovecot_auth/__init__.py", line 57, in is_authenticated
     return self.is_authenticated2(None, user, password)
   File "/usr/lib/python3.8/site-packages/radicale_dovecot_auth/__init__.py", line 60, in is_authenticated2
     conn = self.get_connection()
   File "/usr/lib/python3.8/site-packages/radicale_dovecot_auth/__init__.py", line 54, in get_connection
     return DovecotAuth(SERVICE, **kwargs)
   File "/usr/lib/python3.8/site-packages/radicale_dovecot_auth/dovecot_auth.py", line 68, in __init__
     self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
   File "/usr/lib/python3.8/socket.py", line 231, in __init__
     _socket.socket.__init__(self, family, type, proto, fileno)
 OSError: [Errno 97] Address family not supported by protocol

Radicale conf:

# [...]

[auth]
type = radicale_dovecot_auth
auth_socket = /var/lib/radicale/dovecot-auth-client

# [...]

Dovecot conf:

# [...]

service auth {
 unix_listener /var/spool/postfix/private/dovecot-auth-client {
  mode = 0660
  user = postfix
  group = postfix
 }
 unix_listener /var/lib/radicale/dovecot-auth-client {
  mode = 0660
  user = radicale
  group = radicale
 }
 user = dovecot
}

# [...]

I can login to Radicale using different authentication backends, and Postfix is able to talk to its socket without problems.
Am I missing a package or additional configuration?

@Arvedui
Copy link
Owner

Arvedui commented Nov 30, 2020

The issue seems to be that the plugin cannot open a unix stream socket.
This is a problem with your operating system, not with the configuration or the plugin itself.
I don't think I can help you with this.

@Arvedui Arvedui closed this as completed Nov 30, 2020
@AlphaJack
Copy link
Author

AlphaJack commented Dec 1, 2020

So, the problem is that it can't talk with Dovecot socket?
Because I can successfully create and connect to sockets like this (TCP) and this (UDP).
I was able to connect PyMOTW TCP client to Dovecot socket as user "radicale" by simply editing the socket path.

@Arvedui
Copy link
Owner

Arvedui commented Dec 1, 2020

So, the problem is that it can't talk with Dovecot socket?

Kind of, except that it is not the connect call that fails, we don not even get to that point, it is the socket call that fails. It is likely that something disabled unix sockets for radicale as part of security hardening.
Maybe #12 can help you.

@AlphaJack
Copy link
Author

Thank you, that was exactly the culprit.

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

No branches or pull requests

2 participants