1 2 Previous Next 17 Replies Latest reply on Aug 21, 2018 9:13 PM by Edgar Leung

    No Valid Session Found error on Tabcmd?

    James Golden

      Hi folks,

       

      Interesting and frustrating issue here:

      This issue has been persisting for many months now, and is resulting in misleading error notifications displaying "no valid session found".

       

      This stems from a third party, universal scheduler tool (ActiveBatch) that is passing multiple tabcmd refreshextract commands (triggered from DW batch job completions), from that machine, to tableau server, using the tabcmd utility.

       

      Important to note, running the tabcmd job WITHOUT --synchronous, submits the job to the server, where that takes over, and dumps it into pending or one of the backgrounders.  With --synchronous, the job is waiting for completion, and this seems to be where a session is lost, or some type of communication breakdown, even though truly submits on tableau server.

       

      The command is similar to the one as follows (we have tried many iterations):

       

      tabcmd refreshextracts -s http://gcctableau.gct.com --synchronous --project "${Tableau_Project}" --datasource "${Tableau_job_name}" --timeout ${Tableau_timeout} -u tableau -p XXXXXXX

       

      The misleading errors appear typically appear more frequent when all the backgrounders are used, and the pending queue is backed up.

       

      We have a two machine configuration, set for high extracts, with the one worker handling all backgrounders (4). Each machine is 32GB memory, 8 core, plenty of disc.

       

      The error seems to indicate the session is not available, not authorized, possible expiring?

       

      Here is an example:

       

      C:\Users\abprod\AppData\Local\Temp>tabcmd refreshextracts -s http://gcctableau.gct.com -u tableau -p XXXXXXX --synchronous --project "Renewal and File" --workbook "2016 Renewal Performance (Interim)" --timeout 3600 ===== Continuing previous session===== Server: http://gcctableau.gct.com===== Username: tableau===== Scheduling extracts for workbook 'Renewal and File/2016 Renewal Performance (Interim)' to be refreshed now...

      *** Not authorized

      No valid session found. (errorCode=46)

       

       

      The job seems to go into pending and eventually complete, but it is returning the above, noted error of no valid session.

       

      Has anyone experienced this sort of issue before, or tried to run numerous tabcmd jobs at one time?  Some jobs complete as expected, but others end in this error, even though the actual command is still executed on Tableau server, and eventually finishes normally.

       

      Thanks for looking!

       

      Jamie

        • 1. Re: No Valid Session Found error on Tabcmd?
          Jeff Strauss

          hi Jamie.  Are you running cookieless (with --no-cookie) or with cookies?  The reason why I ask is I believe the default is to use cookies which stores the session info within your runas user appdata folder.  And if you have multiple tabcmd jobs running under the same runas userid, then the cookies could get "clobbered".  I found this happening a while back when I would run a tabcmd login for job1, do the refresh and whatever other activity, then job2 gets kicked off with the same info, then job1 does a tabcmd logout which "clobbers" the session info stored in the cookie and job2 ends premature.  Could this be happening in your case too?

          2 of 2 people found this helpful
          • 2. Re: No Valid Session Found error on Tabcmd?
            James Golden

            Hi Jeff,

             

            I tried that with one iteration, running --no-cookie, but not with my single command.  I'll try that again.  what you say makes sense, although flooding the server with multiple tabcmd jobs doesn't - Are you a tableau associate?  I have a ticket to see what support can provide.

            • 3. Re: No Valid Session Found error on Tabcmd?
              Jeff Strauss

              I'm not a Tableau associate, but I do contribute a bit to the forums based on my experiences of working with the product.

              • 4. Re: No Valid Session Found error on Tabcmd?
                James Golden

                I wasn't sure, but I appreciate your knowledge.  Thanks for the suggestion!

                • 5. Re: No Valid Session Found error on Tabcmd?
                  James Golden

                  I kicked off 10 DS and WKBKs and 1 still returned the No Valid Session error.

                   

                  Do you know if there is a limit for Sessions/buckets?

                  • 6. Re: No Valid Session Found error on Tabcmd?
                    Jeff Strauss

                    I do not know if there's a limit, but I somehow doubt it.  Are you running with cookies?  you can have a look within the runas user account directory : C:\Users\runas user account\AppData\Local\Tableau\Tabcmd to see what's happening with the cookies and see if they are wiped out.  are you doing any tabcmd logout?

                    • 7. Re: No Valid Session Found error on Tabcmd?
                      James Golden

                      Actually, I added --no-cookie to my scripts, prior to this last go around.  I had a tabcmd logout in my activebatch window - but what that did was, in some cases, return the "no valid session" error for the tabcmd --synchronous refreshextract, but still complete the tabcmd logout, which presents the illusion that the job was successful.  In reality, the job is actually running or pending on tableau server; so I'm not sure why it even returns the no valid session error.  I read somewhere about token authentication, and some short window of time if no activity?  Does that sound familiar?

                       

                      One thing I see on both failed and successful notifications, it looks liek the command is executed from C:\Users\abprod\AppData\Local\Temp>

                       

                      The command utility is here:

                      c:\Program Files\Tableau\Tableau Server\extras\Command Line Utility Activity

                       

                       

                      The error is preceded by *** Not authorized

                       

                      For example:

                       

                      C:\Users\abprod\AppData\Local\Temp>tabcmd refreshextracts -s http://gcctableau.gct.com -u tableau -p xxxxxxx --synchronous --project "Sales" --datasource "Sales and Plan by Week Extract 2" --timeout 3600 --no-cookie

                      ===== Continuing previous session
                      =====     Server:   http://gcctableau.gct.com
                      =====     Username: tableau
                      ===== Scheduling extracts for datasource 'Sales/Sales and Plan by Week Extract 2' to be refreshed now...
                        *** Not authorized
                      No valid session found. (errorCode=46)
                      • 8. Re: No Valid Session Found error on Tabcmd?
                        Jeff Strauss

                        Here's what I do:

                         

                        1. I don't run my stuff asynchronous, but rather the refreshextract runs on the server with a backgrounder and I have the script poll the status of the background task (via a loop) to ensure success and if it's not successful, then it emails an error.

                         

                        2. When running with cookies, I never let the streams cross.  In other words, I use different runas userid's if the script is running at the same time.

                         

                        3. It does sound familiar about the short period of being idle.  I overcome this by always specifying the password and timeout on every request even though it's part of the login command.  See this example.  It doesn't make total sense of why I should have to do this, but it has worked for me and has worked for others that I've advised on it too.

                         

                        tabcmd refreshextracts --datasource "xxx" --project yyy --password %TABLEAU_USER_PASSWORD% --timeout 1800

                        2 of 2 people found this helpful
                        • 9. Re: No Valid Session Found error on Tabcmd?
                          James Golden

                          Update from support - Obviously, this is somewhat uncharted waters.  However, support recommends general running serially.  While this doesn't work for our initiative, it also appears that the commands are more susceptible to overwriting the sessions, overlapping, etc... when using --synchronous.  Unfortunately, as much as I hoped against this, this is actually what I thought the answer may be.

                           

                          This appears to be a good subject to submit as a form of enhancement, which I'll consider.

                           

                          Also, I discussed the --no-cookie tag, which I was told could perhaps help; but could not eliminate the issue under multiple instances of tabcmd running parallel.

                           

                          I'm going to try to remove the --synchronous tag and monitor the results.

                           

                          Thanks for all your help!

                          • 10. Re: No Valid Session Found error on Tabcmd?
                            James Golden

                            If you don't mind sharing, I'd like to know how you "have the script poll the status of the background task (via a loop) to ensure success and if it's not successful, then it emails an error."?

                             

                            That sounds like a positive solution for at least the success or failure.

                             

                            Thanks

                            • 11. Re: No Valid Session Found error on Tabcmd?
                              Jeff Strauss

                              We run the script within cygwin (so that our DW scheduler that runs on linux) can communicate with Tableau.  In other words it's bash scripting, but it could be done with powershell or python or any language for that matter.  see attached.

                              1 of 1 people found this helpful
                              • 12. Re: No Valid Session Found error on Tabcmd?
                                James Golden

                                Thanks for all your feedback - good stuff!

                                • 13. Re: No Valid Session Found error on Tabcmd?
                                  Ray Williams

                                  I know this thread is rather stale, but we are having the same struggles. Could it be that your scheduler is initiating a second session with the same credentials in order to kick off a different refresh while the first synchronous session is still in process? I'm thinking Tableau Server may only be allowing a single TABCMD session for a given user. The subsequent login may be terminating the prior connection.

                                  • 14. Re: No Valid Session Found error on Tabcmd?
                                    Jeff Strauss

                                    kinda.  When the first session is created, a token is stored within the user's profile tabcmd folder from where-ever tabcmd is initiated.  And then if a second session is created while the first one is running, then results are somewhat unpredictable based on timing of when the first finishes and the second starts.  In any case, there's two ways around this dilemma, one is to try using --no-cookie as part of tabcmd, the other is to use an alternate id.

                                    1 of 1 people found this helpful
                                    1 2 Previous Next