2 Replies Latest reply on Apr 15, 2016 8:38 AM by Jason Scarlett

    parallel tabcmd sessions

    Jason Scarlett

      I'm looking for someone to shed some light on the limitations of using tabcmd to run multiple sessions in parallel.

      Is it possible to run parallel tabcmd session with a single user account ... or multiple user accounts?

       

      It seems from my testing that using a single user causes all prior sessions to expire and fail to continue running.

      It seems from my testing that using multiple users also causes all prior sessions (even running with another login account) to expire and fail to continue running.

      Below is a detailed example.

       

      My only possible solution (still to be tested) is to append the login information to every tabcmd command issued.

       

       

       

      Detailed Example

      We have two schedules.

      • Schedule #1 at 7am and generates 3 emails (each email uses tabcmd twice to get the png and pdf files).
      • Schedule #2 to run every 15 minutes starting at 1 minute past the quarter hour. It generate a single png (takes 10 seconds)

       

      In both cases, I use "tabcmd login -s ..." first and then use subsequent tabcmd commands to get the files. This meant that the subsequent tabcmd's were "Continuing previous sessions" each time the next file was requested. So for each schedule the tabcmd's executed look like this:

      1. Schedule #1
        • (starts at 7:00:00am)
        • tabcmd login
        • tabcmd get png for email 1
        • tabcmd get pdf for email 1
        • tabcmd get png for email 2 -- fails somewhere around here depending on the time Schedule #2 starts
        • tabcmd get pdf for email 2
        • tabcmd get png for email 3
        • tabcmd get pdf for email 3
        • tabcmd logout
        • (finish at 7:05:00am)
      2. Schedule #2
        • (starts at 7:01:00am) -- one minute after the one above
        • tabcmd login
        • tabcmd get png
        • tabcmd logout
        • (finish at 7:01:10am)

       

      Initially I was using the same account for tabcmd to run both using windows task scheduler.

      ... BUT ... I discovered that schedule #2 would cause the session started in schedule #1 to expire, causing scheudle #1 to attempt to create a new session using the initial account ... but this failed with the message "*** Tabcmd was run from a script or IDE but no password was provided. A password must be provided as an argument to tabcmd in order to log in."

       

      I then tried the same thing using two account different accounts fore each schedule, but again the initial schedule failed .. and curiously when the initial session tried to create a new session, it attempted to use the SECOND login name to do so!

       

      Maybe DOS is overwriting the variables from the credentials file?

      :: check for credentials file
      set CredentialsFile=_TableauServerCredentials.bat
      if not exist %CredentialsFile% echo %CredentialsFile% file not found & goto :eof
      echo ..... Reading credentials file .....
      echo.
      call %CredentialsFile%
      if "%TableauServer%"==""   echo TableauServer variable not set & goto :eof
      if "%TableauUser%"==""     echo TableauUser variable not set & goto :eof
      if "%TableauPassword%"=="" echo TableauPassword variable not set & goto :eof

       

       

      :: login to server
      if %nologin%==0 %tabcmdPATH%tabcmd login -s %TableauServer% -u %TableauUser% -p %TableauPassword% --no-certcheck
        • 1. Re: parallel tabcmd sessions
          Jeff Strauss

          I have an answer for this as we previously ran into this situation.  The underlying problem has to do with "clobbering" of session info (cookie) that is stored under the running user.

           

          Here are two solutions, we use a mix of both...

           

          Solution 1: Run with --no-cookie.  With this option, you cannot do a tabcmd login, but rather each independent command has to specify --server xxx --user yyy --password zzz.  The downside of this is that the session will stay active if you look at the admin reports within Tableau Server.  I don't think it really hurts anything though as long as the sessions aren't doing anything.  They take a very small bandwidth and will expire I think the default is 240 minutes. 

          tabcmd Global Options

           

           

          Solution 2: Login with different service accounts.  We run our tabcmd scripts via Task scheduler and within here, you can specify the running user.  So we have a few SVC accounts (i.e. DTM_Tableau_SVC1, DTM_Tableau_SVC2, DTM_Tableau_SVC3) so that when the session info is stored, it's stored under this windows profile.  And these SVC accounts need to be defined with Tableau Server too.

          1 of 1 people found this helpful
          • 2. Re: parallel tabcmd sessions
            Jason Scarlett

            Awesome.

            Love it.

            Thrilled.

            Solution 2 sounds great.

            You just made my day and weekend.

            Cheers!