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

Sending a push with parse-server 2.4.0 is returning 504 GATEWAY_TIMEOUT #3823

Closed
felipeandradebezerra opened this issue May 16, 2017 · 6 comments

Comments

@felipeandradebezerra
Copy link
Contributor

Sending a push with parse-server 2.4.0 is returning 504 GATEWAY_TIMEOUT
After some retries Parse dashboard shows the message XMLHttpRequest failed: "Unable to connect to the Parse API"

  • parse-server version : 2.4.0
  • AWS EC2
  • Linux
@flovilmart
Copy link
Contributor

can you provide the server logs?

@felipeandradebezerra
Copy link
Contributor Author

felipeandradebezerra commented May 16, 2017

warn: _PushStatus 4CmtJIFFui: error while sending push TypeError: Cannot read property 'toISOString' of undefined
    at Object.setInitial (/home/user/parse-clients/node_modules/parse-server/lib/StatusHandler.js:163:25)
    at /home/user/parse-clients/node_modules/parse-server/lib/Controllers/PushController.js:82:27
    at process._tickDomainCallback (internal/process/next_tick.js:129:7)
/home/user/parse-clients/node_modules/parse-server/lib/ParseServer.js:473
            throw err;

Opz.. I think I have contributed to this :-/

@flovilmart
Copy link
Contributor

hehe :) no problem, that's good it's not fore everyone but only when push_time is undefined :)

> var a  = {push_time: undefined}
undefined
> a
{ push_time: undefined }
> a.hasOwnProperty('push_time')
true

@felipeandradebezerra
Copy link
Contributor Author

felipeandradebezerra commented May 16, 2017

Sure 👍 But push_time will be always undefined when not set on the dashboard.

body['push_time'] = PushController.getPushTime(body);

I think we need some validation before setting push time.

let push_time = PushController.getPushTime(body);
if (push_time) { body['push_time'] = push_time; }

@flovilmart
Copy link
Contributor

so we need to check for typeof push_time !== 'undefined'

@felipeandradebezerra
Copy link
Contributor Author

I hope this fixes the issue.
#3824

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

2 participants