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

Parse.Cloud.httpRequest crashing on Parse Server Heroku #783

Closed
wavo89 opened this issue Mar 3, 2016 · 1 comment
Closed

Parse.Cloud.httpRequest crashing on Parse Server Heroku #783

wavo89 opened this issue Mar 3, 2016 · 1 comment

Comments

@wavo89
Copy link

wavo89 commented Mar 3, 2016

Running Parse-Server 2.1.3

OpenTokSDK.prototype.apiRequest = function(endpoint, authScheme, options, cb) {

  // options is optional
  if (cb === undefined) { cb = options; options = {}; }

  var requestOptions = {
    url: urlFromEndpoint(endpoint, options.endpoint),
    method: methodFromEndpoint(endpoint),
    headers: {},
    body: options.data || {},
    success: function(response) {
      cb(null, response);
    },
    error: function(response) {
      cb(new Error("Request failed with response code " + response.status + "\n" +
                   "Raw response: \n" + response.text + "\n"));
    }
  };

  if (authScheme === AUTH.PARTNER) {
    requestOptions.headers[authScheme] = this.apiKey + ':' + this.apiSecret;
  } else if (authScheme === AUTH.TOKEN) {
    requestOptions.headers[authScheme] = this.generateToken.apply( this, options.auth );
  } else {
    console.warn("OpenTok: No known authentication scheme chosen for the following request: \n" +
      JSON.stringify(requestOptions) + "\n");
  }

  Parse.Cloud.httpRequest(requestOptions);
  console.log("OpenTok: Sent the following request: \n" + JSON.stringify(requestOptions) + "\n");
  return;
};

Parse.Cloud.httpRequest(requestOptions) is line 196.

The command line:

Uncaught internal server error. [TypeError: Cannot read property 'statusCode' of undefined] TypeError: Cannot read property 'statusCode' of undefined
2016-03-03T01:47:51.698829+00:00 app[web.1]:     at Request._callback (/app/node_modules/parse-server/lib/httpRequest.js:46:35)
2016-03-03T01:47:51.698830+00:00 app[web.1]:     at self.callback (/app/node_modules/request/request.js:199:22)
2016-03-03T01:47:51.698831+00:00 app[web.1]:     at emitOne (events.js:90:13)
2016-03-03T01:47:51.698832+00:00 app[web.1]:     at Request.emit (events.js:182:7)
2016-03-03T01:47:51.698832+00:00 app[web.1]:     at setContentLength (/app/node_modules/request/request.js:451:14)
2016-03-03T01:47:51.698833+00:00 app[web.1]:     at Request.init (/app/node_modules/request/request.js:456:5)
2016-03-03T01:47:51.698834+00:00 app[web.1]:     at new Request (/app/node_modules/request/request.js:141:8)
2016-03-03T01:47:51.698835+00:00 app[web.1]:     at request (/app/node_modules/request/index.js:55:10)
2016-03-03T01:47:51.698836+00:00 app[web.1]:     at Object.module.exports [as httpRequest] (/app/node_modules/parse-server/lib/httpRequest.js:44:3)
2016-03-03T01:47:51.698836+00:00 app[web.1]:     at OpenTokSDK.apiRequest (/app/cloud/opentok/opentok.js:196:15)
@flovilmart
Copy link
Contributor

Should be fixed with #773 stay tuned for the next release!

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