facebook/facebook-python-business-sdk

Facebook API call error "IndexError: list index out of range"

STANAPI opened this issue · 2 comments

Hi everyone, I have encountered the following Facebook API call error. It seems the error is "list index out of range" which results in the loss of data points hence the following four reports generated empty data. Do let me know if require any further details. Thank you.

These are the four reports affected by the above error:

  1. fb_page_daily_fans_city.py
  2. fb_page_daily_fans_country.py
  3. fb_page_daily_fans_gender_age.py
  4. fb_page_daily_fans_language.py

Have attached the four reports:

  1. fb_page_daily_fans_city.py
    fb_page_daily_fans_city.py.docx

  2. fb_page_daily_fans_country.py
    fb_page_daily_fans_country.py.docx

  3. fb_page_daily_fans_gender_age.py
    fb_page_daily_fans_gender_age.py.docx

  4. fb_page_daily_fans_language.py
    fb_page_daily_fans_language.py.docx

The errors are as follow:

1) fb_page_daily_fans_city.py

The Facebook API Call encountered the following exception:
Traceback (most recent call last):
File "C:\STB\STAN_MG_API\Facebook\fb_page_daily_fans_city.py", line 60, in extract
File "C:\STB\STAN_MG_API\Facebook\fb_page_daily_fans_city.py", line 89, in extract
daily = page['data'][0]
IndexError: list index out of range

Refer to error file for more details

2) fb_page_daily_fans_country.py

The Facebook API Call encountered the following exception:
Traceback (most recent call last):
File "C:\STB\STAN_MG_API\Facebook\fb_page_daily_fans_country.py", line 60, in extract
File "C:\STB\STAN_MG_API\Facebook\fb_page_daily_fans_country.py", line 86, in extract
daily = page['data'][0]
IndexError: list index out of range

Refer to error file for more details

3) fb_page_daily_fans_gender_age.py

The Facebook API Call encountered the following exception:
Traceback (most recent call last):
File "C:\STB\STAN_MG_API\Facebook\fb_page_daily_fans_gender_age.py", line 61, in extract
File "C:\STB\STAN_MG_API\Facebook\fb_page_daily_fans_gender_age.py", line 88, in extract
daily = page['data'][0]
IndexError: list index out of range

Refer to error file for more details

4) fb_page_daily_fans_language.py

The Facebook API Call encountered the following exception:
Traceback (most recent call last):
File "C:\STB\STAN_MG_API\Facebook\fb_page_daily_fans_language.py", line 61, in extract
File "C:\STB\STAN_MG_API\Facebook\fb_page_daily_fans_language.py", line 88, in extract
daily = page['data'][0]
IndexError: list index out of range

Refer to error file for more details

what's the value of $page['data']

Since we want to handle bugs more efficiently, we've decided to close issue reporting in Github and move to our dedicated bug reporting channel. If you encounter a bug with Business SDK (Python), please report the issue at our developer bug reporting channel.