facebook / facebook-python-business-sdk

Python SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
1.28k stars 631 forks source link

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

Closed STANAPI closed 5 years ago

STANAPI commented 5 years ago

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

jingping2015 commented 5 years ago

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

jingping2015 commented 5 years ago

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.