3 Replies Latest reply on Sep 29, 2014 7:04 PM by Dean Olynyk

    500 Internal Error after applying Filter via API

    Dean Olynyk

      Hi there,

       

      Can someone tell me if I can get further information on a 500 HTTP error?  I'm trying to apply a filter on a viz loaded via the API.  It loads just fine but when I attempt to change a filter via:

       

      useagePatternViz.getWorkbook().getActiveSheet().applyFilterAsync("Filter", ['2013-12-31'], tableauSoftware.FilterUpdateType.REPLACE);

       

      If I watch the wire I can see the HTTP POST that applies the filter returns:

       

      LogicException: Internal Error An unexpected error occurred and the operation could not be completed.

      2014-09-22 17:27:27.182(VCBb-QoBT9EAABKkoMgAAAHo,0,0)


      I can cross-reference VCBb-QoBT9EAABKkoMgAAAHo in the httpd log file:


      10.7.0.52 - - [22/Sep/2014:10:27:32 -0700] 443 "POST /vizql/t/<projectname>/w/<workbook>/v/<viz>/sessions/7AB5A4FBA74A45289FF3281AEDD054D6-0:0/commands/tabdoc/categorical-filter HTTP/1.1" "10.7.0.52" 500 204 "352" 1234375 VCBcBAoBT9EAABKkoMoAAAHB


      I couldn't find any other log file that had more information.  Can someone tell me how to figure out what's the matter here?


      Thanks,

      D.

        • 1. Re: 500 Internal Error after applying Filter via API
          Patrick A Van Der Hyde

          Moved to Tableau Developer community where this is more likely to get a response.

           

          -- Patrick

          • 2. Re: 500 Internal Error after applying Filter via API
            Russell Christopher

            Can you put a try/catch on this in order to see the actual exception as returned by Tableau?

             

            It's pretty rare to filter on a single date as you're doing above. Most will filter using applyRelativeDateFilterAsync() or applyRangeFilterAsync() vs. passing in a single date to this method - so your scenario is a tiny bit unnatural... I actually haven't seen too many people attempting it. In fact, help indicates that the method you're using shouldn't be applied when using date datatypes:

             

            applyFilterAsync(
            fieldName: string,
            values: object[] or object,
            updateType: FilterUpdateType,
            options?: FilterOptions)

            Promise<string>

            Applies a simple categorical filter (non-date). See the filtering examples for more details on these functions. Returns the fieldName that was filtered.

             

            So, I'm guessing that this doesn't work at all. Other things you might want to try would be to wrap your date value in pound symbols - you're passing it as a string right now.

            • 3. Re: 500 Internal Error after applying Filter via API
              Dean Olynyk

              Hi Russell,

               

              This is going against an MSAS cube.  When I set the dimension as a date and set it to continuous, I couldn't get the numbers anywhere near what they should have been otherwise.  Regardless, even ignoring the wrong results, the asyncRangeFilter (or whatever it's called) worked, or failed exactly the same as the way I'm doing it now.  Full disclosure, I have very little experience using cubes and Tableau together.

               

              Realizing full well this was a bit weird, I went with an easier filter, gender.  Again, exact same issue.  It works sometimes, other times it doesn't.

               

              Interestingly enough, IE11 works the majority of the time whereas Chrome doesn't.

               

              The error that pops up is "Error: Invalid filter field name or value".  Before the async filter call I iterate over the entire workbook and all the filters in the worksheets and console.log them.  That filter field name is there and the filter value is valid.

               

              For all the gory details (code, server side error callstack, client side callstack and more): 00953897.