Asterisk CDR on pgsql - cannot connect to DB

237 views
Skip to first unread message

Uri Ben-avraham

unread,
Jan 30, 2013, 7:28:38 AM1/30/13
to cdr-...@googlegroups.com
I'm having trouble connecting to pgsql DB containing my CDR.

cdr-stats is installed on ubuntu 12.04 clean.
I have a dedicated pgsql server to which the Asterisk writes. I'm using the same credentials to access the DB.

on the Diagnostic page I see
Connection error with voice1
voice1CDR_TYPEasterisk
DB_ENGINEpgsql
DB_NAMEasterisk
TABLE_NAMEcdrError
USERasterisk
PASSWORDXXXXXX
HOST[DB server]
PORT5432

When looking at the celerymon (python manage.py celeryd -E) I have the following:

[2013-01-30 14:18:03,673: WARNING/MainProcess] celery@cdr-stats ready.
[2013-01-30 14:18:10,688: WARNING/PoolWorker-1] Could not connect to Database: invalid connection option "passwd"
 - voice1
[2013-01-30 14:18:20,713: WARNING/PoolWorker-2] Could not connect to Database: invalid connection option "passwd"
 - voice1
[2013-01-30 14:18:20,719: ERROR/MainProcess] Task cdr.tasks.sync_cdr_pending[d9e2ff3c-e1ac-4253-910c-de16bff30120] raised exception: WorkerLostError('Worker exited prematurely (exitcode: 1).',)
Traceback (most recent call last):
  File "/usr/share/virtualenvs/cdr-stats/local/lib/python2.7/site-packages/billiard/pool.py", line 935, in _join_exited_workers
    lost_ret, ))
WorkerLostError: Worker exited prematurely (exitcode: 1).

celery log shows:
[2013-01-30 14:23:42,489: INFO/Beat] Scheduler: Sending due task cdr.tasks.get_channels_info (cdr.tasks.get_channels_info)
[2013-01-30 14:23:42,492: INFO/MainProcess] Got task from broker: cdr.tasks.get_channels_info[9351ad41-e7d5-448b-bdc6-8007975d34a7]
[2013-01-30 14:23:42,502: INFO/MainProcess] Task cdr.tasks.get_channels_info[9351ad41-e7d5-448b-bdc6-8007975d34a7] succeeded in 0.00298309326172s: None

and naturally, due to the lack of data, the dashboard shows

No data can be found in your collections, please make sure the import of data is working correctly.



What am I missing here? 
 

supmon

unread,
Jan 30, 2013, 12:26:52 PM1/30/13
to cdr-...@googlegroups.com
Uri,

I'm no expert but I think you must have a spelling error on your password somewhere.

Check the " settings_local.py " file located at /usr/share/cdr-stats/ and ensure that your password is set correctly for the following :

DATABASES = {
    'default': {
        # Add 'postgresql_psycopg2','postgresql','mysql','sqlite3','oracle'
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'DATABASENAME',
        'USER': 'DB_USERNAME',
        'PASSWORD': 'DB_PASSWORD',
        'HOST': 'DB_HOSTNAME',
        'PORT': 'DB_PORT',
        'OPTIONS': {
            #Needed on Mysql
            # 'init_command': 'SET storage_engine=INNODB',
            #Postgresql Autocommit
            'autocommit': True,
        }
    }
}
There might be a couple of other places where the DB password needs to be set.

supmon

Uri Ben-avraham

unread,
Jan 30, 2013, 12:36:18 PM1/30/13
to cdr-...@googlegroups.com
10x supmon, 
I've Checked those, I don't think that my problem.

DATABASES refers to the cdr-stats itself.
While the CDR DB data is taken from the CDR_BACKEND, which is properly configured.

Uri

Areski

unread,
Jan 31, 2013, 4:49:29 AM1/31/13
to cdr-...@googlegroups.com
To follow up on this with everyone, we checked with Uri and found few issues with PostgreSQL.
We released v2.0.2 which brings some fixes :

If you are deploying with Asterisk-Postgresql, let us know how it is going for you.



--
You received this message because you are subscribed to the Google Groups "CDR-Stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdr-stats+...@googlegroups.com.
To post to this group, send email to cdr-...@googlegroups.com.
Visit this group at http://groups.google.com/group/cdr-stats?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Kinds regards,
/Areski

----
Arezqui Belaid
are...@gmail.com / +34650784355

Founder at Star2Billing (www.star2billing.com)
Author @ A2Billing (www.a2billing.net), @ Newfies-Dialer (www.newfies-dialer.org), @ CDR-Stats (www.cdr-stats.org)
----
Twitter : http://twitter.com/areskib / LinkedIN : http://www.linkedin.com/in/areski
Reply all
Reply to author
Forward
0 new messages