Disable service stats for Dovecot explicitly#2292
Conversation
|
Permissions looks good in my setup: |
Very nice! Thank You for confirming this :) |
|
How do you reproduce the log? A fresh container instance for me with Originally introduced in June 2016. With original output: While now the rough equivalent splits to multi-line: In logs this is a bit more messy looking, and seems to break the syntax highlighting of notify type: I don't know much about amavis, and I doubt this log output matters other than noise?: Have you got Dovecot stats configured prior at all? The config you're adding only seems to be mentioned in the Dovecot docs for old statistics, rather than those mentioned in the main Dovecot statistics docs page. Just curious if you're fixing this because it's an actual issue triggered by your setup, or just to hide a warning for something that may be considered legacy? I probably need to have a container with something to warrant Dovecot attempting to use the |
|
@polarathene I had never seen this issue before, and it is likely timing related, but by adding these lines to the Dovecot configuration, we can make sure it is not an error that resulted from missing configuration :)
Not sure I actually can :) Regarding the messy log, yeah, this could use some cleanup. If I have time I will tend to it! UPDATE: See #2294 |
Hmm, I'd still rather understand why it's being triggered tbh rather than hiding a warning. If it is something Dovecot is doing by default when an IMAP login or similar metric occurs, it'd make more sense to either disable statistics by default explicitly or properly setup and document them. It's not going to introduce any problems though and I don't have spare time to allocate towards looking into configuring stats collection, so happy to merge 👍
Thanks! 🎉 |
|
As Georg already wrote, the "connection refused" thing is probably due a timing issue. I did a quick google search. The proposed change is a fix for a permission problem like:
I am a bit ambivalent, about fixing things, that haven't been an issue ever, because that could introduce new issues in the future. But I am no dovecot expert. So if you all are sure, that this change does not have any downside, I am fine with merging it. |
|
For the record, this is the current runtime configuration: |
As the stats feature is apparently implicitly enabled, as your output shared shows, this PR is just correcting permissions for that, so it should be all good and not impact anything else 👍 |
|
After checking the implicit default settings, I now think there isn't need for an adjustment. Also as seen here, the permissions are already correctly used by dovecot. IMO, this change does not harm, but also does not introduce any benefit. |
This PR does not change permissions of any files. It changes permissions the service process should use by running as that user and group I thought? (Dovecot service docs seem to confirm that) The Dovecot docs for services on listeners also state default user/group is root. At the bottom of the docs page there is also mention of As the log is only about |
That is what I meant 👍 Edit:
If you refer to my quote "net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denied", that was just a random error message found via google and is not related to DMS (otherwise we would see that error, which we don't) |
This comment has been minimized.
This comment has been minimized.
TL;DRProbably best to reject the PR and disable stats for v11 release (requires a Debian image upgrade for the fix in a newer Dovecot release) with The proposed fix is not clear if it will actually fix it without being able to reproduce the error. This is because We can disable the stats services, but that might warrant deferring merge until v11?: Possibly only the last part is required now, if you go through that mailing list discussion, but we won't know unless we reproduce the logged error 😅 Here's the docs for That change isn't available in our current Dovecot 2.3.4 (Nov-2018) release, but is available from the Debian 11 Bullseye release which comes with Dovecot 2.3.13 (Jan-2021). Additionally the Dovecot service docs do advise using Note that we use |
f8d2278
service stats explictly to Dovecot master.cfservice stats for Dovecot explictly
|
The test failure below is expected from the linked mailing list. We should see it pass once we merge the bullseye base image upgrade. |
Co-authored-by: Casper <[email protected]>
|
FWIW, I'm working through my backlog of tabs and it seems I missed adding a link/mention here about the Dovecot 2.3 release notes, at the end it says:
If disabling it fails to work or someone wants it enabled again, that should resolve the issue too. Which is roughly what your original solution was (yours was more correct and thorough of course). |
service stats for Dovecot explictlyservice stats for Dovecot explicitly
|
@polarathene you were right, and tests pass for now - nice :D |
|
Hi all, I'm on I followed the instructions in that page, however when I connected to http://localhost:9900/metrics all metrics were always "0". After several trials with different configurations, I found that reverting some of the changes made in this PR actually solves the issue and metrics are exported correctly. In particualr I had to explicitly enable the sockets for reading/writing the stats: and also I had to remove this last line from the I'm a bit confused because, if I understood correctly, this PR was done to remove the old-stats, but from what I see it also have effect on the new stats and the exporting of metrics (unless I'm wrong and there is another configuration to get metrics exported correctly without reverting the changes in this PR). |
|
AFAIK, the old stats disabling handled by this PR was reverted in a follow-up PR 2336 and is explained why there. The new stats were disabled to avoid the error log noted at the start of this PR I think. If you go through my responses here, I do seem to suggest that it may have been fixable via adjusting permissions correctly, followed by this reference / snippet which may have been the only required changes (instead of the Also from a comment of mine that I hid:
I don't think we ever had official support for stats with the project, so the intention was to make those opt-in instead for users that specifically needed it. If there was enough interest expressed for such we could add some toggle support, otherwise our usual advice is to defer to documenting for others how to leverage If you revert the changes from this PR and can reproduce the error output that motivated the changes, but resolve it in a more compatible way that would probably get approved and merged 👍 It also looks like the issue may have been related to an earlier release of Dovecot we had, and if that no longer needs the workaround, then it could be dropped. It didn't seem like it was clear what was causing the error to reproduce it unfortunately 😅 |
Description
A small addition that makes sure the
service stats { ...is set correctly in Dovecot'smaster.cf. I noticed this during another, unrelated event when I restarted the mail server (image tag:edge). I figured we could prevent such a message with this addition. Have a look at the correct permissions yourself withls -lh /var/run/dovecot/stats-*.Fixes a "warning" message potentially shown during startup stating:
which might just be timing-related in my case, but I figured this addition should not hurt in any way and may prevent this message in the logs of others.
Type of change
Checklist:
docs/)