1

I am sending a simple http call with Meteor, and getting a HPE_INVALID_HEADER_TOKEN error.

 HTTP.call('POST', 'http://someurl:port', requestOptions, function (result) {
            console.log("The result is: " + result);
        });

The trace I am getting back is:

=> App running at: http://localhost:3000/
I20160131-22:42:32.591(8)? Exception while invoking method 'angular:Data/getToken' Error: Parse Error
I20160131-22:42:32.592(8)?     at Object.Future.wait (/Users/D/.meteor/packages/meteor-tool/.1.1.10.1b51q9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:398:15)
I20160131-22:42:32.592(8)?     at Object._.extend.wrapAsync (packages/meteor/helpers.js:119:1)
I20160131-22:42:32.592(8)?     at Object.HTTP.call (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:3070:1)
I20160131-22:42:32.592(8)?     at [object Object].getToken (server/data.js:62:1)
I20160131-22:42:32.592(8)?     at [object Object].angular.module.provider.run.angular.forEach.angular.forEach.methods.(anonymous function) (angular-meteor-common.js:36:36)
I20160131-22:42:32.592(8)?     at [object Object].methodMap.(anonymous function) (packages/meteorhacks_kadira/packages/meteorhacks_kadira.js:2554:1)
I20160131-22:42:32.592(8)?     at maybeAuditArgumentChecks (livedata_server.js:1698:12)
I20160131-22:42:32.592(8)?     at _.extend.protocol_handlers.method.payload.msg (livedata_server.js:708:19)
I20160131-22:42:32.592(8)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20160131-22:42:32.592(8)?     at _.extend.protocol_handlers.method.payload.msg (livedata_server.js:706:40)
I20160131-22:42:32.592(8)?     - - - - -
I20160131-22:42:32.592(8)?     at Socket.socketOnData (http.js:1584:20)
I20160131-22:42:32.592(8)?     at TCP.onread (net.js:528:27)

Now my question is not necessarily what is wrong with the code, but rather: how should I debug my code on a deeper level. With a quick look at the http packages with Wireshark what I am sending and receiving back seem fine. Next, I'd like to debug through the Meteor and/or Node.js part of the code (which the above trace is referring to) in order to see exactly where the parsing fails.

  • How do I attach the Meteor (and/or Node.js) source for debugging? (I am using Webstorm).
  • What is the best practice in the community for debugging deeper into the code? Having a parsing issue like this is not really the real concern here, but not knowing the process of investigating further is a much bigger issue for me.

I am still just familiarizing myself with Meteor and would appreciate the help. Thanks :)

Crocodile
  • 5,724
  • 11
  • 41
  • 67
  • Possible duplicate of [Meteor: Debug on server side](http://stackoverflow.com/questions/11034941/meteor-debug-on-server-side) – Christian Fritz Jan 31 '16 at 19:05
  • please see whether the suggested duplicate answers your question (the short answer is, use `meteor shell`). If not, please explain what is different in your case. – Christian Fritz Jan 31 '16 at 19:05

0 Answers0