Zimbra 8.8.8 cbpolicyd db empty

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
User avatar
fferraro87
Advanced member
Advanced member
Posts: 99
Joined: Thu Apr 28, 2016 8:58 am

Zimbra 8.8.8 cbpolicyd db empty

Post by fferraro87 »

Hi,

i've installed on my 8.8.8_GA_2009.NETWORK on centos 7, cbpolicyd with this command :

Code: Select all

zmprov ms `zmhostname` +zimbraServiceEnabled cbpolicyd
then i enter on that db

Code: Select all

/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb
but it's empty.

there isn't any table inside it.

Why? How can i fix this problem?

Thanks
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Zimbra 8.8.8 cbpolicyd db empty

Post by phoenix »

fferraro87 wrote:then i enter on that db

Code: Select all

/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb
but it's empty.

there isn't any table inside it.
I don't really understand what you mean by the text I've highlighted, what you've posted is just the directory location. Have a look at the instructions in the wiki for the correct command to show the tables and db etc.

https://wiki.zimbra.com/wiki/Cluebringer_Policy_Daemon

This worked for me on a test server just a moment ago.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
User avatar
fferraro87
Advanced member
Advanced member
Posts: 99
Joined: Thu Apr 28, 2016 8:58 am

Re: Zimbra 8.8.8 cbpolicyd db empty

Post by fferraro87 »

phoenix wrote:
fferraro87 wrote:then i enter on that db

Code: Select all

/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb
but it's empty.

there isn't any table inside it.
I don't really understand what you mean by the text I've highlighted, what you've posted is just the directory location. Have a look at the instructions in the wiki for the correct command to show the tables and db etc.

https://wiki.zimbra.com/wiki/Cluebringer_Policy_Daemon

This worked for me on a test server just a moment ago.
sorry i do that

Code: Select all

sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb
and then

Code: Select all

.tables
in order to see tables inside that db but i've no table inside it
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Zimbra 8.8.8 cbpolicyd db empty

Post by phoenix »

I presume you started the cbpolicyd service on an mta server (or a single server?) if that's your configuration. How about trying this:

Code: Select all

su - zimbra

ls -l /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb  <- what does that show?
zmprov ms $(zmhostname) -zimbraServiceEnabled cbpolicyd   <- disable the service and give it a couple of minutes to stop

mv /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb.old  <- move it to one side

zmprov ms $(zmhostname) +zimbraServiceEnabled cbpolicyd  <- give that a few minutes to restart
ls -l /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb  <- what does that show?

cd /opt/zimbra/data/cbpolicyd/db/cbpolicyd

sqlite3 cbpolicyd.sqlitedb 
sqlite> select * from sqlite_sequence;
.tables
Does that show any information from the db?
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
User avatar
fferraro87
Advanced member
Advanced member
Posts: 99
Joined: Thu Apr 28, 2016 8:58 am

Re: Zimbra 8.8.8 cbpolicyd db empty

Post by fferraro87 »

phoenix wrote:I presume you started the cbpolicyd service on an mta server (or a single server?) if that's your configuration. How about trying this:

Code: Select all

su - zimbra

ls -l /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb  <- what does that show?
zmprov ms $(zmhostname) -zimbraServiceEnabled cbpolicyd   <- disable the service and give it a couple of minutes to stop

mv /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb.old  <- move it to one side

zmprov ms $(zmhostname) +zimbraServiceEnabled cbpolicyd  <- give that a few minutes to restart
ls -l /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb  <- what does that show?

cd /opt/zimbra/data/cbpolicyd/db/cbpolicyd

sqlite3 cbpolicyd.sqlitedb 
sqlite> select * from sqlite_sequence;
.tables
Does that show any information from the db?

thanks for your answer, i've started cbpolicyd on a single server and i've that output for :

Code: Select all

[zimbra@mail02 ~]$ ls -l /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb
-rw-r----- 1 zimbra zimbra 0 May  2 15:37 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb
[zimbra@mail02 ~]$ zmprov ms $(zmhostname) -zimbraServiceEnabled cbpolicyd
[zimbra@mail02 ~]$ mv /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb.old
[zimbra@mail02 ~]$ zmprov ms $(zmhostname) +zimbraServiceEnabled cbpolicyd
[zimbra@mail02 ~]$ ls -l /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb
ls: cannot access /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb: No such file or directory
i've wait a couple of minutes after disabled and after enabled cbpolicyd
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Zimbra 8.8.8 cbpolicyd db empty

