Open glennblock opened 10 years ago
Thanks for filing this @glennblock. The root cause is that arguments.callee
isn't implemented in Colony yet. I've opened up #573 to track this.
If you want a short-term fix, change the line https://github.com/splunk/splunk-sdk-javascript/blob/master/lib/jquery.class.js#L15 to:
root.Class.extend = function self (prop) {
And https://github.com/splunk/splunk-sdk-javascript/blob/master/lib/jquery.class.js#L62 to:
Class.extend = self;
Your test seemed to work after that change.
Thanks @tcr! I have a talk coming up in Europe, and I was planning to show our SDK running on Tessel as part of it. I'll see if I get anything else after fixing this.
No problem. Keep us updated, and we can make sure #573 lands in a firmware release before your talk.
@tcr will do, thanks! I appreciate the quick response. Also let me send a shout out to Pub Nub folks as I just happened to be in SF and walked by their Tessel hack night. I left and just had to get one!
That's awesome to hear! The Pub Nub team is almost more excited about Tessel than we are. It's been super fun working with them, and clearly it's paying off.
@tcr that solved that problem! Got a new one :-)
Glenns-MacBook-Pro:splunk-client glennblock$ tessel run test.js
TESSEL! Connected to TM-00-04-f0009a30-00574342-347845c2.
INFO Bundling directory /Users/glennblock/src/tessel/splunk-client
INFO Deploying bundle (15.36 MB)...
INFO Running script...
loaded
/app/node_modules/splunk-sdk/lib/utils.js:133: attempt to index local 'original' (a nil value)
Also defined in utils.js: https://github.com/splunk/splunk-sdk-javascript/blob/master/lib/utils.js#L133
This is the same code (though I added the "loaded" console.log). This is just the next error.
@glennblock what is the target platform for that code? Was it always for Tessel?
@rwaldron do you mean our SDK? The SDK itself is not built for Tessel, I am testing it out to see if it can work. The code using it is very simple / which is in this issue.
The SDK is supported on Windows, Mac and Linux. We test on Ubuntu and I think CentOs.
Then I can assume you mean node? I'm asking because I don't understand why there are definitions for things like indexOf
(and others)
Yes this is node
On Tuesday, October 14, 2014, Rick Waldron notifications@github.com wrote:
Then I can assume you mean node? I'm asking because I don't understand why there are definitions for things like indexOf(and others)
— Reply to this email directly or view it on GitHub https://github.com/tessel/runtime/issues/572#issuecomment-59143449.
It also supports browser usage as well.
I forgot to mention that.
Does that include IE8? Are you using browserify?
I believe we do use Browserify. Not sure on IE8 but can check.
On Tuesday, October 14, 2014, Rick Waldron notifications@github.com wrote:
Does that include IE8? Are you using browserify?
— Reply to this email directly or view it on GitHub https://github.com/tessel/runtime/issues/572#issuecomment-59145088.
Is there a reduced test case for the match
bug? I was going to file this as a new issue for you, but I can't imagine what would cause this beyond something like:
function startsWith(original, prefix) {
var matches = original.match("^" + prefix);
return matches && matches.length > 0 && matches[0] === prefix;
}
startsWith(null, "foo");
startsWith(undefined, "foo");
But that's not a tessel/runtime
issue.
I believe this issue is caused by a dropping HTTP connection not having the right fields populated. So a node-compatibility issue. I can reproduce it intermittently, but it takes a bit—I'll update here soon.
Sure, but it has nothing to do with string.match(...)
Yep. Also, it appears to be a bug in the Splunk SDK's error handling. In splunk/lib/platform/node/node_http.js we find:
req.on("abort", function() {
var res = { headers: {}, statusCode: "abort" };
var data = "{}";
var complete_response = that._buildResponse("abort", res, data);
...
Which brings us to (splunk/lib/http.js](https://github.com/splunk/splunk-sdk-javascript/blob/master/lib/http.js#L238):
_buildResponse: function(error, response, data) {
var complete_response, json = {};
var contentType = null;
if (response && response.headers) {
contentType = utils.trim(response.headers["content-type"] || response.headers["Content-Type"]);
}
...
So if the internet connection drops, and the request
library issues an "abort" error, it will create an empty headers
object but expect it to have a "content-type"
field. So that's always going to throw an error rather than be handled gracefully.
@glennblock, I'll dig into what error conditions trigger the "abort" event in request
, but this issue is a bug in the SDK itself (preventing you from gracefully handling the error and re-establishing the connection.)
Ok, I will look into this. Weird it only showed up when I used it on Tessel.
On Wednesday, October 15, 2014, Tim Cameron Ryan notifications@github.com wrote:
Yep. Also, it appears to be a bug in the Splunk SDK's error handling. In splunk/lib/platform/node/node_http.js https://github.com/splunk/splunk-sdk-javascript/blob/master/lib/platform/node/node_http.js#L59 we find:
req.on("abort", function() { var res = { headers: {}, statusCode: "abort" }; var data = "{}"; var complete_response = that._buildResponse("abort", res, data); ...
Which brings us to (splunk/lib/http.js]( https://github.com/splunk/splunk-sdk-javascript/blob/master/lib/http.js#L238 ):
_buildResponse: function(error, response, data) { var complete_response, json = {};
var contentType = null; if (response && response.headers) { contentType = utils.trim(response.headers["content-type"] || response.headers["Content-Type"]); } ...
So if the internet connection drops, and the request library issues an "abort" error, it will create an empty headers object but expect it to have a "content-type" field. So that's always going to throw an error rather than be handled gracefully.
@glennblock https://github.com/glennblock, I'll dig into what error conditions trigger the "abort" event in request, but this issue is a bug in the SDK itself (preventing you from gracefully handling the error and re-establishing the connection.)
— Reply to this email directly or view it on GitHub https://github.com/tessel/runtime/issues/572#issuecomment-59311828.
@tcr can you file a bug with our SDK?
Hi folks
I wasn't able to get the Splunk SDK working on the device in time for my talk. Instead I demoed piping accelerometer data from the Tessel into Splunk and then visualizing within. The talk is here: http://vimeo.com/111111119 with the Tessel part in the last 10 mins.
I am trying to use Splunk's SDK from my Tessel. Running the following code fails:
With the following error:
The extend method mentioned is defined here.
It is required by the Splunk Service here
Any help / pointers would be appreciated.