Rally Software

 View Only
  • 1.  Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Posted Aug 16, 2018 03:29 PM

    Dear Team,

     

    I am Sai from Cisco. I work with Rally OpsBI Team here. 

    I am using your community based Node Rally Api to talk to Rally API end points. While I was trying to fetch the portfolioItems, I am seeing the issue where the error is something like the below.

     

    SyntaxError: Unexpected token v in JSON at position 9125386

        at JSON.parse (<anonymous>)

        at Request._callback (/Users/saithaku/Projects/work/RallyJobs/delete-restore-views-job/node_modules/rally/dist/request.js:118:32)

        at Request.self.callback (/Users/saithaku/Projects/work/RallyJobs/delete-restore-views-job/node_modules/request/request.js:187:22)

        at emitTwo (events.js:126:13)

        at Request.emit (events.js:214:7)

        at Request.<anonymous> (/Users/saithaku/Projects/work/RallyJobs/delete-restore-views-job/node_modules/request/request.js:1044:10)

        at emitOne (events.js:116:13)

        at Request.emit (events.js:211:7)

        at Gunzip.<anonymous> (/Users/saithaku/Projects/work/RallyJobs/delete-restore-views-job/node_modules/request/request.js:965:12)

        at emitNone (events.js:111:20)

     

    This issue is happening when I am trying to fetch our records starting 3500 - 4000. My guess is, the error handling is not properly written in rally node api. 

    Can any of your folks help us here?

     

    Regards,

    Sai



  • 2.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Broadcom Employee
    Posted Aug 16, 2018 03:59 PM

    Hi Sai,

     

    Can you please include the code you're executing?

    You only included the error stack trace.

     

    If indeed you're getting the error only starting at result 3500, then perhaps you specified a limit to your search. 

     

    What did you specify for 'start' and 'pageSize' arguments?

     

    Sagi



  • 3.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Posted Aug 16, 2018 04:23 PM

    Hi Sagi,

     

     

    Here is what I am trying to do. 

     

    _getPortFolioItemsFromRally(startIndex) {
        console.log(`##### Sending get req with startIndex : ${startIndex}`);
        return this.rallyApiClient.query({
            type: 'PortfolioItem',
            fetch: [true],
            start: startIndex,
            pageSize: 500,
            Order: 'ObjectID',
            scope: {
                Workspace: this.workspace,
            }
        });
    }

    The above is the function which will take the startIndex and return the data back.
    See when fetch is [true] and I want all the records for the portfolioItems starting at 3500 I am seeing an error.

    let me know if you can reproduce this issue at your end

    Thanks
    Sai


  • 4.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Broadcom Employee
    Posted Aug 16, 2018 04:36 PM

    Thanks you Sai.

     

    It's likely the problem is with your data (one of these items returned between 3500-4000. Unless you get more information about this (which I guess you don't) then you may need to narrow down the search to locate the offending object.

     

    Probably you can try slicing the range of 3500-4000 into 5 x 100 ranges (3500-3600, 3600-3700 etc.. ) and run them separately to confirm which range has the problem (and which not), then narrow it down even further and see if you can locate the offending data in this way.

     

    That makes sense?

     

    Sagi



  • 5.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Posted Aug 16, 2018 05:55 PM

    HI Sagi,

     

    You can also try rendering the following URL, you will see what I am talking about. I am seeing it to be a data issue right away 

     

    https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/… 



  • 6.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Posted Aug 16, 2018 04:37 PM

    I can give you that data. I will be back 

     

    Best,

    Sai



  • 7.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Posted Aug 16, 2018 04:46 PM

    Updated to remove this information. 



  • 8.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Broadcom Employee
    Posted Aug 16, 2018 06:02 PM

    Hi Sai.

     

    The JSON structure you included is broken. I guess this is your point and this is what's being returned by Rally. Is that correct?

     

    If so, please notice the FormattedID = EF4789

     

    Can you please:

    1. Do a WSAPI query for (FormattedID = "EF4789") 

    Is this returning okay or also with an error?

     

    2. I suspect it will have an error as well. I believe the problem may be some special character, perhaps some HTML section in one of the fields of this object.

    Can you edit this object is Rally and see if you can identify any problem with it?

     

    Sagi



  • 9.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Posted Aug 17, 2018 04:04 AM

    saithakur,

     

    I removed the data from this post as this is a public forum.  I have a copy if needed for further use, but just wanted to let you know.

     

    Michael



  • 10.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Posted Aug 17, 2018 12:35 PM

    Micheael, 

     

    Sure thanks for that.

    Here is the thing though - the rally apis are giving invalid json strings. Can you guys please help us in sending the valid json data - for us to avoid writing processing engine in the middleware.

     

    Thanks

    Sai



  • 11.  Re: Issue with Rally Node library. https://github.com/RallyTools/rally-node/wiki/User-Guide

    Broadcom Employee
    Posted Aug 17, 2018 12:51 PM

    Hi Sai,

     

    The JSON is generated by the API itself. We can't provide you an alternative JSON. It needs to be fixed.

    In your last update to me you included a big chunk of the JSON that you said was wrong. I was able to figure out that the FormattedID of that object is: EF4789.

     

    I suggested that:

     

    Can you please:

    1. Do a WSAPI query for (FormattedID = "EF4789") 

    Is this returning okay or also with an error?

     

    2. I suspect it will have an error as well. I believe the problem may be some special character, perhaps some HTML section in one of the fields of this object.

    Can you edit this object is Rally and see if you can identify any problem with it?

     

     

    Can you please let us know about it.

     

    Thanks,

    Sagi