Error 500 when accessing http://10.200.1.17:8008/overview/

152 views
Skip to first unread message

andreas.h...@anqodo.com

unread,
May 15, 2017, 2:25:37 AM5/15/17
to CDR-Stats
Hi.

i get error 500 when accessing the Analytics Overview.

  File "/usr/share/cdrstats/cdr/decorators.py", line 37, in _caller
    return view_func(request, *args, **kwargs)
  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/usr/share/cdrstats/cdr/views.py", line 711, in cdr_overview
    hourly_data = get_report_cdr_per_switch(request.user, 'hour', start_date, end_date, switch_id)
  File "/usr/share/cdrstats/aggregator/pandas_cdr.py", line 104, in get_report_cdr_per_switch
    table = pd.tools.pivot.pivot_table(df,
AttributeError: 'module' object has no attribute 'pivot'

Any ideas?
Pandas is installed.

br,
andi

Daniel Friedman

unread,
Jun 13, 2017, 5:30:21 AM6/13/17
to CDR-Stats
Hello,

I am having the same problems, but on several pages only (Debian Jessie 8.8, installed with the install script):

When we hit the country report section we get HTTP 500 error:

 

Traceback (most recent call last):

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response

    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view

    return view_func(request, *args, **kwargs)

  File "/usr/share/cdrstats/cdr/decorators.py", line 37, in _caller

    return view_func(request, *args, **kwargs)

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view

    return view_func(request, *args, **kwargs)

  File "/usr/share/cdrstats/cdr/views.py", line 834, in cdr_country_report

    hourly_data = get_report_cdr_per_country(request.user, 'hour', start_date, end_date, switch_id, country_id_list)

  File "/usr/share/cdrstats/aggregator/pandas_cdr.py", line 152, in get_report_cdr_per_country

    table = pd.tools.pivot.pivot_table(df,

AttributeError: 'module' object has no attribute 'pivot'

 

When we hit the billing report we get HTTP 50 error:

 

DEBUG 2017-06-12 18:52:45,664 base 27604 140222898616064 cache hit: 474964b8bfa0495c7a6b17dbff0ab5a2

ERROR 2017-06-12 18:52:45,674 base 27604 140222898616064 Internal Server Error: /billing_report/

Traceback (most recent call last):

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response

    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view

    return view_func(request, *args, **kwargs)

  File "/usr/share/cdrstats/cdr/decorators.py", line 37, in _caller

    return view_func(request, *args, **kwargs)

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view

    return view_func(request, *args, **kwargs)

  File "/usr/share/cdrstats/voip_billing/views.py", line 243, in billing_report

    hourly_data = get_report_cdr_per_switch(request.user, 'hour', start_date, end_date, switch_id)

  File "/usr/share/cdrstats/aggregator/pandas_cdr.py", line 104, in get_report_cdr_per_switch

    table = pd.tools.pivot.pivot_table(df,

AttributeError: 'module' object has no attribute 'pivot'

 

When we hit the overview we get HTTP 500 error:

 

DEBUG 2017-06-12 18:53:39,353 base 27604 140222898616064 cache hit: 474964b8bfa0495c7a6b17dbff0ab5a2

ERROR 2017-06-12 18:53:39,366 base 27604 140222898616064 Internal Server Error: /overview/

Traceback (most recent call last):

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response

    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view

    return view_func(request, *args, **kwargs)

  File "/usr/share/cdrstats/cdr/decorators.py", line 37, in _caller

    return view_func(request, *args, **kwargs)

  File "/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view

    return view_func(request, *args, **kwargs)

  File "/usr/share/cdrstats/cdr/views.py", line 711, in cdr_overview

    hourly_data = get_report_cdr_per_switch(request.user, 'hour', start_date, end_date, switch_id)

  File "/usr/share/cdrstats/aggregator/pandas_cdr.py", line 104, in get_report_cdr_per_switch

    table = pd.tools.pivot.pivot_table(df,

AttributeError: 'module' object has no attribute 'pivot'


I think that it is versions problems of the python that does not meet the pandas module.

thank you,

dani

Daniel Friedman

unread,
Jun 18, 2017, 7:21:16 AM6/18/17
to CDR-Stats
Ok, Here is the log from the error:

AttributeError at /country_report/

'module' object has no attribute 'pivot'

Request Method:

GET

Request URL:

http://108.61.167.138:8008/country_report/

Django Version:

1.7.7

Exception Type:

AttributeError

Exception Value:

'module' object has no attribute 'pivot'

Exception Location:

/usr/share/cdrstats/aggregator/pandas_cdr.py in get_report_cdr_per_country, line 152

Python Executable:

/opt/miniconda/envs/cdr-stats/bin/python

Python Version:

2.7.13

Python Path:

['/usr/share/cdrstats',
 '/opt/miniconda/envs/cdr-stats/bin',
 '/opt/miniconda/envs/cdr-stats/lib/python27.zip',
 '/opt/miniconda/envs/cdr-stats/lib/python2.7',
 '/opt/miniconda/envs/cdr-stats/lib/python2.7/plat-linux2',
 '/opt/miniconda/envs/cdr-stats/lib/python2.7/lib-tk',
 '/opt/miniconda/envs/cdr-stats/lib/python2.7/lib-old',
 '/opt/miniconda/envs/cdr-stats/lib/python2.7/lib-dynload',
 '/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages',
 '/opt/miniconda/envs/cdr-stats/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg']

Server time:

Sun, 18 Jun 2017 11:14:54 +0000



On Monday, May 15, 2017 at 9:25:37 AM UTC+3, andreas.h...@anqodo.com wrote:
Message has been deleted

Daniel Friedman

unread,
Jun 18, 2017, 10:17:05 AM6/18/17
to CDR-Stats
*** Solved ***

finally a solution. The problem is that there was an upgrade to the pandas and sqlparse modules and it interferes with django-debug-toolbar module.
What you have to do after the installation (it will take few minutes on the pandas part so be patient):

source /opt/miniconda/envs/cdr-stats/
bin/activate /opt/miniconda/envs/cdr-stats
pip install sqlparse==0.1.19
pip install pandas==0.16.0
cd /usr/share/cdrstats/
python manage.py migrate --database=import_cdr

Thank you,

Dani


On Monday, May 15, 2017 at 9:25:37 AM UTC+3, andreas.h...@anqodo.com wrote:

Daniel Friedman

unread,
Jul 6, 2017, 9:08:29 AM7/6/17
to CDR-Stats
*** Solved ***

finally a solution. The problem is that there was an upgrade to the pandas and sqlparse modules and it interferes with django-debug-toolbar module.
What you have to do after the installation (it will take few minutes on the pandas part so be patient):

source /opt/miniconda/envs/cdr-stats/bin/activate /opt/miniconda/envs/cdr-stats

pip install sqlparse==0.1.19
pip install pandas==0.16.0
cd /usr/share/cdrstats/
python manage.py migrate --database=import_cdr

Thank you,

Dani


On Monday, May 15, 2017 at 9:25:37 AM UTC+3, andreas.h...@anqodo.com wrote:
Reply all
Reply to author
Forward
0 new messages