6 Replies Latest reply on Sep 11, 2018 12:04 AM by ArseneXie

    command-line prep fails with MSSQL input which hostname includes backslash

    ArseneXie

      Hi,

       

      We have 3 kinds of flow, and we try to refresh the flow by using prep command-line.

       

      1. [Case1]: Input: Local Files, Output: Local Files

       

         > tableau-prep-cli.bat -t "D:\theFlowFile.tfl"

       

      2. [Case2]: Input: Local Files, Output: Tableau Server(Default)

       

         > tableau-prep-cli.bat -c "D:\credentials.json" -t "D:\theFlowFile.tfl"

       

         where the credentials.json is:

      credentials.json

      {

         "inputConnections":[

         ],

         "outputConnections":[

         {

         "serverUrl":"http://serverip",

         "contentUrl":"",

         "username":"adminacct",

         "password":"adminpasswd"

         }

         ]

      }

        

       

      3. [Case3]: Input: MSSQL, Output: Tableau Server(Default)

       

         > tableau-prep-cli.bat -c "D:\credentials.json" -t "D:\theFlowFile.tfl"

       

         where the credentials.json is:

      credentials.json

        {

         "inputConnections":[

         {

         "username":"username",

         "hostname":"AAA\\BBB",

         "password":"password"

         }

         ],

         "outputConnections":[

         {

         "serverUrl":"http://serverip",

         "contentUrl":"",

         "username":"adminacct",

         "password":"adminpasswd"

         }

         ]

         }

       

      The CLI works fine for the first 2 cases.

      But it fails in the case3.

       

      It shows the error messages as below:

       

        JAVA_HOME is set to : C:\Program Files\Tableau\Tableau Prep 2018.2\scripts\..\Plugins\jre temporarily

        Preparing to run the flow : D:\theFlowfile.tfl

        Loading the flow.

        Loaded the flow.

        Exception in thread "main" java.lang.AssertionError: Could not find match for SERV\INST

         at com.tableau.tprep.cli.app.connections.utils.RemoteInputConnectionsUtils.findMatchingConnectionInfo(RemoteInputConnectionsUtils.java:110)

         at com.tableau.tprep.cli.app.connections.utils.RemoteInputConnectionsUtils.addPasswordToConnectionAttributes(RemoteInputConnectionsUtils.java:119)

         at com.tableau.tprep.cli.app.connections.utils.RemoteInputConnectionsUtils.updateRemoteConnectionAttributes(RemoteInputConnectionsUtils.java:93)

         at com.tableau.tprep.cli.app.connections.utils.RemoteInputConnectionsUtils.updateConnections(RemoteInputConnectionsUtils.java:80)

         at com.tableau.tprep.cli.app.rest.RestApiFlowHandler.updateConnectionAttributes(RestApiFlowHandler.java:136)

         at com.tableau.tprep.cli.app.CommandLineRunOrchestrator.triggerRun(CommandLineRunOrchestrator.java:57)

         at com.tableau.tprep.cli.app.CliMain.main(CliMain.java:74)

       

       

        The hostname of the MSSQL Server is "SERV\INST". (single backslash)

       

       

        If I put it into credentials.json as :

      credentials.json  (the same as the hostname, single backslash)

      {

         "inputConnections":[

         {

         "username":"username",

         "hostname":"SERV\INST",

         "password":"password"

         }

         ],

         "outputConnections":[

         {

         "serverUrl":"http://serverip",

         "contentUrl":"",

         "username":"adminacct",

         "password":"adminpasswd"

         }

         ]

         }

       

       

      The CLI fails and shows the message :"Unable to read the connections file.".

      Because that the \ is the control character of json, and it should be put as \\ in json file for CLI to read it.

       

      And then it shows the error that it could not find match for SERV\INST.

      I guess that if the CLI find the matching between flow-input and json-file using "SERV\INST" and "SERV\\INST"??

       

      Or there are something wrong in the credentials.json file for the MSSQL input?

       

      Arsene

        • 1. Re: command-line prep fails with MSSQL input which hostname includes backslash
          ArseneXie

          Hi all,

           

          I have created a support case for the issue.

          Hope it will be solved soon.

           

          My workaround to auto-refresh the prep flows now is to control mouse and keyboard with pyautogui, and it's not a perfect solution due to some RDP issues.

           

          Arsene

          • 2. Re: command-line prep fails with MSSQL input which hostname includes backslash
            Srikanth Polumuri

            I am also facing exactly same issue, following your case and will create another ticket for the same.

            1 of 1 people found this helpful
            • 3. Re: command-line prep fails with MSSQL input which hostname includes backslash
              ArseneXie

              Hi All,

               

              The Prep 2018.2.3 is released.

               

              After upgrading my prep, this issue still exists.

              And the error messages and  the log messages are changed.

               

               

              [2018-09-07 11:11:16,305] 13739 [main] p: INFO com.tableau.tprep.cli.app.rest.RestApiFlowHandler - Loaded the flow.

              [2018-09-07 11:11:16,321] 13755 [main] p: ERROR com.tableau.tprep.cli.app.CliMain - Could not find match for DBCLR2\PRDINS2

              [2018-09-07 11:11:16,347] 13781 [main] p: DEBUG com.tableau.tprep.cli.app.CliMain - com.tableau.tprep.cli.app.exceptions.MissingInputConnectionCredentialsException: Could not find match for DBCLR2\PRDINS2

                at com.tableau.tprep.cli.app.connections.utils.RemoteInputConnectionsUtils.findMatchingConnectionInfo(RemoteInputConnectionsUtils.java:109)

                at com.tableau.tprep.cli.app.connections.utils.RemoteInputConnectionsUtils.addPasswordToConnectionAttributes(RemoteInputConnectionsUtils.java:118)

                at com.tableau.tprep.cli.app.connections.utils.RemoteInputConnectionsUtils.updateRemoteConnectionAttributes(RemoteInputConnectionsUtils.java:93)

                at com.tableau.tprep.cli.app.connections.utils.RemoteInputConnectionsUtils.updateConnections(RemoteInputConnectionsUtils.java:80)

                at com.tableau.tprep.cli.app.rest.RestApiFlowHandler.updateConnectionAttributes(RestApiFlowHandler.java:136)

                at com.tableau.tprep.cli.app.CommandLineRunOrchestrator.triggerRun(CommandLineRunOrchestrator.java:57)

                at com.tableau.tprep.cli.app.CliMain.main(CliMain.java:74)

              • 4. Re: command-line prep fails with MSSQL input which hostname includes backslash
                Fabio Bacellar

                Hi, everyone,

                 

                I had the same problem, and solved it by using \\ in the json file.

                 

                  {

                    "username": "sap.connect",

                    "hostname":"SERVERSQL04\\DW_SAP",

                    "password": "MyPasswordHere"

                  },

                1 of 1 people found this helpful
                • 5. Re: command-line prep fails with MSSQL input which hostname includes backslash
                  ArseneXie

                  Hi Fabio,

                   

                  Thank you.

                   

                  I have created the json file using \\ (double backslash), and it still shows "Could not find match for DBCLR2\PRDINS2". 

                  I don't know why, maybe there are some custom SQL inputs in the flow, and it causes the issue.

                   

                  I will try to create a test flow with simple input and check if the command-line worked.

                   

                   

                  Arsene

                  1 of 1 people found this helpful
                  • 6. Re: command-line prep fails with MSSQL input which hostname includes backslash
                    ArseneXie

                    Hi All,

                     

                    Finally, my issue is solved.

                    But I still don't know what causes the issue.

                     

                    What I did is as below:

                    1. upgrade to 2018.2.3

                    2. Check other flows with the same MS SQL Server input, they worked fine.

                        So the json file is probably not the key clue.

                    3. Create a simple flow (only input, a step to filter, and then output as a local file)

                        with the same custom sql input,

                        and check if the command line worked.

                        ==> It worked fine.

                    4. Step and step, create additional steps from the original flow into this new flow, and check  if the command line worked.

                       ==> it worked fine.

                    5. Finally, I recreated a new flow which is the same as the original one, and it worked fine with command line.

                     

                    !!??

                     

                    It seems that there are some unknown hidden issues in the original flow, which only affect the behavior of command-line.

                    And then re-create the flow solved this issue.

                     

                     

                    Arsene