12 Replies Latest reply on Mar 7, 2017 6:48 AM by Matt Coles

    [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)

    alice.valentin

      Just started to work with VizAlerts 1.1.1 reviewing the history.txt file.  I've updated the VizAlerts.yaml file with several of the settings indicated in the Tableau = VizAlerts Installation Guide beginning on page 16.

      With various changes to VizAlerts.yaml, I'm still getting the following when executing python vizalerts.py (via vizalerts.log_2017-03-01 in the logs folder):

       

       

      2017-03-01 13:39:13 - [INFO] - LoggerQuickSetup - Logging
      initialized, writing to .\logs\vizalerts.log_2017-03-01.log

      2017-03-01 13:39:13 - [DEBUG] - trusted_ticket_test -testing trusted ticket: tdcmstabd, SvcTableau, None

      2017-03-01 13:39:13 - [DEBUG] - get_trusted_ticket -Generating trusted ticket. Request details: Server: tdcmstabd, Site: ,Username: SvcTableau, Url: http://tdcmstabd/trusted, Postdata:username=SvcTableau.

      2017-03-01 13:39:13 - [ERROR] - get_trusted_ticket -HTTPError generating trusted ticket: Not Found Request details: Server: tdcmstabd, Site: , Username: SvcTableau, Url:http://tdcmstabd/trusted, Postdata: username=SvcTableau.

      2017-03-01 13:39:13 - [ERROR] - trusted_ticket_test -HTTPError generating trusted ticket: Not Found Request details: Server: tdcmstabd, Site: , Username: SvcTableau, Url:http://tdcmstabd/trusted, Postdata: username=SvcTableau.

       

       

       

      The vizalerts.py has the following code: 

       

      def trusted_ticket_test():
          """Test ability to generate a trusted ticket from Tableau Server"""
          # test for ability to generate a trusted ticket with the general username provided
          if configs["trusted.useclientip"]:
              clientip = configs["trusted.clientip"]
          else:
              clientip = None

          logger.debug(u'testing trusted ticket: {}, {}, {}'.format(configs["server"], configs["server.user"], clientip))
          sitename = ''    # this is just a test, use the default site
          test_ticket = None
          try:
              test_ticket = tabhttp.get_trusted_ticket(configs["server"], sitename, configs["server.user"], configs["server.ssl"], logger, configs["server.certcheck"], None, clientip)
              logger.debug(u'Generated test trusted ticket. Value is: {}'.format(test_ticket))

       

       

      From the above vizalerts.log_2017-0301, which part is incorrect?        From my view, the server is correct.    The http://tcdmstabd/trusted, doesn't exist and is the goal of the vizalerts.py to make this?

      Is the username incorrect as it displayed in the Postdata information?   

       

      Also, what entries are a must to be filled in the vizalerts.yaml?

        • 1. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
          Matt Coles

          So first off, we're on version 2.0.1 right now, so unless there's a reason you really, really want to stick with v1.1.1, please use 2.0.1! It's much better!

           

          In addition to the reply I posted on your other thread (below), ERROR] - trusted_ticket_test - HTTPError generating trusted ticket: Not Found Request details, I'd also recommend using the fully qualified server name, including the domain. So server: tdcmstabd.mydomain.com , or whatever it should be.

           

           

          "HTTPError generating trusted ticket: Not Found" means that VizAlerts cannot even talk to your Tableau Server instance. It's a little misleading that the trusted ticket test is what fails, because it isn't really an issue with the ticket itself, but a more basic problem of utterly failing before it even got the chance to ask for one.

           

          So, check your config\vizalerts.yaml file, specifically the server and server.ssl settings. Does your server use SSL? If not, and you're yaml says you are, then it will fail. Does your server require SSL? If so, and your yaml file says false, then it will fail. Make sure you can connect to the server from the machine your trying to run VizAlerts on too, just to rule out any firewall issues or other connectivity issues.

           

          Note that once you solve this issue, others typically find other problems in their config, so you might check out these threads:

           

           

           

          HTTPError generating trusted ticket - Vizalerts

           

          VizAlerts 2.0.1 Released  (someone posted their similar issues in that thread)

           

          Need Help in configuring VizAlerts

          • 2. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
            alice.valentin

            What is the accurate way to tell the version of VizAlerts? 

            Where do you acquire VizAlerts 2.0.1?

            • 3. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
              Matt Coles

              We always keep the lastest version stickied at the top of this Group: https://community.tableau.com/vizalerts . We list the new features and instructions for upgrading from the previous version.

               

              You can also go to GitHub and look at the full list of Releases: Releases · tableau/VizAlerts · GitHub

              • 4. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
                Matt Coles

                Also, as of 2.0.0, I started including a version output whenever vizalerts.py is started. Here it is, hard-coded in vizalerts.py: VizAlerts/vizalerts.py at v2.0.0 · tableau/VizAlerts · GitHub

                • 5. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
                  alice.valentin

                  Hi Matt;

                   

                  I've tried a test again this morning and using the server with the fully qualified domain name didn't work.  

                  The ping is successful using the server with the fully qualified domain or the server name by itself.

                   

                  I reference the Tableau Server config file  (tabsvc.yml) and it uses the server name only.  

                   

                   

                  Here's the log:

                   

                  2017-03-02 07:35:02 - [INFO] - LoggerQuickSetup - Logging
                  initialized, writing to .\logs\vizalerts.log_2017-03-02.log

                  2017-03-02 07:35:02 - [DEBUG] - trusted_ticket_test - testing trusted ticket: tdcmstabd.ad.timet.com, SvcTableau, None

                  2017-03-02 07:35:02 - [DEBUG] - get_trusted_ticket -
                  Generating trusted ticket. Request details: Server: tdcmstabd.ad.timet.com,
                  Site: , Username: SvcTableau, Url: http://tdcmstabd.ad.timet.com/trusted,
                  Postdata: username=SvcTableau.

                  2017-03-02 07:35:02 - [ERROR] - get_trusted_ticket -
                  HTTPError generating trusted ticket: Not Found
                  Request details: Server: tdcmstabd.ad.timet.com, Site: , Username:
                  SvcTableau, Url: http://tdcmstabd.ad.timet.com/trusted, Postdata: username=SvcTableau.

                  2017-03-02 07:35:02 - [ERROR] - trusted_ticket_test -
                  HTTPError generating trusted ticket: Not Found
                  Request details: Server: tdcmstabd.ad.timet.com, Site: , Username:
                  SvcTableau, Url: http://tdcmstabd.ad.timet.com/trusted, Postdata: username=SvcTableau.

                  2017-03-02 07:35:02 - [INFO] - send_email - sending email:
                  mail.timet.com,vizalerts@timet.com,vizalerts@timet.com,None,None,ALERT:
                  VizAlerts failed to execute properly,None

                  2017-03-02 07:35:02 - [DEBUG] - send_email - email body:
                  HTTPError generating trusted ticket: Not Found
                  Request details: Server: tdcmstabd.ad.timet.com, Site: , Username:SvcTableau, Url: http://tdcmstabd.ad.timet.com/trusted, Postdata:
                  username=SvcTableau.

                  2017-03-02 07:35:03 - [ERROR] - <module> - An unhandled exception occurred: Traceback (most recent call last):

                    File
                  "vizalerts.py", line 1654, in <module>

                      main()

                    File
                  "vizalerts.py", line 203, in main

                    
                  trusted_ticket_test()

                    File
                  "vizalerts.py", line 365, in trusted_ticket_test

                    
                  quit_script(errormessage)

                    File
                  "vizalerts.py", line 895, in quit_script

                      sys.exit(1)

                  SystemExit: 1

                  Traceback (most recent call last):

                    File
                  "vizalerts.py", line 1654, in <module>

                      main()

                    File
                  "vizalerts.py", line 203, in main

                    
                  trusted_ticket_test()

                    File
                  "vizalerts.py", line 365, in trusted_ticket_test

                      quit_script(errormessage)

                    File
                  "vizalerts.py", line 895, in quit_script

                      sys.exit(1)

                  SystemExit: 1

                   

                   

                   

                  The vizalerts.yaml entry has the following:

                  server.ssl:false

                  server:tdcmstabd.ad.timet.com

                  server.user:SvcTableau         

                   

                  When I run the python vizalerts.py, I'm on the tdcmstabd server.   

                   

                  Are there other entries in the vizalerts.yaml that needs to be entered.    Also, you mentioned that others may find issues in their config.  Are you referring to the tabsvc.yml file? 

                  Should I be matching the vizalerts.yaml entries to what is defined in the tabsvc.yml entries? 

                   

                  I do plan on upgrading to vizalerts 2.0 but I should get a clean testing of vizalerts under the 1.1?   Is that accurate or do you recommend that I upgrade now?

                  • 6. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
                    Matt Coles

                    If, when you log into tdcmstabd.ad.timet.com with a web browswer, does it show a lock icon by the url? If so, server.ssl should be set to true. If it's not that, then I'm not sure what else it would be off the top of my head.

                     

                    As for 2.0.1, I'd recommend figuring out this "Not Found" issue first. Once you have, I'd just grab the 2.0.1 files and install guide, and start from scratch in a new folder with a new config and everything else. You'll know what to put in the yaml file on the next try, so the knowledge will transfer over!

                    • 7. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
                      alice.valentin

                      Hi Matt;

                       

                      Via another email, I've sent you the website information of tableau. 

                      We are using port 8000.    

                       

                      I wanted to be sure this post captured that information. 

                       

                      You indicated the following:

                      Typically you’d run web services under 80, or 443 for encrypted connections. That could explain it.  Some code changes will be required for this, I believe. I will
                      see about making some changes and send you something to see if it works. If so,we can add it into the code changes for 2.1.0.

                       

                      I look forward to receiving that change to test. 

                       

                      Thank you for your assistance.  

                       

                       

                       

                      • 8. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
                        Matt Coles

                        So I was playing around with this a bit more, and I actually don't think any code changes are necessary--though we can certainly improve the instructions. You should be able to simply tack on a colon with your port number into the "server" config setting in config\vizalerts.yaml, like so:

                         

                         

                        server: 'yourserver:8000' 
                        

                         

                        ...where 'yourserver' is the name of ...your server...and '8000' is the port you'd be running it on. I'd recommend enclosing the whole thing in single quotes, as shown, just so the colon isn't mistaken as a special yaml character.

                         

                        Try that and let me know how it goes, Alice.

                        • 9. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
                          alice.valentin

                          Hi Matt;

                           

                          I've gotten further and the error is no longer with the trusted ticket but with the password for the readonly account.  

                           

                          Do you have to set this every time a tabadmin stop/start is executed?   As it was set before but I've changed the setting of the wgserver.trusted_hosts.    

                           

                          Here's the issue: 

                          2017-03-06 14:22:03 - [DEBUG] - send_email - email body: Failed to execute query

                          against PostgreSQL repository: FATAL:  password authentication failed for user "readonly"

                           

                          Here's the current log file:

                           

                          D:\VizAlerts>python vizalerts.py
                          2017-03-06 14:22:02 - [INFO] - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2017-03-06.log
                          2017-03-06 14:22:03 - [DEBUG] - trusted_ticket_test - testing trusted ticket: tdcmstabd:8000, SvcTableau, None
                          2017-03-06 14:22:03 - [DEBUG] - get_trusted_ticket - Generating trusted ticket.
                          Request details: Server: tdcmstabd:8000, Site: , Username: SvcTableau, Url: http://tdcmstabd:8000/trusted, Postdata: username=SvcTableau.
                          2017-03-06 14:22:03 - [DEBUG] - get_trusted_ticket - Got ticket: 5yfcH7w5n5Sf_SXS7v1uwE7C
                          2017-03-06 14:22:03 - [DEBUG] - trusted_ticket_test - Generated test trusted ticket. Value is: 5yfcH7w5n5Sf_SXS7v1uwE7C
                          2017-03-06 14:22:03 - [ERROR] - get_views - Failed to execute query against PostgreSQL repository: FATAL:  password authentication failed for user "readonly"

                          2017-03-06 14:22:03 - [INFO] - send_email - sending email: mail.timet.com,vizale
                          rts@yourdomain.com,serveradmin@yourdomain.com,None,None,ALERT: VizAlerts failed to execute properly,None
                          2017-03-06 14:22:03 - [DEBUG] - send_email - email body: Failed to execute query against PostgreSQL repository: FATAL:  password authentication failed for user
                          "readonly"

                          2017-03-06 14:22:03 - [ERROR] - <module> - An unhandled exception occurred: Traceback (most recent call last):
                            File "vizalerts.py", line 1654, in <module>
                              main()
                            File "vizalerts.py", line 207, in main
                              views = get_views()
                            File "vizalerts.py", line 382, in get_views
                              quit_script(errormessage)
                            File "vizalerts.py", line 895, in quit_script
                              sys.exit(1)
                          SystemExit: 1
                          Traceback (most recent call last):
                            File "vizalerts.py", line 1654, in <module>
                              main()
                            File "vizalerts.py", line 207, in main
                              views = get_views()
                            File "vizalerts.py", line 382, in get_views
                              quit_script(errormessage)
                            File "vizalerts.py", line 895, in quit_script
                              sys.exit(1)
                          SystemExit: 1

                           

                          Once I can get access to the server, I'll do the following and this should set the readonly password.  Do you agree?

                           

                          tabadmin set wgserver.trusted_hosts <HOSTNAME OF VIZALERTS HOST>

                           

                          tabadmin dbpass --username readonly <YOUR PASSWORD>

                          tabadmin configure

                          tabadmin restart

                          Thank you for this information.   

                          • 10. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
                            Matt Coles

                            Hi Alice. You do not have to set that password more than once--it will persist until intentionally removed with another tabadmin dbpass command. What is likely happening is that when you published your VizAlertsConfig workbook, you didn't embed the credentials in the connection. You can fix that by editing the data connection via the Server user interface, or by re-publishing and specifying the correct setting in the Publish dialog in Tableau Desktop. An easy way to tell if you have it right is by navigating to the viz in your browser and seeing if it loads. If it prompts you to enter the password, then the password is not embedded, so VizAlerts will continue to fail.

                            • 11. Re: [ERROR] - get_trusted_ticket - HTTPError generating trusted (VizAlerts)
                              alice.valentin

                              Hi Matt;

                              I did run the following commands again:

                              tabadmin stop

                              tabadmin set wgserver.trusted_hosts <hostnames>

                              tabadmin dbpass --username readonly  <password>

                              tabadmin config

                              tabadmin start

                               

                              Then I executed the D:\VizAlerts>python vizalerts.py and the log appears to be error free:

                               

                              2017-03-07  08:01:38 - [INFO] - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2017-03-07.log

                              2017-03-07  08:01:38 - [DEBUG] - trusted_ticket_test - testing trusted ticket: tdcmstabd:8000, SvcTableau, None

                              2017-03-07  08:01:38 - [DEBUG] - get_trusted_ticket - Generating trusted ticket. Request
                              details: Server: tdcmstabd:8000, Site: , Username: SvcTableau, Url:
                              http://tdcmstabd:8000/trusted, Postdata: username=SvcTableau.

                              2017-03-07  08:01:39 - [DEBUG] - get_trusted_ticket - Got ticket: _wXdtg2ypFzmIOvEi43RMvn8

                              2017-03-07 08:01:39- [DEBUG] - trusted_ticket_test - Generated test trusted ticket. Value is:[I blank this information out]

                              2017-03-07  08:01:39 - [DEBUG] - get_views - PostgreSQL repository returned 1 rows

                              2017-03-07  08:01:39 - [INFO] - main - Processing a total of 0 views

                               

                              I'm only seeing information in the log.

                               

                              The resolution involved updating the vizalerts.yaml in the server entry both the '<server>:<port>' in single quotes.

                              Then running the above steps again to create the readonly username and password.

                               

                              Thank you very much for your time.  I appreciate your assistance very much!

                              1 of 1 people found this helpful