Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixpanel Server Error: 0 #190

Open
devshorts opened this issue Sep 8, 2021 · 5 comments
Open

Mixpanel Server Error: 0 #190

devshorts opened this issue Sep 8, 2021 · 5 comments

Comments

@devshorts
Copy link

I am getting this error semi frequently on a consistent event type and I can't seem to tell if there is something in the payload that is causing this or if this is something else. Is there any insight to be found what server error 0 means?

@tdumitrescu
Copy link
Member

You can initialize the library with {verbose: true, debug: true} and that should give some console logging of error messages from the API.

@devshorts
Copy link
Author

I see, thanks for that. Unfortunately, I can't really repo this local and I am seeing this in production. I'd rather not enable this in production, is there no information about what this error code could mean so I could try and dig a little further?

@tdumitrescu
Copy link
Member

Unfortunately not - in the non-verbose default API mode, "0" is a catch-all for any error.

@devshorts
Copy link
Author

devshorts commented Sep 9, 2021

I was able to find the error in verbose mode, but for what its worth it would be much more helpful from an integration standpoint to just throw the error properly. Having 0 as a catch-all is useless and not helpful. I don't think there's a reason to hide the errors given this is a b2b integration

For anyone else who gets this, my issue was backdating an event older than 5 days. The error was

Mixpanel Server Error: time, 17.1 days in the past (max 5.0

@ak--47
Copy link
Member

ak--47 commented Mar 11, 2022

@devshorts

yes, this the design of the /track API ... nothing older than 5 days

should you wish to import events older than 5 days, you can init the library with an API secret and then use the .import() method to send an older timestamp:

const mixpanel = Mixpanel.init('{{token}}', {
    secret: ' {{api secret}}'
});

mixpanel.import('super old event', new Date(2019, 4, 20, 12, 34, 56), {
    distinct_id: 'ak',
});

if you don't know the 'age' of the event ahead of time, there is no downside to using .import() for everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants