Zimbra stats service is stopped

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
gnogic
Posts: 1
Joined: Wed Jan 30, 2019 10:01 am

Zimbra stats service is stopped

Post by gnogic »

Hi,
I'm having problem with stats service on my mail server based on Zimbra Release 8.8.8_GA_2009.RHEL7_64_20180322150747 RHEL7_64 FOSS ( server is standalone ).
I have tried several times to remove all *.pid files in /opt/zimbra/zmstat/pid but that doesn't resolve my problem. Service will run for a short period of time and then again status is changed to stopped.
Output of zmstatctl status is:

Running: zmstat-cpu
Running: zmstat-vm
Running: zmstat-fd
Running: zmstat-io
Running: zmstat-proc
Running: zmstat-mtaqueue
Running: zmstat-ldap
Running: zmstat-io-x
Running: zmstat-allprocs
Running: zmstat-nginx
Running: zmstat-df
process 8622 in /opt/zimbra/zmstat/pid/zmstat-mysql.pid not running

Just like mentioned before deleting "not running" pid is not solution for me, while during the recreation of new mysql pid, service stats will be stopped.

Output of zmcontrol status is showing:

amavis Running
antispam Running
antivirus Running
dnscache Running
ldap Running
logger Running
mailbox Running
memcached Running
mta Running
opendkim Running
proxy Running
service webapp Running
snmp Running
spell Running
stats Stopped
zimbra webapp Running
zimbraAdmin webapp Running
zimlet webapp Running
zmconfigd Running

Part of the zimbra.log file - this few lines are repeating continously:

Jan 30 11:03:52 zimbra zmconfigd[14336]: Rewrite failed: Permission denied (Permission denied)
Jan 30 11:03:52 zimbra zmconfigd[14336]: File "/opt/zimbra/common/lib/jylibs/state.py", line 799, in rewriteConfig (fh, tmpfile) = tempfile.mkstemp(dir="/tmp")
Jan 30 11:03:52 zimbra zmconfigd[14336]: File "/opt/zimbra/lib/jars/jython-standalone-2.5.2.jar/Lib/tempfile.py", line 302, in mkstemp return _mkstemp_inner(dir, prefix, suffix, flags)
Jan 30 11:03:52 zimbra zmconfigd[14336]: File "/opt/zimbra/lib/jars/jython-standalone-2.5.2.jar/Lib/tempfile.py", line 236, in _mkstemp_inner fd = _os.open(file, flags, 0600)
Jan 30 11:03:52 zimbra zmconfigd[14336]: Rewrite failed: Permission denied (Permission denied)
Jan 30 11:03:52 zimbra zmconfigd[14336]: File "/opt/zimbra/common/lib/jylibs/state.py", line 799, in rewriteConfig (fh, tmpfile) = tempfile.mkstemp(dir="/tmp")
Jan 30 11:03:52 zimbra zmconfigd[14336]: File "/opt/zimbra/lib/jars/jython-standalone-2.5.2.jar/Lib/tempfile.py", line 302, in mkstemp return _mkstemp_inner(dir, prefix, suffix, flags)
Jan 30 11:03:52 zimbra zmconfigd[14336]: File "/opt/zimbra/lib/jars/jython-standalone-2.5.2.jar/Lib/tempfile.py", line 236, in _mkstemp_inner fd = _os.open(file, flags, 0600)
Jan 30 11:03:52 zimbra zmconfigd[14336]: Rewrite failed: Permission denied (Permission denied)

When I check zmconfig with "zmconfigdctl status" > zmconfigd is running.
Can someone point me to the right direction?
Thx!
User avatar
DualBoot
Elite member
Elite member
Posts: 1326
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: Zimbra stats service is stopped

Post by DualBoot »

Hello,

you can try to fix some permission with internal Zimbra command. First stop your Zimbra service and as user root :
/opt/zimbra/libexec/zmfixperms
And restart your Zimbra.

Regards,
dpa.clt
Posts: 1
Joined: Wed Jan 17, 2018 9:50 am

Re: Zimbra stats service is stopped

Post by dpa.clt »

Hello All

I am also facing same issue .Even after following the method mentioned in this link didnt help and still stats service is down.

Running: zmstat-nginx
Running: zmstat-io-x
process 12249 in /opt/zimbra/zmstat/pid/zmstat-mysql.pid not running
Running: zmstat-io
Running: zmstat-convertd
Running: zmstat-proc
Running: zmstat-fd
Running: zmstat-vm
Running: zmstat-df
Running: zmstat-cpu
Running: zmstat-ldap
Running: zmstat-allprocs
Running: zmstat-mtaqueue

Can anyone suggest what next to fix the issue
McGregor
Posts: 17
Joined: Wed Oct 25, 2017 5:09 pm

Re: Zimbra stats service is stopped

Post by McGregor »

Release 8.8.12.GA.3794.UBUNTU16.64 UBUNTU16_64 FOSS edition, Patch 8.8.12_P3

I am also facing a very similar issue. I get several messages a day about the Stats service being stopped and then restarted:
Jul 8 07:58:37 mail zmconfigd[20319]: Service status change: mail.example.com stats changed from running to stopped.

Jul 8 07:59:44 mail zmconfigd[20319]: Service status change: mail.example.com stats changed from stopped to running.
I tried the permissions fix above but without success.

Any idea will be appreciated.
ddixan
Posts: 3
Joined: Thu Jul 11, 2019 1:21 pm

Re: Zimbra stats service is stopped

Post by ddixan »

Same issue under Zimbra 8.8.11.GA.3737.UBUNTU16.64 UBUNTU16_64 FOSS edition, Patch 8.8.11_P4.
I tried everything unsuccessfully.
1- /opt/zimbra/libexec/zmfixperms -extended
2- zmcontrol restart status
3- restarting the VM
A curious note: sometime the service is showed as running but the GUI showed not running. Even using a private windows in the web browser.
Also my stats service failed after the end of the proxmox backup or after deploying a snapshot task. But I detected that even without the backup/snapshot task after a 2 days the stats service also fails randomly.

Regards
ddixan
Posts: 3
Joined: Thu Jul 11, 2019 1:21 pm

Re: Zimbra stats service is stopped

Post by ddixan »

I have the same issue under Release 8.8.11.GA.3737.UBUNTU16.64 UBUNTU16_64 FOSS edition, Patch 8.8.11_P4.
Randomly the stats service goes down. It painfully restarts the stats service because involves all most services. I had to program a script in order to restart it early in the morning with a minimal outage.
whasley
Posts: 1
Joined: Fri Apr 09, 2021 12:37 pm

Re: Zimbra stats service is stopped

Post by whasley »

So you noticed that your zimbra stats are not running:

[zimbra@mta1]$ zmcontrol status
Host mail.xxx.com
antispam Running
antivirus Running
convertd Running
imapproxy Running
ldap Running
logger Running
mailbox Running
memcached Running
mta Running
snmp Running
spell Running
stats Stopped


Verify if the pirmission is corret for the archieves in this Path:

ls -la /opt/zimbra/zmstat/

If some of the files are owned by a different user than zimbra, change de owner.

chown zimbra:zimbra /opt/zimbra/zmstat/*

Now, change to user zimbra:

su zimbra

And start stats service:

zmstatctl start
zmstatctl status

Now stats is running:

zmcontrol status

[zimbra@mta1]$ zmcontrol status
Host mail.xxx.com
antispam Running
antivirus Running
convertd Running
imapproxy Running
ldap Running
logger Running
mailbox Running
memcached Running
mta Running
snmp Running
spell Running
stats Running
Post Reply