Reguarding Internal server error 500 (Solved)

1,280 views
Skip to first unread message

PipBoy

unread,
Nov 28, 2012, 1:17:31 PM11/28/12
to cdr-...@googlegroups.com
There was an issue that would show "internal server error 500" when doing a fresh install. This partly caused by an issue involving what directory you were installing from. Areski gave me and a hand with this issue and patched the installer. I have since run a few test installs and it works perfectly. Go ahead and doing a clean install and it should work fine now.

My tests were done in with a FreePBX distro install however I think this should be easily replicated to any other OS.

Areski

unread,
Nov 28, 2012, 1:18:47 PM11/28/12
to cdr-...@googlegroups.com
Great :)
Now it's not mandatory to run the script from /usr/src directory!


On Wed, Nov 28, 2012 at 7:17 PM, PipBoy <mzi...@gmail.com> wrote:
There was an issue that would show "internal server error 500" when doing a fresh install. This partly caused by an issue involving what directory you were installing from. Areski gave me and a hand with this issue and patched the installer. I have since run a few test installs and it works perfectly. Go ahead and doing a clean install and it should work fine now.

My tests were done in with a FreePBX distro install however I think this should be easily replicated to any other OS.

--
You received this message because you are subscribed to the Google Groups "CDR-Stats" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cdr-stats/-/PjxDQ2tbuiUJ.
To post to this group, send email to cdr-...@googlegroups.com.
To unsubscribe from this group, send email to cdr-stats+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cdr-stats?hl=en.



--
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

Jurgens Krause

unread,
Nov 29, 2012, 4:00:39 AM11/29/12
to cdr-...@googlegroups.com
That is great thank you. 

Anton Kvashenkin

unread,
Dec 4, 2012, 5:51:42 AM12/4/12
to cdr-...@googlegroups.com
I was running script form ~/ by issuing sudo bash install-cdr-stats.sh. But there is still the error 500 Internal server Error. Ubuntu 12.04 LTS

Areski

unread,
Dec 4, 2012, 6:24:32 AM12/4/12
to cdr-...@googlegroups.com
You might want to troubleshoot your issue to report us what went wrong :


--
You received this message because you are subscribed to the Google Groups "CDR-Stats" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cdr-stats/-/VABWdZ0k7Q0J.

To post to this group, send email to cdr-...@googlegroups.com.
To unsubscribe from this group, send email to cdr-stats+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cdr-stats?hl=en.

Anton Kvashenkin

unread,
Dec 4, 2012, 7:08:56 AM12/4/12
to cdr-...@googlegroups.com
kvashenkin@cdr:~$ tail -f /var/log/cdr-stats/err-apache-cdr-stats.log
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]     return _trans.activate(language)
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]   File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 194, in activate
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]     _active.value = translation(language)
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]   File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 183, in translation
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]     default_translation = _fetch(settings.LANGUAGE_CODE)
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]   File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 160, in _fetch
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]     app = import_module(appname)
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185]     __import__(name)
[Tue Dec 04 15:42:03 2012] [error] [client 192.168.0.185] ImportError: No module named frontend_notification

 python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
/usr/lib/python2.7/dist-packages

when i login thru ssh i get this error

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/virtualenvwrapper-3.6-py2.7.egg/virtualenvwrapper/hook_loader.py", line 93, in main
    backupCount=1,
  File "/usr/lib/python2.7/logging/handlers.py", line 118, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/handlers.py", line 65, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/__init__.py", line 897, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/local/lib/python2.7/dist-packages/virtualenvwrapper-3.6-py2.7.egg/virtualenvwrapper/hook_loader.py", line 27, in _open
    rtv = logging.handlers.RotatingFileHandler._open(self)
  File "/usr/lib/python2.7/logging/__init__.py", line 916, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/usr/share/virtualenvs/hook.log'
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenv has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.


On Wednesday, 28 November 2012 22:17:31 UTC+4, PipBoy wrote:

Anton Kvashenkin

unread,
Dec 4, 2012, 7:20:22 AM12/4/12
to cdr-...@googlegroups.com
Guys, can you help me to fix virtualenv issue, please.


On Wednesday, 28 November 2012 22:17:31 UTC+4, PipBoy wrote:

Areski

