11 Replies Latest reply on May 7, 2018 12:47 PM by Pavan Vemuri

    Dev Server Error runNow extract refresh task

    Jake Konovsky

      curl "https://tableau-dev.drwholdings.com/api/2.6/sites/944e0c91-3b96-4809-9323-bccd3de86c70/tasks/extractRefreshes/1f2bb392-c01e-467f-b906-2fa984cd5623/runNow" -X POST -H X-Tableau-Auth:myauthkeypart1|myauthkey2part2

       

      I am trying to test the latest and greatest runNow command for the REST API on our development server (v10.3) but the authorization key that I get back after signing in to the server has a special character in the middle of it. So when I post the above i get....

       

        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                       Dload  Upload   Total   Spent    Left  Speed

        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0myauthkeypart2: command not found

      100   363    0   363    0     0    839      0 --:--:-- --:--:-- --:--:--   840

       

      When I try to put the the authorization portion in quotes (double quotes, single quotes, combination of both) I get a response that says unauthorized access. Authorization keys on our production server do include a special character for whatever reason so I'm fairly certain this post request will work in production, but obviously want to test this before. Any ideas as to a fix?

       

      I have also tried the same runNow command using the tableauserverclient in python. Does not work either. I am a Tableau serve admin and I created the task I am trying to run so I know I'm authorized to run the task from the REST API.

       

      Also the REST API doc has an example for the runNow command that says to make a GET request not POST. That is most likely an error?

       

      Thanks for the help!

        • 1. Re: Dev Server Error runNow extract refresh task
          Patrick A Van Der Hyde

          Jake - do you have a link - reference for the GET? 

           

          I'm checking in with others on the Rest API auth question. 

           

          Patrick 

          • 2. Re: Dev Server Error runNow extract refresh task
            Hugh Nguyen

            Hey Jake,

             

            I was looking at this with Patrick. I didn't have issues with the extra character. So I was wondering if you would try this syntax and let us know how it went:

             

            curl -X POST \

              http://<server>/api/2.6/sites/d0356794-bb9d-4c5c-b43d-ec384a2baf5a/tasks/extractRefreshes/47fcefd8-92ce-4024-b961-90e542fedef4/runNow \

              -H 'cache-control: no-cache' \

              -H 'x-tableau-auth: -EencpfrTtSIPgobwNP__w|wHhpBVpxU5LrIIUy4U2EqdpgcO7IkJcL' \

              -d '<tsRequest>

            </tsRequest>'

             

            Note: you need <tsRequest></tsRequest> in the request even if it's empty.

            • 3. Re: Dev Server Error runNow extract refresh task
              Jake Konovsky

              Hi Hugh,

               

              I'm getting a malformed json/xml error

               

              <?xml version='1.0' encoding='UTF-8'?><tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-2.6.xsd"><error code="400000"><summary>Bad Request</summary><detail>Payload is either malformed XML/JSON or incomplete</detail></error></tsResponse>

               

              Thanks,

              Jake

              • 4. Re: Dev Server Error runNow extract refresh task
                Jake Konovsky

                Either way using the tableauserverclient package in python I am able to get the response body that the documentation describes but the extract refresh task is returning an error "java.lang.NullPointerException"

                • 5. Re: Dev Server Error runNow extract refresh task
                  Hugh Nguyen

                  If you have a proper response body then I'd say the rest api is working. Are you seeing the error in the background tasks admin view and have you tried refreshing via the webui?

                  • 6. Re: Dev Server Error runNow extract refresh task
                    Jake Konovsky

                    I'm seeing the error in the BackgroundTasksforExtracts workbook on our tableau server under the status tab. Here is some more info from the log tables. Maybe we have an incorrect server setting? Or the task was created incorrectly?

                     

                     

                     

                     

                     

                    2017-06-16 15:19:16.504 -0500 (Finance,,,) pool-3-thread-1 : INFO  com.tableausoftware.core.service.DependentServiceChecker - Starting server dependency checks

                    2017-06-16 15:19:16.504 -0500 (,,,) scheduled-background-job-runner-1 : INFO com.tableausoftware.backgrounder.runner.BackgroundJobRunner - Running job of type :refresh_extracts; timeout: 9000; priority: 50; id: 1163877; args: [Datasource, 135, VW_DRWT_HEDGEBAL (JKONOVSKY), null, null, 4, 351]

                    2017-06-16 15:19:16.504 -0500 (Finance,,,) pool-3-thread-1 : INFO  com.tableausoftware.model.workgroup.workers.RefreshExtractsWorker - Retrieving secondary whitelist data for datasource id 135

                    2017-06-16 15:19:16.535 -0500 (,,,) scheduled-background-job-runner-1 : ERROR com.tableausoftware.backgrounder.runner.BackgroundJobRunner - Error executing backgroundjob: :refresh_extracts

                    1. java.util.concurrent.ExecutionException: java.lang.NullPointerException

                    at java.util.concurrent.FutureTask.report(FutureTask.java:122)

                    at java.util.concurrent.FutureTask.get(FutureTask.java:206)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner.executeNextJob_aroundBody6(BackgroundJobRunner.java:425)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner$AjcClosure7.run(BackgroundJobRunner.java:1)

                    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)

                    at com.tableausoftware.instrumentation.InstrumentedMethod.instrumentInvocation(InstrumentedMethod.java:66)

                    at com.tableausoftware.instrumentation.InstrumentationAspect.aroundAnnotatedMethod(InstrumentationAspect.java:57)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner.executeNextJob(BackgroundJobRunner.java:374)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner.executeJobs_aroundBody2(BackgroundJobRunner.java:311)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner$AjcClosure3.run(BackgroundJobRunner.java:1)

                    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)

                    at com.tableausoftware.instrumentation.InstrumentedMethod.instrumentInvocation(InstrumentedMethod.java:66)

                    at com.tableausoftware.instrumentation.InstrumentationAspect.aroundAnnotatedMethod(InstrumentationAspect.java:57)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner.executeJobs(BackgroundJobRunner.java:287)

                    at com.tableausoftware.backgrounder.config.BackgroundJobRunnerSchedulingConfig.lambda$scheduleTask$0(BackgroundJobRunnerSchedulingConfig.java:42)

                    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)

                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)

                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)

                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                    at java.lang.Thread.run(Thread.java:745)

                    Caused by: java.lang.NullPointerException

                    at com.tableausoftware.model.workgroup.service.VqlSessionService.refreshExtractsForDatasource(VqlSessionService.java:1012)

                    at com.tableausoftware.model.workgroup.workers.ExtractsWorker.refreshDatasource(ExtractsWorker.java:665)

                    at com.tableausoftware.model.workgroup.workers.ExtractsWorker.executeWithDataengine(ExtractsWorker.java:313)

                    at com.tableausoftware.model.workgroup.workers.RefreshExtractsWorker.executeWithDataengine_aroundBody0(RefreshExtractsWorker.java:88)

                    at com.tableausoftware.model.workgroup.workers.RefreshExtractsWorker$AjcClosure1.run(RefreshExtractsWorker.java:1)

                    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)

                    at com.tableausoftware.instrumentation.InstrumentedMethod.instrumentInvocation(InstrumentedMethod.java:66)

                    at com.tableausoftware.instrumentation.InstrumentationAspect.aroundAnnotatedMethod(InstrumentationAspect.java:57)

                    at com.tableausoftware.model.workgroup.workers.RefreshExtractsWorker.executeWithDataengine(RefreshExtractsWorker.java:88)

                    at com.tableausoftware.model.workgroup.workers.DataengineDependentWorker.execute(DataengineDependentWorker.java:63)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner$ExecuteJobImplCallable.call_aroundBody0(BackgroundJobRunner.java:544)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner$ExecuteJobImplCallable$AjcClosure1.run(BackgroundJobRunner.java:1)

                    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)

                    at com.tableausoftware.instrumentation.InstrumentedMethod.instrumentInvocation(InstrumentedMethod.java:66)

                    at com.tableausoftware.instrumentation.InstrumentationAspect.aroundAnnotatedMethod(InstrumentationAspect.java:57)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner$ExecuteJobImplCallable.call(BackgroundJobRunner.java:530)

                    at com.tableausoftware.backgrounder.runner.BackgroundJobRunner$ExecuteJobImplCallable.call(BackgroundJobRunner.java:515)

                    at java.util.concurrent.FutureTask.run(FutureTask.java:266)

                    ... 3 more

                    • 7. Re: Dev Server Error runNow extract refresh task
                      Krzysztof Płatek

                      This works for me:

                      curl 'https://server/api/2.6/sites/825da784-b8b8-424f-bfb3-16daec67f09c/tasks/extractRefreshes/a8e9f35b-cbee-4d4a-9856-a34d5c53ace2/runNow' -X POST -H "Content-Type: text/xml" -H 'X-Tableau-Auth:Ru_EfyYzRwa2mGHIvDz8xQ|RwZOjT2WANA12YkNnc3e1GYnHAcBRZF8' -d '<tsRequest></tsRequest>'

                      The Content-Type header was missed in the example above.

                      3 of 3 people found this helpful
                      • 8. Re: Dev Server Error runNow extract refresh task
                        Fabio Zioli

                        Hi every body, thanks to KRZYSZTOF PŁATEK , that worked great.

                        I would like to add a question here since they are related between them. Well, I have posted agaisnt the end point /runNow and Ive got a backgound refresh task on our Tableau server...but...with a priority set as 50...in other words, the refresh process was called off because it reached the Longest allowable time, in seconds, for completing a single extract refresh. =(

                         

                        Someone here know how to set a better priority for the refresh called through the end point /runNow? Is there a solution? Some environment configuration?

                         

                        Thanks, I appreciate.

                         

                         

                         

                        • 9. Re: Dev Server Error runNow extract refresh task
                          Lee Graber

                          Hi Fabio,

                            I am not sure if you got your answer yet or now. The priority is set on the task itself. The api is simply running the task. If you want to change the priority, you can change it on the task. I hope you have gotten your issue resolved. Sorry for the delay.

                           

                          Thanks
                          Lee

                          • 10. Re: Dev Server Error runNow extract refresh task
                            Lee Graber

                            Hi Jake,

                               Did you ever get past this. There should be nothing you can do that would cause a null pointer exception. I hope you have managed to get past this by now.

                             

                            Thanks

                            Lee

                            • 11. Re: Dev Server Error runNow extract refresh task
                              Pavan Vemuri

                              This is useful! This has worked for me. Make sure -H "Content-Type: text/xml" is added.