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

query() method fails behind proxy in node-webkit application #7

Closed
mcgraphix opened this issue Nov 10, 2014 · 6 comments
Closed

query() method fails behind proxy in node-webkit application #7

mcgraphix opened this issue Nov 10, 2014 · 6 comments

Comments

@mcgraphix
Copy link

I have discovered an issue where the instance returned from calling rally(options) fails to work when behind a proxy if run inside a node-webkit application. Here is what I'm doing in the applcation.

Initializing the API:

this.restApi = rally({
user: username, //stored elswhere
pass: password, //pass in from the suer
requestOptions: {
headers: {
'X-RallyIntegrationName': 'Rally End of Day Prompt',
'X-RallyIntegrationVendor': 'ADP',
'X-RallyIntegrationVersion': '1.0'
},
proxy: "http://my.proxy.server:8080"
}
});

Call the api to request some data.

this.restApi.query({
type: 'task',
start: 1,
pageSize: 200,
limit: Infinity,
order: 'Rank',
fetch: ['FormattedID', 'Name', 'State', 'Estimate', 'TimeSpent', 'ToDo'],
query: queryUtils.where('Owner.Name', '=', this.email)
.and('State', "=", 'In-Progress')//optional filter

    }, function (error, result) {
        if (error) {
            onError(error);
        } else {
            callback(result);
        }
    });

Calling this works fine inside a node application when launched via "node app" but fails with an error when called from a node-webkit application. The error is "Request path contains unescaped characters."

It appears that proxy information may not be getting passed through correctly. I tested this with node-webkit v0.10.x and v0.11.x

@krmorse
Copy link
Contributor

krmorse commented Dec 12, 2014

I'm fairly sure that this is an issue with the underling request node module. If you manually edit the package.json for rally-node to use a more recent version of request does it fix the issue? Currently it's pegged at 2.29.x. The head revision is 2.51.x.

@mcgraphix
Copy link
Author

using 2.51.x results in the following errors when calling: npm install
There is an open issue located ated request/request#870 which seems like the same thing.

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Request.EventEmitter.addListener (events.js:160:15)
at Request.init (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:365:8)
at Request.onResponse (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:814:10)
at ClientRequest.g (events.js:180:16)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at HTTPParser.parserOnIncomingClient as onIncoming
at HTTPParser.parserOnHeadersComplete as onHeadersComplete
at Socket.socketOnData as ondata
at TCP.onread (net.js:527:27)
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Request.EventEmitter.addListener (events.js:160:15)
at Request.start (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:611:8)
at Request.end (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:1237:28)
at C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:413:12
at process._tickCallback (node.js:415:13)

@mcgraphix
Copy link
Author

bad timing... apparently my proxy is unavailable which is what is causing the redirect loop. I will try this again tomorrow when (hopefully) I can connect to the proxy.

@mcgraphix
Copy link
Author

I changed the request version to 2.51.x which seems to have fixed the issue.

@krmorse
Copy link
Contributor

krmorse commented Dec 16, 2014

awesome. there is another pull request i want to get merged in and then i will release a new version of the package with an updated request version as well. thanks for reporting the issue and for your help in diagnosing it!

@krmorse
Copy link
Contributor

krmorse commented Dec 17, 2014

resolved as of version 0.2.0

@krmorse krmorse closed this as completed Dec 17, 2014
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