ZNC doesn't reconnect if RequireAuth is set to "yes" on the SASL module and auth fails #1049

Closed
opened 2026-10-05 05:00:28 +02:00 by adam · 2 comments
Owner

Currently, if you're using the SASL module with RequireAuth set to "yes" and you disconnect from an IRC server and at the time of the reconnection services are down, then the ZNC won't try to reconnect at all.

There are a few times where services may not be available when we connect, like services maintenance, IRCd restart (where services take a few seconds to reconnect), etc.

It'd be nice if we could try to reconnect to the server even if SASL auth failed.

For those worried about constantly "hammering" the server and possibly annoy IRCops:

  • SASL auth fails happen before the server is aware of the user connecting to the IRCd, so no connection notices are sent to IRCops.
  • Services are the one that can warn IRCops/users of SASL failures. If there's no services, there are no notices.
Currently, if you're using the [SASL](https://wiki.znc.in/Sasl) module with `RequireAuth` set to "yes" and you disconnect from an IRC server and at the time of the reconnection services are down, then the ZNC won't try to reconnect at all. There are a few times where services may not be available when we connect, like services maintenance, IRCd restart (where services take a few seconds to reconnect), etc. It'd be nice if we could try to reconnect to the server even if SASL auth failed. For those worried about constantly "hammering" the server and possibly annoy IRCops: - SASL auth fails happen before the server is aware of the user connecting to the IRCd, so no connection notices are sent to IRCops. - Services are the one that can warn IRCops/users of SASL failures. If there's no services, there are no notices. <!-- github-sync-id:2547779830 -->
adam closed this issue 2026-10-05 05:00:28 +02:00
Author
Owner

Since I wondered what is going on and because this sounds like a bug, it seems like that is actually the intended behaviour. The module explicitly disables reconnects when "things do not work out": https://github.com/znc/znc/blob/9e9d75c4b80f6877eed81e967513729dd1187540/modules/sasl.cpp#L190-L196

Since I wondered what is going on and because this sounds like a bug, it seems like that is actually the intended behaviour. The module explicitly disables reconnects when "things do not work out": https://github.com/znc/znc/blob/9e9d75c4b80f6877eed81e967513729dd1187540/modules/sasl.cpp#L190-L196 <!-- github-comment-id:2374308759 -->
Author
Owner

I do understand that. The thing is that on the next reconnect attempt services may already be available.

Think about netsplits where the "main" server (which may be the one with services attached to it) is being restarted to apply the latest patches and features.

It'd be nice to retry at least a few times before giving up, pretty much like ZNC retries with channels and ends up disablign them after X rejoin attempts.

I do understand that. The thing is that on the next reconnect attempt services may already be available. Think about netsplits where the "main" server (which may be the one with services attached to it) is being restarted to apply the latest patches and features. It'd be nice to retry at least a few times before giving up, pretty much like ZNC retries with channels and ends up disablign them after X rejoin attempts. <!-- github-comment-id:2374444595 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#1049