Post by phoenix »

I don't really understand what's happening here and as I don't have a NE server I'm not really sure where to look for the answer. Those steps I've listed did work for me on a test server. Is yours a single or multi server installation? I should also have asked this in my previous post, do you see anything useful in the log file at: /opt/zimbra/log/cbpolicyd.log
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
User avatar
fferraro87
Advanced member
Advanced member
Posts: 99
Joined: Thu Apr 28, 2016 8:58 am

Re: Zimbra 8.8.8 cbpolicyd db empty

Post by fferraro87 »

phoenix wrote:I don't really understand what's happening here and as I don't have a NE server I'm not really sure where to look for the answer. Those steps I've listed did work for me on a test server. Is yours a single or multi server installation? I should also have asked this in my previous post, do you see anything useful in the log file at: /opt/zimbra/log/cbpolicyd.log
It's a single server, if i reboot the server i've that line on cbpolicyd.log :

Code: Select all

[2018/05/03-11:03:52 - 3551] [CBPOLICYD] NOTICE: PolicyD v2 / Cluebringer - v2.1.x-201205100639
[2018/05/03-11:03:52 - 3551] [CBPOLICYD] NOTICE: Initializing system modules.
[2018/05/03-11:03:52 - 3551] [CBPOLICYD] NOTICE: System modules initialized.
[2018/05/03-11:03:52 - 3551] [CBPOLICYD] NOTICE: Module load started...
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE:   => AccessControl: disabled
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE:   => Accounting: disabled
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE:   => Amavis: disabled
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE:   => CheckHelo: disabled
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE:   => CheckSPF: disabled
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE:   => Greylisting: disabled
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE:   => Quotas: enabled
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE:   => Protocol(Postfix): enabled
[2018/05/03-11:03:52 - 3551] [CBPOLICYD] NOTICE: Module load done.
[2018/05/03-11:03:52 - 3551] [CBPOLICYD] NOTICE: Session tracking is ENABLED.
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE: 2018/05/03-11:03:52 cbp (type Net::Server::PreFork) starting! pid(3551)
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE: Resolved [localhost]:10031 to [::1]:10031, IPv6
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE: Resolved [localhost]:10031 to [127.0.0.1]:10031, IPv4
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE: Binding to TCP port 10031 on host ::1 with IPv6
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE: Binding to TCP port 10031 on host 127.0.0.1 with IPv4
[2018/05/03-11:03:52 - 3551] [CORE] NOTICE: Setting gid to "995 995"
[2018/05/03-11:03:52 - 3551] [CORE] INFO: Setting up serialization via flock
[2018/05/03-11:03:52 - 3551] [CORE] INFO: Beginning prefork (4 processes)
[2018/05/03-11:03:52 - 3551] [CORE] INFO: Starting "4" children
[2018/05/03-11:04:13 - 3553] [CORE] INFO: 2018/05/03-11:04:13 CONNECT TCP Peer: "[127.0.0.1]:38792" Local: "[127.0.0.1]:10031"
[2018/05/03-11:04:13 - 3553] [TRACKING] ERROR: Failed to select session tracking info: awitpt::db::dblayer::DBSelect(126): Error executing select: no such table: session_tracking
[2018/05/03-11:04:13 - 3551] [CORE] INFO: Starting "1" children
User avatar
fferraro87
Advanced member
Advanced member
Posts: 99
Joined: Thu Apr 28, 2016 8:58 am

Re: Zimbra 8.8.8 cbpolicyd db empty

Post by fferraro87 »

I've solved thanks to this thread :

viewtopic.php?t=14104&start=10

these are the commands to reinitialize from scratch cbpolicyd db :

Code: Select all

zmcbpolicydctl stop

cd /opt/zimbra/data/cbpolicyd/db

mkdir back

mv * back

cd

/opt/zimbra/libexec/zmcbpolicydinit

zmcbpolicydctl start
thanks also to you phoenix
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: Zimbra 8.8.8 cbpolicyd db empty

Post by phoenix »

Is there nothing in the logfile from when you first enabled cbpolicyd?
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
Post Reply