znc not entering channels using key after quick reconnect #391

Closed
opened 2026-10-05 04:17:47 +02:00 by adam · 23 comments
Owner

Debian 7 & znc 1.4

In znc the channels keys appear set. If I disconnect and connect znc enters the channels properly but if it reconnects quickly (by a kill for example) it throws errors that it couldn't join them and that they are now disabled.

If I just go ahead and rejoin them, it enters them normally using the key and all.

Any suggestions on how I could force znc to use the key in any scenario or how I can provide more information about this problem?

Debian 7 & znc 1.4 In znc the channels keys appear set. If I disconnect and connect znc enters the channels properly but if it reconnects quickly (by a kill for example) it throws errors that it couldn't join them and that they are now disabled. If I just go ahead and rejoin them, it enters them normally using the key and all. Any suggestions on how I could force znc to use the key in any scenario or how I can provide more information about this problem? <!-- github-sync-id:42902607 -->
adam closed this issue 2026-10-05 04:17:47 +02:00
Author
Owner

I have this same issue sometimes and I haven't been able to reproduce this even when I tried.

Any suggestions on how I could force znc to use the key in any scenario or how I can provide more information about this problem?

At IRC I was suggested to run ZNC with znc -D and send what it sends to server to get that error.

I have this same issue sometimes and I haven't been able to reproduce this even when I tried. > Any suggestions on how I could force znc to use the key in any scenario or how I can provide more information about this problem? At IRC I was suggested to run ZNC with `znc -D` and send what it sends to server to get that error. <!-- github-comment-id:55771690 -->
Author
Owner

Nice so I guess I will have to ask some ircop to kill me, always nice...

thx for the info!

Nice so I guess I will have to ask some ircop to kill me, always nice... thx for the info! <!-- github-comment-id:55773750 -->
Author
Owner

@Nihim: You can GHOST yourself with NickServ if the network supports that function, if you don't want to bother an ircop about it.

@Nihim: You can GHOST yourself with NickServ if the network supports that function, if you don't want to bother an ircop about it. <!-- github-comment-id:55800800 -->
Author
Owner

Please provide output of znc -D (replace passwords with something)

Please provide output of `znc -D` (replace passwords with something) <!-- github-comment-id:56890089 -->
Author
Owner

Unfortunately I was really busy for the past days, but I will provide the output as soon as I can.
Sorry for disappearing right after I posted my issue but it was out of my control.

Unfortunately I was really busy for the past days, but I will provide the output as soon as I can. Sorry for disappearing right after I posted my issue but it was out of my control. <!-- github-comment-id:57070214 -->
Author
Owner

Some questions: znc -d requires that znc has been compiled with --enable-debug ?
Do I need to set where the log is saved or just run it ?

Some questions: znc -d requires that znc has been compiled with --enable-debug ? Do I need to set where the log is saved or just run it ? <!-- github-comment-id:57432510 -->
Author
Owner

--enable-debug is only for debugging symbols and isn't required forznc -D. znc -D doesn't store debug logs, they are shown in terminal.

`--enable-debug` is only for debugging symbols and isn't required for`znc -D`. `znc -D` doesn't store debug logs, they are shown in terminal. <!-- github-comment-id:57432656 -->
Author
Owner

Don't confuse znc -d with znc -D

2014-10-01 9:18 GMT+01:00 Mikaela Suomalainen notifications@github.com:

--enable-debug is only for debugging symbols and isn't required forznc -d.
znc -d doesn't store debug logs, they are shown in terminal.

—
Reply to this email directly or view it on GitHub
https://github.com/znc/znc/issues/674#issuecomment-57432656.

Don't confuse `znc -d` with `znc -D` 2014-10-01 9:18 GMT+01:00 Mikaela Suomalainen notifications@github.com: > --enable-debug is only for debugging symbols and isn't required forznc -d. > znc -d doesn't store debug logs, they are shown in terminal. > > — > Reply to this email directly or view it on GitHub > https://github.com/znc/znc/issues/674#issuecomment-57432656. <!-- github-comment-id:57436119 -->
Author
Owner

yea znc was kinda enough to point that to me, didn't check the man but it's some other flag that needs extra input :p

Anyway, ghosted myself and got an IRCop to kill me and it worked fine. After the 1st restart of znc into znc -D the keys were missing from the channels (in ZNC channel list @ the webui), though I am 100% positive I had checked. Maybe I fubared.
If it happens again now I know what to do.

