mixpanel / mixpanel-utils

Other
85 stars 62 forks source link

Export terminated early (?) #5

Closed smauricioj closed 6 years ago

smauricioj commented 6 years ago

I'm trying to get a list of events that happened yesterday (2017-11-10), but when i run my code i get:

Traceback (most recent call last): File "run.py", line 47, in job extractor.execute(config, parametro) ... File "C:\Users\smaur\Anaconda2\lib\site-packages\mixpanel_api__init.py", line 806, in export_events events = self.query_export(params, add_gzip_header=add_gzip_header) File "C:\Users\smaur\Anaconda2\lib\site-packages\mixpanel_api__init__.py", line 751, in query_export events.append(json.loads(line)) File "C:\Users\smaur\Anaconda2\lib\json\init__.py", line 339, in loads return _default_decoder.decode(s) File "C:\Users\smaur\Anaconda2\lib\json\decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\smaur\Anaconda2\lib\json\decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded

I opened the 'mixpanel\init.py' file and, at line 751, tryied to print what is it trying to 'json.loads'. It is a 'line' in 'raw_data'. I printed 'raw_data' and this appeared:

['export terminated early']

What is this?

jaredmixpanel commented 6 years ago

@xxwas We've recently migrated the raw event export service to a new system and we've been seeing this 'export terminated early' error occasionally pop-up since then. We have logging in place to monitor it now and are working to find a solution as soon as possible. It has nothing to do with the mixpanel_api module. If you have any further questions please write to support@mixpanel.com

smauricioj commented 6 years ago

Thank you Jared. I'll try to export data again later today, or maybe tomorrow. If this problem continues, ill contact the mixpanel support.

nikhil-fmq commented 1 year ago

any update on this? I'm still getting this error "terminated early"

argenisf commented 1 year ago

hey @nikhil-fmq that error comes from the API. Usually it happens when you are querying the raw endpoint for an EU project, but using the US endpoint or the other way around. If, for example, your project is in the EU, you will want to initialize the library to send the request to the EU instead of the US. You can see the initialization options here:

https://github.com/mixpanel/mixpanel-utils#initialization

uaibo commented 1 year ago

@argenisf thanks, that solved my headache! I was getting that error when trying to export data from here https://developer.mixpanel.com/reference/raw-event-export My data were on EU and the default endpoint option was not the EU.