1 2 Previous Next 17 Replies Latest reply on Sep 12, 2018 11:37 AM by Mark Wu

    Tableau Prep Command Line Extract Refresh to Server

    Praveen Ettam

      Hello,

       

      I am looking at this help link and I am using windows

      https://onlinehelp.tableau.com/current/prep/en-us/help.html#prep_save_share.html#Syntax

       

      I am writing the command line on the server installed system.

      1. I have Flow file

      2. I have SQL Server Connection information and Server login information (inputConnections and outputConnections) as json file

       

      The command line

       

      "\Program Files\Tableau\Tableau Prep 2018.2\scripts"\tableau-prep-cli.bat  -c "\C:\Users\<myuser>\Desktop\Tableau\salesflow.json" -t "\C:\Users\<myuser>\Desktop\Tableau\Flows\Accounting.tfl"

       

      But I get this error, am I doing anything wrong?

       

       

      any help here?

        • 1. Re: Tableau Prep Command Line Extract Refresh to Server
          Joshua Milligan

          Praveen,

           

          It looks like there's an issue with the connections file.  Is it possible the file is locked or the JSON isn't formed correctly?

           

          Best Regards,

          Joshua

          • 2. Re: Tableau Prep Command Line Extract Refresh to Server
            Paulo Dantas

            Hello Praveen,

             

            is the json file opened?

             

            The user has permission on the folder?

             

            Cheers.

            • 3. Re: Tableau Prep Command Line Extract Refresh to Server
              Praveen Ettam

              Yes the json file has access to the user,

              user is abcd, and this user has access to SQL Server and this system as Admin.  I am running the CML as admin.  I am hoping the MS SQL Server  port is 1433, contentURL is the name of the Project am I correct?

               

              {

              "inputConnections":[

                {

                  "username": "abcd",

                  "hostname":"MSSQLSRV",

                  "port":1433,

                  "password": "XXXXX"

                }

              ],

              "outputConnections":[

                {

                  "serverURL":"http://tableau.XXXXXX",

                  "contentURL":"Default",

                  "username":"abcd",

                  "password":"XXXXXX"

                }

              ]

              }

              • 4. Re: Tableau Prep Command Line Extract Refresh to Server
                Sean Bleything

                Hello-

                 

                I am getting that same error message.  I am connecting to a postgres db, which has one additional field it calls for ("database").  I tried using the exact format provided in the Tableau online help file, and also tried one where I added a line for "database".  No luck here.  Screenshot attached of Command Line error, and below that is the Tableau Prep log file error readout, and then json file (real info x'ed out obvi).  Would love to know if others have successfully made this work (looking in your general direction Joshua Milligan  - Tableau Prep wizard ) and if so, ever with postgres.  Thanks!

                 

                [2018-08-17 15:08:32,195]        4    [main] p: DEBUG com.tableau.tprep.cli.app.utils.ArgParser - com.fasterxml.jackson.databind.JsonMappingException: Unexpected character (']' (code 93)): expected a value

                at [Source: (FileInputStream); line: 10, column: 2]

                at [Source: (FileInputStream); line: 10, column: 1] (through reference chain: com.tableau.tprep.cli.app.connections.ConnectionInfo["inputConnections"]->java.lang.Object[][1])

                 

                • 5. Re: Tableau Prep Command Line Extract Refresh to Server
                  Praveen Ettam

                  Here is the resolution for this error

                  In JSON file make the following changes

                  "serverURL" and "contentURL", should be "serverUrl" and "contentUrl".

                   

                  Tableau team updated the documentation with these corrections.  But I still have other issue connecting to on premises SQL Server DB.  I will update you if I hear anything back from Tableau support team.

                   

                  Thanks

                  • 6. Re: Tableau Prep Command Line Extract Refresh to Server
                    Sean Bleything

                    Good update Praveen-

                     

                    I am also still having trouble, and I think it is related to it being a postgres db, which requires a "database" field when setting up the connection in Prep, but is not specified in the JSON file.  I did try to include it, but received and error saying the "database" was an unsupported field name.

                     

                    Sean

                    • 7. Re: Tableau Prep Command Line Extract Refresh to Server
                      Maraki Ketema

                      Hi Praveen,

                       

                      Thanks for reaching out and sorry to see that you're running into these errors. I have a feeling you might not actually be hitting a specific port with your connection. Could you delete the that line and give it a try? Additionally, since you'r publishing to a default site, you don't need to specify a contentUrl Here is how your JSON would look:

                       

                      {

                      "inputConnections":[

                        {

                          "username": "abcd",

                          "hostname":"MSSQLSRV",

                          "password": "XXXXX"

                        }

                      ],

                      "outputConnections":[

                        {

                          "serverUrl":"http://tableau.XXXXXX",

                          "contentUrl":"Default",

                          "username":"abcd",

                          "password":"XXXXXX"

                        }

                      ]

                      }

                       

                      Let us know if this works for you!

                       

                      Thanks,

                      Maraki

                      • 8. Re: Tableau Prep Command Line Extract Refresh to Server
                        Maraki Ketema

                        Hi Sean,

                         

                        Sorry to hear that you're running into issues as well. We don't give you the ability to specify a database in your JSON today. We will instead look at which database is specified by the flow and run the flow against the table from that database. Your JSON should look something like this for your inputConnection:

                         

                        "inputConnections":[

                             {

                                 "username":"test",

                                 "hostname":"postgres.test",

                                 "port":"0000",

                                 "password":"test"

                             }

                        ],

                         

                        Hope this helps, but let me know if you're still hitting issues!

                         

                        Thanks,

                        Maraki

                        • 9. Re: Tableau Prep Command Line Extract Refresh to Server
                          Praveen Ettam

                          I am able to fix the issue now.  Thank you for your help.

                           

                          1. I removed the Port from JSON file

                          2. I removed contentUrl as well.

                           

                          One final question,  can I publish as Extract instead of Live?

                          • 10. Re: Tableau Prep Command Line Extract Refresh to Server
                            Mark Wu

                            I love this feature. I am very excited as I am able to make it work on my Mac. Quick tips:

                            1. Remove the Port from JSON file is Ok if the data source does not use Port
                            2. My "outputConnections" is as followings:
                            3. I used  "contentUrl":"", for default site.
                            4. Another tip is that the username and password is NOT your SSO user/password but your local user/password on Tableau server - I guess that all API calls use local user/password.

                             

                             

                            "outputConnections":[

                              {

                                "serverUrl":"https://xxxx.xxxxx.com",

                                "contentUrl":"",

                                "username":"markwu",

                                "password":"password123"

                              }

                            ]

                             

                            Help needed - how to get rid of the Mac admin user/password so the workflow can be fully automated. Now it pops-up every time when I run the flow from Command Line.

                             

                            Pls help!!!

                             

                            screenshot_3564.png

                            • 11. Re: Tableau Prep Command Line Extract Refresh to Server
                              Sean Bleything

                              Thanks for the additional info Mark.  I am slowly making progress debugging my problem.  If I save the flow to Defalut, and leave contentUrl blank ("contentUrl":"") in the JSON file, I do get it to work.  I have not yet made saving to a specific site work.  I have tried using my username/password (I'm the Server Admin), our Run As credentials, both no luck.  I've tried capitalizing the site name (as it appears in the drop down box when logging into server) and lower case (as it appears in the actual url).  Also tried adding "/" before and after site name to see if that changes anything.

                               

                              Any other ideas?

                               

                              Thanks

                              Sean

                              • 12. Re: Tableau Prep Command Line Extract Refresh to Server
                                Mark Wu

                                What is the error? Likely it is your username/password - if you publish to Default site and use my syntax for the site. Pls make sure to use username not display name, you can also reset your password on server to make sure password is correct.

                                 

                                Sent from my iPhone

                                • 13. Re: Tableau Prep Command Line Extract Refresh to Server
                                  Shuyu Xu

                                  Hi Mark,

                                   

                                  The terminal runs Command Line needs to be in admin mode. There is also another possibility that your keychain password (set automatically when your user account was created on your computer) and your default keychain (usually "login") are no longer in-sync. Please try to reset your keychain using following steps:

                                  1. Open Keychain Access, which is in the Utilities folder within the Applications folder.
                                  2. From the Keychain Access menu, choose Preferences.
                                  3. Click General, then click Reset My Default Keychain.
                                  4. Authenticate with your account login password.
                                  5. Quit Keychain Access.
                                  6. Restart your computer.
                                  • 14. Re: Tableau Prep Command Line Extract Refresh to Server
                                    Mark Wu

                                    Tried Reset My Default Keychain and re-started Mac, still the same.

                                     

                                    Tried sudo /Applications/Tableau\ Prep.app/Contents/scripts/./tableau-prep-cli -c credentials-tableau-users.json -t PostgreUserInfor.tfl. Still pop up asking my Mac admin users/password.

                                     

                                    The user used is part of admin and wheel group.

                                    1 2 Previous Next