Thanks to everyone who responded and sorry for wasting your time.

yea znc was kinda enough to point that to me, didn't check the man but it's some other flag that needs extra input :p Anyway, ghosted myself and got an IRCop to kill me and it worked fine. After the 1st restart of znc into znc -D the keys were missing from the channels (in ZNC channel list @ the webui), though I am 100% positive I had checked. Maybe I fubared. If it happens again now I know what to do. Thanks to everyone who responded and sorry for wasting your time. <!-- github-comment-id:57437452 -->
Author
Owner

I also have this issue. It seems to have started with 1.2 although I can't confirm that as I've updated to 1.4 in an attempt to resolve the issue.

If i ping out from znc when my client, mIRC reconnects channels keys are lost from the config.

I'll run with -D and post a log just as soon as I notice it again

I also have this issue. It seems to have started with 1.2 although I can't confirm that as I've updated to 1.4 in an attempt to resolve the issue. If i ping out from znc when my client, mIRC reconnects channels keys are lost from the config. I'll run with -D and post a log just as soon as I notice it again <!-- github-comment-id:57823565 -->
Author
Owner
[2014-10-03 21:16:05.886765] (efnet/efnet) ZNC -> IRC [JOIN #A,#B,#C,#D,#E,#F,#G,#H]
[2014-10-03 21:16:05.908708] (efnet/efnet) IRC -> ZNC [:irc.servercentral.net 475 mynick #A :Cannot join channel (+k)]
[2014-10-03 21:16:05.908800] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 475 mynick #A :Cannot join channel (+k)]
[2014-10-03 21:16:05.909929] (efnet/efnet) IRC -> ZNC [:irc.servercentral.net 475 mynick #B :Cannot join channel (+k)]
[2014-10-03 21:16:05.910027] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 475 mynick #B :Cannot join channel (+k)] 
[2014-10-03 21:16:05.910120] (efnet/efnet) IRC -> ZNC [:irc.servercentral.net 475 mynick #C :Cannot join channel (+k)]     
[2014-10-03 21:16:05.910169] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 475 mynick #C :Cannot join channel (+k)]    
[2014-10-03 21:16:05.910233] (efnet/efnet) IRC -> ZNC [:mynick!~ident@hostname.com JOIN :#D]                
[2014-10-03 21:16:05.910299] (efnet/efnet) ZNC -> IRC [MODE #D]
[2014-10-03 21:16:05.910383] (efnet/efnet) ZNC -> CLI [:mynick!~ident@hostname.com JOIN :#D]     
....
[2014-10-03 16:19:15.349158] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 376 mynick :End of /MOTD command.]
[2014-10-03 16:19:15.349220] (efnet/efnet) ZNC -> CLI [:irc.znc.in 306 mynick :You have been marked as being away]
[2014-10-03 16:19:15.349310] (efnet/efnet) ZNC -> IRC [AWAY]
[2014-10-03 16:19:15.378432] (efnet/efnet) IRC -> ZNC [:irc.servercentral.net 305 mynick :You are no longer marked as being away]
[2014-10-03 16:19:15.378521] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 305 mynick :You are no longer marked as being away]
[2014-10-03 16:19:16.280068] (efnet/efnet) CLI -> ZNC [MODE mynick +i]
[2014-10-03 16:19:16.280168] (efnet/efnet) ZNC -> IRC [MODE mynick +i]
[2014-10-03 16:19:16.280235] (efnet/efnet) CLI -> ZNC [MONITOR C]
[2014-10-03 16:19:16.280283] (efnet/efnet) ZNC -> IRC [MONITOR C]   
[2014-10-03 16:19:16.280327] (efnet/efnet) CLI -> ZNC []
[2014-10-03 16:19:16.280369] (efnet/efnet) ZNC -> IRC [] (queued)
[2014-10-03 16:19:16.280411] (efnet/efnet) CLI -> ZNC [MONITOR S]
[2014-10-03 16:19:16.280453] (efnet/efnet) ZNC -> IRC [MONITOR S] (queued)
[2014-10-03 16:19:16.280527] (efnet/efnet) CLI -> ZNC [MONITOR L]           
[2014-10-03 16:19:16.280572] (efnet/efnet) ZNC -> IRC [MONITOR L] (queued)              
[2014-10-03 16:19:16.280611] (efnet/efnet) CLI -> ZNC [JOIN #A key]
[2014-10-03 16:19:16.280678] (efnet/efnet) ZNC -> IRC [JOIN #A key] (queued)
[2014-10-03 16:19:16.280722] (efnet/efnet) CLI -> ZNC [JOIN #B key]
[2014-10-03 16:19:16.280778] (efnet/efnet) ZNC -> IRC [JOIN #B key] (queued)
[2014-10-03 16:19:16.280872] (efnet/efnet) CLI -> ZNC [JOIN #C,#D]
[2014-10-03 16:19:16.280935] (efnet/efnet) ZNC -> IRC [JOIN #C ] (queued)    
[2014-10-03 16:19:16.280979] (efnet/efnet) ZNC -> IRC [JOIN #D ] (queued)
[2014-10-03 16:19:16.281058] (efnet/efnet) CLI -> ZNC [JOIN #E key] 
[2014-10-03 16:19:16.281114] (efnet/efnet) ZNC -> IRC [JOIN #E key] (queued) 
[2014-10-03 16:19:16.281149] (efnet/efnet) CLI -> ZNC [JOIN #F key]
[2014-10-03 16:19:16.281204] (efnet/efnet) ZNC -> IRC [JOIN #F key] (queued)
[2014-10-03 16:19:16.281240] (efnet/efnet) CLI -> ZNC [JOIN #G]
[2014-10-03 16:19:16.281290] (efnet/efnet) ZNC -> IRC [JOIN #G ] (queued)              
[2014-10-03 16:19:16.281337] (efnet/efnet) ZNC -> IRC []
[2014-10-03 16:19:16.309354] (efnet/efnet) IRC -> ZNC [:mynick MODE mynick :+i]       
[2014-10-03 16:19:16.309465] (efnet/efnet) ZNC -> CLI [:mynick MODE mynick :+i]
``` [2014-10-03 21:16:05.886765] (efnet/efnet) ZNC -> IRC [JOIN #A,#B,#C,#D,#E,#F,#G,#H] [2014-10-03 21:16:05.908708] (efnet/efnet) IRC -> ZNC [:irc.servercentral.net 475 mynick #A :Cannot join channel (+k)] [2014-10-03 21:16:05.908800] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 475 mynick #A :Cannot join channel (+k)] [2014-10-03 21:16:05.909929] (efnet/efnet) IRC -> ZNC [:irc.servercentral.net 475 mynick #B :Cannot join channel (+k)] [2014-10-03 21:16:05.910027] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 475 mynick #B :Cannot join channel (+k)] [2014-10-03 21:16:05.910120] (efnet/efnet) IRC -> ZNC [:irc.servercentral.net 475 mynick #C :Cannot join channel (+k)] [2014-10-03 21:16:05.910169] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 475 mynick #C :Cannot join channel (+k)] [2014-10-03 21:16:05.910233] (efnet/efnet) IRC -> ZNC [:mynick!~ident@hostname.com JOIN :#D] [2014-10-03 21:16:05.910299] (efnet/efnet) ZNC -> IRC [MODE #D] [2014-10-03 21:16:05.910383] (efnet/efnet) ZNC -> CLI [:mynick!~ident@hostname.com JOIN :#D] .... [2014-10-03 16:19:15.349158] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 376 mynick :End of /MOTD command.] [2014-10-03 16:19:15.349220] (efnet/efnet) ZNC -> CLI [:irc.znc.in 306 mynick :You have been marked as being away] [2014-10-03 16:19:15.349310] (efnet/efnet) ZNC -> IRC [AWAY] [2014-10-03 16:19:15.378432] (efnet/efnet) IRC -> ZNC [:irc.servercentral.net 305 mynick :You are no longer marked as being away] [2014-10-03 16:19:15.378521] (efnet/efnet) ZNC -> CLI [:irc.servercentral.net 305 mynick :You are no longer marked as being away] [2014-10-03 16:19:16.280068] (efnet/efnet) CLI -> ZNC [MODE mynick +i] [2014-10-03 16:19:16.280168] (efnet/efnet) ZNC -> IRC [MODE mynick +i] [2014-10-03 16:19:16.280235] (efnet/efnet) CLI -> ZNC [MONITOR C] [2014-10-03 16:19:16.280283] (efnet/efnet) ZNC -> IRC [MONITOR C] [2014-10-03 16:19:16.280327] (efnet/efnet) CLI -> ZNC [] [2014-10-03 16:19:16.280369] (efnet/efnet) ZNC -> IRC [] (queued) [2014-10-03 16:19:16.280411] (efnet/efnet) CLI -> ZNC [MONITOR S] [2014-10-03 16:19:16.280453] (efnet/efnet) ZNC -> IRC [MONITOR S] (queued) [2014-10-03 16:19:16.280527] (efnet/efnet) CLI -> ZNC [MONITOR L] [2014-10-03 16:19:16.280572] (efnet/efnet) ZNC -> IRC [MONITOR L] (queued) [2014-10-03 16:19:16.280611] (efnet/efnet) CLI -> ZNC [JOIN #A key] [2014-10-03 16:19:16.280678] (efnet/efnet) ZNC -> IRC [JOIN #A key] (queued) [2014-10-03 16:19:16.280722] (efnet/efnet) CLI -> ZNC [JOIN #B key] [2014-10-03 16:19:16.280778] (efnet/efnet) ZNC -> IRC [JOIN #B key] (queued) [2014-10-03 16:19:16.280872] (efnet/efnet) CLI -> ZNC [JOIN #C,#D] [2014-10-03 16:19:16.280935] (efnet/efnet) ZNC -> IRC [JOIN #C ] (queued) [2014-10-03 16:19:16.280979] (efnet/efnet) ZNC -> IRC [JOIN #D ] (queued) [2014-10-03 16:19:16.281058] (efnet/efnet) CLI -> ZNC [JOIN #E key] [2014-10-03 16:19:16.281114] (efnet/efnet) ZNC -> IRC [JOIN #E key] (queued) [2014-10-03 16:19:16.281149] (efnet/efnet) CLI -> ZNC [JOIN #F key] [2014-10-03 16:19:16.281204] (efnet/efnet) ZNC -> IRC [JOIN #F key] (queued) [2014-10-03 16:19:16.281240] (efnet/efnet) CLI -> ZNC [JOIN #G] [2014-10-03 16:19:16.281290] (efnet/efnet) ZNC -> IRC [JOIN #G ] (queued) [2014-10-03 16:19:16.281337] (efnet/efnet) ZNC -> IRC [] [2014-10-03 16:19:16.309354] (efnet/efnet) IRC -> ZNC [:mynick MODE mynick :+i] [2014-10-03 16:19:16.309465] (efnet/efnet) ZNC -> CLI [:mynick MODE mynick :+i] ``` <!-- github-comment-id:57899868 -->
Author
Owner

Could you elaborate a bit? What are the exact steps? Are you using the chansaver module?

Could you elaborate a bit? What are the exact steps? Are you using the chansaver module? <!-- github-comment-id:57901687 -->
Author
Owner

the chansaver module is loaded

the channel keys are not being stored in the config file

if i manually edit the config from shell and add the channel keys they are removed once your reconnect to znc

the chansaver module is loaded the channel keys are not being stored in the config file if i manually edit the config from shell and add the channel keys they are removed once your reconnect to znc <!-- github-comment-id:57902985 -->
Author
Owner

if i manually edit the config from shell and add the channel keys they are removed once your reconnect to znc

We need the exact steps in order to understand what's going on. Running, closing, restarting, connecting, disconnecting, editing - anything you do with your IRC client, ZNC, and its config file. Based on what you said, I can only guess that you edited the config file while ZNC was running.

The problem is probably already fixed in the development version: https://github.com/znc/znc/commits/master/modules/chansaver.cpp. @DarthGandalf's commit "Fix chansaver's channel keys..." and the follow-ups are not included in version 1.4. What makes me puzzled is that @Mkaysi mentions still having similar issues.

> if i manually edit the config from shell and add the channel keys they are removed once your reconnect to znc We need the exact steps in order to understand what's going on. Running, closing, restarting, connecting, disconnecting, editing - anything you do with your IRC client, ZNC, and its config file. Based on what you said, I can only guess that you edited the config file while ZNC was running. The problem is probably already fixed in the development version: https://github.com/znc/znc/commits/master/modules/chansaver.cpp. @DarthGandalf's commit "Fix chansaver's channel keys..." and the follow-ups are not included in version 1.4. What makes me puzzled is that @Mkaysi mentions still having similar issues. <!-- github-comment-id:57905639 -->
Author
Owner

The problem is that I only notice this when znc disconnects from the ircd. Which is random.

If I manually disconnect my client from znc and reconnect there is no issue as the channels are still open.

The conf is never edited while znc is running.

Is there a more useful log level? The problem is churning though all the spam in the log to try and find any relevant events. I'm currently running -D & with the log piped to a file and tail running on the file

The problem is that I only notice this when znc disconnects from the ircd. Which is random. If I manually disconnect my client from znc and reconnect there is no issue as the channels are still open. The conf is never edited while znc is running. Is there a more useful log level? The problem is churning though all the spam in the log to try and find any relevant events. I'm currently running -D & with the log piped to a file and tail running on the file <!-- github-comment-id:57906786 -->
Author
Owner

Why is this closed? I have this on every single reconnect. Reading the chansaver code it seems that it could only possibly save the key if it sees "+k key" as a mode. So when the client joins and sees "+sntk key" it will not be recognized. A simple test of running /mode -k and /mode +k in a channel showed that it did retain the key on the next reconnect. It did eventually forget it though.

Why is this closed? I have this on every single reconnect. Reading the chansaver code it seems that it could only possibly save the key if it sees "+k key" as a mode. So when the client joins and sees "+sntk key" it will not be recognized. A simple test of running /mode -k and /mode +k in a channel showed that it did retain the key on the next reconnect. It did eventually forget it though. <!-- github-comment-id:58610107 -->
Author
Owner

I closed it since I couldn't recreate my problem when I tried with znc -D. Can't say I am uptodate with the rules of github on issues.
So there re-opened.

Anyway for me still after many reconnects to znc and atleast one reconnect to the IRCd by znc (I didn't cause it by ghosting or kill) still works fine and the keys are being stored in the config as shown by the web ui.

I closed it since I couldn't recreate my problem when I tried with znc -D. Can't say I am uptodate with the rules of github on issues. So there re-opened. Anyway for me still after many reconnects to znc and atleast one reconnect to the IRCd by znc (I didn't cause it by ghosting or kill) still works fine and the keys are being stored in the config as shown by the web ui. <!-- github-comment-id:58660128 -->
Author
Owner

Why is this closed? I have this on every single reconnect.

Are you on 1.4? If so, you don't have DarthGandalf's fixes: https://github.com/znc/znc/commits/master/modules/chansaver.cpp (618d9c5 and 9cf61ac)

Reading the chansaver code it seems that it could only possibly save the key if it sees "+k key" as a mode. So when the client joins and sees "+sntk key" it will not be recognized.

The mode argument of OnMode2() is a single character. It gets called once for each mode; s, n, t, k.
https://github.com/znc/znc/blob/master/src/Chan.cpp#L357

> Why is this closed? I have this on every single reconnect. Are you on 1.4? If so, you don't have DarthGandalf's fixes: https://github.com/znc/znc/commits/master/modules/chansaver.cpp (618d9c5 and 9cf61ac) > Reading the chansaver code it seems that it could only possibly save the key if it sees "+k key" as a mode. So when the client joins and sees "+sntk key" it will not be recognized. The mode argument of OnMode2() is a single character. It gets called once for each mode; s, n, t, k. https://github.com/znc/znc/blob/master/src/Chan.cpp#L357 <!-- github-comment-id:58662671 -->
Author
Owner

@jpnurmi I am on ZNC 1.5 and sometimes encounter this.

@jpnurmi I am on ZNC 1.5 and sometimes encounter this. <!-- github-comment-id:58684954 -->
Author
Owner

Are you on 1.4? If so, you don't have DarthGandalf's fixes: https://github.com/znc/znc/commits/master/modules/chansaver.cpp (618d9c5 and 9cf61ac)

Thanks, I'll give those a try.

> Are you on 1.4? If so, you don't have DarthGandalf's fixes: https://github.com/znc/znc/commits/master/modules/chansaver.cpp (618d9c5 and 9cf61ac) Thanks, I'll give those a try. <!-- github-comment-id:58691128 -->
Author
Owner

Does this still happen to you on 1.6.0 or could this be closed?

Does this still happen to you on 1.6.0 or could this be closed? <!-- github-comment-id:138900147 -->
Author
Owner

As far as I can recall no it hasn't happened since 1.6.0.

As far as I can recall no it hasn't happened since 1.6.0. <!-- github-comment-id:139741798 -->
Author
Owner

I'm still experiencing this.


Interestingly it only happened to one channel the last time I restarted znc, hm.

I'm still experiencing this. --- Interestingly it only happened to one channel the last time I restarted znc, hm. <!-- github-comment-id:359132966 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#391