unread,
Dec 4, 2012, 7:24:45 AM12/4/12
to cdr-...@googlegroups.com
As you can see by this error : "ImportError: No module named frontend_notification"
a dependencies is missing.

We introduce a new module in the last days, our install script take care of installing it.
You should add : pip install django-frontend-notification


On Tue, Dec 4, 2012 at 1:08 PM, Anton Kvashenkin <anton....@gmail.com> wrote:
ImportError: No module named frontend_notification



Anton Kvashenkin

unread,
Dec 4, 2012, 7:42:43 AM12/4/12
to cdr-...@googlegroups.com
Thanks for reply.

tail -f /var/log/cdr-stats/cdr-stats.log
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 763, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
    return self.cursor.execute(query, args)
DatabaseError: relation "hangup_cause" does not exist
LINE 1: ...cause"."cause", "hangup_cause"."description" FROM "hangup_ca...

why the hackit lookups pgsql?

Areski

unread,
Dec 4, 2012, 7:46:29 AM12/4/12
to cdr-...@googlegroups.com
With our installation it made to work with postgresql, which I still recommend to use :)

I reckon you might not have updated correctly to use Mysql.

--
You received this message because you are subscribed to the Google Groups "CDR-Stats" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cdr-stats/-/e-wvXdXBXM4J.

To post to this group, send email to cdr-...@googlegroups.com.
To unsubscribe from this group, send email to cdr-stats+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cdr-stats?hl=en.

Anton Kvashenkin

unread,
Dec 4, 2012, 7:50:09 AM12/4/12
to cdr-...@googlegroups.com
It's just clean install via install.sh script. 1 - FreeeSWITCH, 1 - Install all

Anton Kvashenkin

unread,
Dec 5, 2012, 1:01:07 AM12/5/12
to cdr-...@googlegroups.com
Start for clean install. Now it works just fine, i can login and change settings, but i don't see any cdrs @ dashboard or any other menus. I'm using FreeSWITCH.

show dbs
cdr-stats       (empty)
freeswitch_cdr  0.203125GB
local   (empty)

cdr is populated

