[Spce-user] acc-cleanup not working anymore

Alex Lutay alutay at sipwise.com
Wed Jun 26 10:37:14 EDT 2019


Hi,

Thank you for tracing it down and reporting here.
First of all, please share your NGCP version.

I have just checked some versions I have nearby and it works well
in all releases I have (here is the output with debug mode on):

> root at spce:~# ngcp-cleanup-acc
> DEBUG update_partitions: table=cdr_mos_data checking start=2019-06 end=2019-07
> DEBUG archive_dump: cdr_cash_balance_data
> DEBUG archive_dump: cdr_time_balance_data
> DEBUG archive_dump: cdr_relation_data
> DEBUG archive_dump: cdr_tag_data
> DEBUG archive_dump: cdr_mos_data
> DEBUG archive_dump: cdr_export_status
> DEBUG archive_dump: cdr
> DEBUG cleanup_table: acc
> DEBUG cleanup_table: table=acc deleted rows=0
> DEBUG cleanup_table: acc_trash
> DEBUG cleanup_table: table=acc_trash deleted rows=0
> DEBUG cleanup_table: acc_backup
> DEBUG cleanup_table: table=acc_backup deleted rows=0
> root at spce:~# 

Unfortunately I have no records to delete there, but still
I have no DB connect errors there.

Also, I have username/password in config acc-cleanup.conf:
> root at spce:/usr# grep "user\|pass" /etc/ngcp-cleanup-tools/acc-cleanup.conf
> username = dbcleaner
> password = somethingsecrethere
> root at spce:/usr#

IF you are using the recent release... can you please check where your
acc-cleanup.pl is pointing? It should be the backward compatibility
symlink to modern ngcp-cleanup-acc:

> root at spce:/usr# ls -la /usr/sbin/acc-cleanup.pl
> lrwxrwxrwx 1 root root 16 Jun 18 14:33 /usr/sbin/acc-cleanup.pl -> ngcp-cleanup-acc
> root at spce:/usr# 

MAYBE.... you have both acc-cleanup.pl and ngcp-cleanup-acc for some
wired reason and compatibility link was not created?
... and old script uses old code... and doing some mess for you?

I have checked the source code for ngcp-cleanup-acc and it should use
username/password since 2017.

Please share more details about your system here. Let's start with:
> cat /etc/ngcp_version
> cat /etc/sipwise_ngcp_version 
> which ngcp-cleanup-acc
> which acc-cleanup.pl
> ls -la $(which acc-cleanup.pl)
> ls -la /usr/sbin/acc-cleanup.pl

Tnx!

On 6/26/19 2:40 PM, Henk wrote:
> I received no reaction at all on the acc-cleanup problem, so I
> investigated this a little more.
> I found the following bug:
> In acc-cleanup.conf *username* and *password* are defined, but
> Cleanup.pm uses *user* and *pass* for the database connection.
> Of course if the root DB user has no password defined there seems to be
> no error.
> 
> A quick workaround is using acc-cleanup.conf.customtt replacing username
> and password lines:
> 
> user = [% credentials.mysql.cleanuptools.u %]
> pass = [% credentials.mysql.cleanuptools.p %]
> 
> Everything is working now, so please change this in the next release! It
> saves a lot of disk space and also memory!


-- 
Alex Lutay



More information about the Spce-user mailing list