12 Replies Latest reply on Oct 7, 2015 12:35 PM by jegan.sivaraj

    Error after setting up vizalerts.yaml

    jegan.sivaraj

      Hi All,

       

      I just got around to testing this on our trial server. I followed the instructions pretty well and got as far as updating the vizalerts.ymal file with the SMTP and other server information.

       

      When I run the python C:\VizAlerts\vizalerts.py I get an IO Error - 'No such file or Directory' for the vizalerts.yaml file. I can see the file in the config folder. There were no logs generated in the log folder.

       

      Here is the result from the command window -

       

      C:\>python C:\Documents\VizAlerts\vizalerts.py

      2015-10-06 00:13:02 - [INFO] - LoggerQuickSetup - Logging initialized, writing t

      o .\logs\vizalerts.log_2015-10-06.log

      An exception was raised loading the config file .\config\vizalerts.yaml: (<type

      'exceptions.IOError'>, IOError(2, 'No such file or directory'), <traceback objec

      t at 0x02C8CB48>) Stacktrace: <traceback object at 0x02C8CB48>

      2015-10-06 00:13:02 - [ERROR] - validate_conf - An exception was raised loading

      the config file .\config\vizalerts.yaml: (<type 'exceptions.IOError'>, IOError(2

      , 'No such file or directory'), <traceback object at 0x02C8CB48>) Stacktrace: <t

      raceback object at 0x02C8CB48>

      2015-10-06 00:13:02 - [ERROR] - <module> - An unhandled exception occurred: Trac

      eback (most recent call last):

        File "C:\Documents\VizAlerts\vizalerts.py", line 1251, in <mod

      ule>

          main()

        File "C:\Documents\VizAlerts\vizalerts.py", line 151, in main

          configs = validate_conf(configfile, logger)

        File "C:\Documents\VizAlerts\vizalerts.py", line 252, in valid

      ate_conf

          sys.exit(1)

      SystemExit: 1

      Traceback (most recent call last):

        File "C:\Documents\VizAlerts\vizalerts.py", line 1251, in <mod

      ule>

          main()

        File "C:\Documents\VizAlerts\vizalerts.py", line 151, in main

          configs = validate_conf(configfile, logger)

        File "C:\Documents\VizAlerts\vizalerts.py", line 252, in valid

      ate_conf

          sys.exit(1)

      SystemExit: 1

        • 1. Re: Error after setting up vizalerts.yaml
          Matt Coles

          Hey Jegan! Thanks for trying it out.

           

          It looks like you're running it from c:\ as your working directory? By default, the config values point to relative paths to point the code to the logs, ops, and config folders. So it'll be looking for c:\config to get the vizalerts.yaml file. Easily fixed, however. If you've copied the files to C:\Documents\VizAlerts, you should set the working directory in line 2 as shown--then I expect you'll get past this error:

           

          c:
          cd c:\documents\vizalerts
          python vizalerts.py
          
          

           

          Let me know if that helps!

           

          (edit: fixed typo "config" not "conf")

          • 2. Re: Error after setting up vizalerts.yaml
            jegan.sivaraj

            Thanks Matt. That worked. I get a -1 for the trusted ticket. I'm running this on the Tableau server instance. I'm reading your common errors section to debug.

            • 3. Re: Error after setting up vizalerts.yaml
              Matt Coles

              Good ol' -1. You gotta love it. If you're running VizAlerts against a standalone test Server instance, and it's running on the Tableau Server host itself, I recommend setting the trusted host to "localhost" via tabadmin:

               

               

              tabadmin set wgserver.trusted_hosts localhost
              tabadmin configure
              tabadmin restart
              
              


               

              then use the following settings in your config (substitute your username for "mcoles"...also this assumes you're using local authentication, and not Active Directory):

               

              1 of 1 people found this helpful
              • 4. Re: Error after setting up vizalerts.yaml
                jegan.sivaraj

                It worked! I had qualified the username with the domain id. Turns out I was using local authentication. I removed the domain and it is all good now. On to the next step.

                • 5. Re: Error after setting up vizalerts.yaml
                  Matt Coles

                  Glad to hear it! Let me know how it goes!

                  • 6. Re: Error after setting up vizalerts.yaml
                    jegan.sivaraj

                    I'm having trouble with the Subscriptions. I have opened a ticket with Tableau. I will be back testing as soon as that is resolved.

                    • 7. Re: Error after setting up vizalerts.yaml
                      Matt Coles

                      What's the problem? It's highly likely I've hit it before and can help.

                      • 8. Re: Error after setting up vizalerts.yaml
                        jegan.sivaraj

                        I get an error that is similar to this quick fix issue - Error "javax.mail.MessagingException: [EOF]" Sending Subscriptions | Tableau Software

                         

                        I have made sure the port is correct and the mail server works from other applications like SSIS.

                        • 9. Re: Error after setting up vizalerts.yaml
                          Matt Coles

                          Okay, couple things just to ensure we're not barking up the wrong tree here:

                           

                          1. Subscriptions Schedules in Tableau Server that you set up for VizAlerts need to be disabled. Therefore, Tableau Server should not be sending any subscriptions out for those schedules at all.

                           

                          2. If you are having issues setting up your SMTP server for VizAlerts, I highly recommend using a free little tool called PaperCut, which emulates an SMTP server on whatever machine you run it on. So you could install that on the same machine you set up VizAlerts on, and edit vizalerts.yaml so that the smtp settings are as follows:


                          smtp.serv: localhost

                          smtp.ssl: false

                          smtp.user: null

                          smtp.password: null


                          What that does for you is intercepts all the mail that VizAlerts would be sending, and shows it in a nice little UI. So that's an easy way to test VizAlerts (just by yourself) without having to worry about connecting to a real SMTP server that will really send mail. I'm so in love with this little app that I'm going to add instructions for how to use it for testing to a Quickstart guide soon.

                           

                          • 10. Re: Error after setting up vizalerts.yaml
                            jegan.sivaraj

                            The subscription schedule for the alerts is disabled. I loaded PaperCut and ran the test. There were no emails received. Here is the log -

                             

                            2015-10-07 12:41:53 - [INFO] - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2015-10-07.log

                            2015-10-07 12:41:53 - [DEBUG] - trusted_ticket_test - testing trusted ticket: ,<snipped>, None

                            2015-10-07 12:41:53 - [DEBUG] - get_trusted_ticket - Generating trusted ticket.

                            Request details: Server: <snipped>, Site: , Username: <snipped>, Url: <snipped>, Postdata: username=<snipped>.

                            2015-10-07 12:41:53 - [DEBUG] - get_trusted_ticket - Got ticket: PACNCar78kubsQ7ecoVgDgZW

                            2015-10-07 12:41:53 - [DEBUG] - trusted_ticket_test - Generated test trusted ticket. Value is: PACNCar78kubsQ7ecoVgDgZW

                            2015-10-07 12:41:53 - [DEBUG] - get_views - PostgreSQL repository returned 1 rows

                            2015-10-07 12:41:53 - [INFO] - main - Processing a total of 0 views

                            • 11. Re: Error after setting up vizalerts.yaml
                              Matt Coles

                              Things look like they are working as expected. The python script is meant to be running continually (every minute via Scheduled Task, as mentioned in the install_guide.docx file). The way it works is, when you run it initially, it grabs a list of all the alerts from Tableau Server and marks the time that they should next be run. Each time the script runs thereafter, it checks the time it collected the first time around, and checks to see if it’s been passed. If it has, it triggers the alert test.

                               

                              You can force it to test a specific alert view that you own by adding the comment "test_alert" to it, then running the vizalerts.py script twice (one to pick up that a test was requested, the next to actually fire it off).

                               

                              test.png

                               

                              If that works, try running vizalerts.py manually sometime after your alert was scheduled to fire off. For example, if you have an Hourly schedule set up to run on the hour, run vizalerts.py again any time after 1:00pm. You should see log output indicating that it is exporting the CSV data from the view--that tells you that it's doing what it should be doing.

                               

                              Again, this script is meant to be run continually every minute--that is the only way it will send alerts on time.

                              • 12. Re: Error after setting up vizalerts.yaml
                                jegan.sivaraj

                                Ah I get it. I ran the vizalerts.py again after 15 mins and it generated the email. Works great! I'll test the Advanced options next. Thank you.