db.cdr.find()
{ "_id" : ObjectId("50bee09140fd149d62afe773"), "channel_data" : { "state" : "CS_REPORTING", "direction" : "outbound", "state_number" : 11, "flags" : "0=1;1=1;2=1;18=1;35=1;36=1;38=1;41=1;51=1;58=1", "caps" : "1=1;2=1;3=1;4=1;5=1;6=1" }, "variables" : { "direction" : "outbound", "is_outbound" : "true", "uuid" : "1acd9bfa-3ea0-11e2-9706-677f11e98bd7", "session_id" : "2", "sip_profile_name" : "internal", "channel_name" : "sofia/internal/pi...@192.168.0.174", "sip_destination_url" : "sip:pi...@192.168.0.174", "originate_early_media" : "true", "sip_local_sdp_str" : "v=0\no=FreeSWITCH 1354662553 1354662554 IN IP4 192.168.0.90\ns=FreeSWITCH\nc=IN IP4 192.168.0.90\nt=0 0\nm=audio 24260 RTP/AVP 9 0 8 3 101 13\na=rtpmap:101 t

....


tail /var/log/cdr-stats/*
==> /var/log/cdr-stats/cdr-stats-db.log <==

==> /var/log/cdr-stats/cdr-stats.log <==
DEBUG 2012-12-05 05:58:20,516 generic 22549 140000740218624 execute "ALTER TABLE "djcelery_crontabschedule" ADD COLUMN "day_of_month" varchar(64) NOT NULL DEFAULT '*';" with params "[]"
DEBUG 2012-12-05 05:58:20,527 generic 22549 140000740218624 execute "ALTER TABLE "djcelery_crontabschedule" ALTER COLUMN "day_of_month" TYPE varchar(64), ALTER COLUMN "day_of_month" SET NOT NULL, ALTER COLUMN "day_of_month" DROP DEFAULT;" with params "[]"
DEBUG 2012-12-05 05:58:20,528 generic 22549 140000740218624 execute "ALTER TABLE "djcelery_crontabschedule" ADD COLUMN "month_of_year" varchar(64) NOT NULL DEFAULT '*';" with params "[]"
DEBUG 2012-12-05 05:58:20,536 generic 22549 140000740218624 execute "ALTER TABLE "djcelery_crontabschedule" ALTER COLUMN "month_of_year" TYPE varchar(64), ALTER COLUMN "month_of_year" SET NOT NULL, ALTER COLUMN "month_of_year" DROP DEFAULT;" with params "[]"
DEBUG 2012-12-05 05:58:20,561 generic 22549 140000740218624 execute "ALTER TABLE "celery_taskmeta" ADD COLUMN "meta" text NULL;" with params "[]"
DEBUG 2012-12-05 05:58:20,665 generic 22549 140000740218624 execute "CREATE TABLE "tastypie_apiaccess" ("id" serial NOT NULL PRIMARY KEY, "identifier" varchar(255) NOT NULL, "url" varchar(255) NOT NULL, "request_method" varchar(10) NOT NULL, "accessed" integer CHECK ("accessed" >= 0) NOT NULL);" with params "[]"
DEBUG 2012-12-05 05:58:20,718 generic 22549 140000740218624 execute "CREATE TABLE "tastypie_apikey" ("id" serial NOT NULL PRIMARY KEY, "user_id" integer NOT NULL UNIQUE, "key" varchar(256) NOT NULL, "created" timestamp with time zone NOT NULL);" with params "[]"
DEBUG 2012-12-05 05:58:20,742 generic 22549 140000740218624 execute "ALTER TABLE "tastypie_apikey" ADD CONSTRAINT "user_id_refs_id_332d09f456bfdb62" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;" with params "[]"
DEBUG 2012-12-05 09:54:49,632 base 22706 139998286354176 cache miss for c21321c41780c2cd0e8f796f53bada7c
DEBUG 2012-12-05 09:55:03,890 base 22706 139998286354176 cache hit for c21321c41780c2cd0e8f796f53bada7c

==> /var/log/cdr-stats/celery-cdr-stats-node1.log <==
  File "/usr/share/virtualenvs/cdr-stats/local/lib/python2.7/site-packages/common/only_one_task.py", line 21, in _caller
    ret_value = run_func(*args, **kwargs)
  File "/usr/share/cdr_stats/cdr/tasks.py", line 45, in run
    if settings.CDR_BACKEND[settings.LOCAL_SWITCH_IP]['cdr_type'] == 'asterisk':
KeyError: '192.168.0.18'
[2012-12-05 09:56:09,511: INFO/Beat] Scheduler: Sending due task cdr.tasks.get_channels_info (cdr.tasks.get_channels_info)
[2012-12-05 09:56:09,514: INFO/MainProcess] Got task from broker: cdr.tasks.get_channels_info[61645ad1-b988-41cd-a274-51868a152000]
[2012-12-05 09:56:09,524: INFO/PoolWorker-2] TASK :: get_channels_info
[2012-12-05 09:56:09,550: ERROR/PoolWorker-2] Cannot retrieve Switch 192.168.0.18
[2012-12-05 09:56:09,552: INFO/MainProcess] Task cdr.tasks.get_channels_info[61645ad1-b988-41cd-a274-51868a152000] succeeded in 0.0286400318146s: False

==> /var/log/cdr-stats/err-apache-cdr-stats.log <==


Guys, your help is really appreciated.

On Wednesday, 28 November 2012 22:17:31 UTC+4, PipBoy wrote:

Arunas

unread,
Dec 5, 2012, 4:30:41 AM12/5/12
to cdr-...@googlegroups.com
Hi,

It looks like configuration error.
In github.com/Star2Billing/cdr-stats/blob/master/cdr_stats/settings.py#L378 when you define local switch it needs to be in 
line 390:

#Define the IP of your local Switch, it needs to exist in the CDR_BACKEND list
LOCAL_SWITCH_IP = '127.0.0.1'

Can you post your settings.py and celeryconfig.py (stripped from passwords and private stuff) ?

Anton Kvashenkin

unread,
Dec 5, 2012, 4:40:04 AM12/5/12
to cdr-...@googlegroups.com
Thanks for reply. I've already figured out. Just change local_switch_ip to 127.0.0.1 (it was 192.168.0.18)
Reply all
Reply to author
Forward
0 new messages