11 Replies Latest reply on Mar 16, 2017 1:18 PM by Matt Coles

    Subscriptions and Triggers--Processing a total of 0 alerts

    johan.sohn

      I'm a little confused about how subscriptions and the trigger file interact. My general question is what is the criteria for the trigger to send or not send an alert? I've found that when an alert is triggered, you cannot trigger it again for a period of time unless you use the "test_alert" feature.

       

      Specific to me, I'm trying to set up a few views that I'd like to run once a day, but they've only sent one alert over a dozen or so attempts. I changed my subscription schedule to run every 15 minutes, but every time I run the trigger I still don't get anything. There are definitely rows in the views, but my logs keep showing this below:

       

      MainThread - 2017-02-22 11:30:02 - [INFO] - main - Processing a total of 0 alerts

       

      The ScheduledTriggerViews csv shows my views so I know that they are being recognized by the process, but for some reason it doesn't choose to send an alert.

        • 1. Re: Subscriptions and Triggers--Processing a total of 0 alerts
          Matt Coles

          This means that your alerts aren't being picked up as actual alerts to be processed by VizAlerts. Some things to check

           

           

          • This is typically because the Schedules were not set to Disabled in the Tableau Server interface. Check and ensure that they are.
          • If you're using version 2 or higher, you should be able to see the alerts being picked up in the VizAlertsConfig workbook that you published to Tableau Server. It should be pretty obvious which alerts are being recognized and which aren't. If nothing is showing, then check that the schedule_name_filter on the top left is using a string that matches the names for the schedules you want to use for VizAlerts.
          • If you're using version 1, then the SQL query in config\vizalerts.yaml may not be retrieving the information from the postgreSQL database properly. Again, usually this is a naming problem, and you just need to make sure that in the WHERE clause, you're matching to the right naming pattern.
          • Finally, if none of that other stuff works, it could be that the Schedule "From" and "To" times are set in such a way that the schedule doesn't run when you want. Check to ensure that the From comes before the To, and that the To ends one interval before the From. So if you've got an hourly schedule, use From 12:00AM To 11:00PM
          • 2. Re: Subscriptions and Triggers--Processing a total of 0 alerts
            Matt Coles

            Well, clearly you're using v2, as I should have recognized from the log line you pasted. So check the VizAlertsConfig workbook, and if the ScheduledTriggerViews viz isn't showing anything, that's your problem.

            • 3. Re: Subscriptions and Triggers--Processing a total of 0 alerts
              Matt Coles

              I should have read your initial post more thoroughly--sorry for the additional replies!

               

              Since you said "ScheduledTriggerViews csv shows my views so I know that they are being recognized by the process", then the last culprit could be the schedule times--the final bullet I listed above. As an example, my own 15-minute schedule looks like this:

               

              • 4. Re: Subscriptions and Triggers--Processing a total of 0 alerts
                johan.sohn

                Hi Matt,

                 

                Thanks for your reply. My schedule does look like yours, the only difference being the start/end times and the name. I’m going to try adding some add’l logging, maybe something will turn up. Do you think this is a time zone issue? I noticed the times in the Scheduled trigger viz view are UTC, not sure if I have to account for that. And if I wanted this to run only once a day, do I still need to set a from—to interval? I have it set to hourly – every 15 mins right now, but eventually I’ll want this to run once a day.

                 

                By the way, what is the naming convention for vizalerts subscriptions? I’ve been using the Cyrillic "Ѵ" ѴizAlerts format as it is in the docs.

                 

                 

                Thanks,

                Johan

                • 5. Re: Subscriptions and Triggers--Processing a total of 0 alerts
                  Matt Coles

                  Another thing to check: Make sure that the config\vizalerts.yaml setting for the vizalerts.source.viz is pointing to the same viz you're looking at that is showing records. I'll do a test version sometimes and forget to update the yaml to point to the real one.

                   

                  Do you think this is a time zone issue? I noticed the times in the Scheduled trigger viz view are UTC, not sure if I have to account for that.

                  Time zones in the viz and in the ops\vizalerts.state file should all be UTC. So there should be no timezones to worry about.

                   

                  And if I wanted this to run only once a day, do I still need to set a from—to interval? I have it set to hourly – every 15 mins right now, but eventually I’ll want this to run once a day.

                  I'd just start by creating a bunch of different schedules, one for Daily, one for Hourly, one for every 15 minutes, etc. You don't have to stick with just one. When you create a Daily schedule, it doesn't let you pick a To: From: range. Just what time it runs each day.

                   

                  By the way, what is the naming convention for vizalerts subscriptions? I’ve been using the Cyrillic "Ѵ" ѴizAlerts format as it is in the docs.

                  Really, that's just a suggestion, so that the VizAlerts schedules get bumped down in the Schedule list when people go to Subscribe to their vizzes--it helps reduce the chance that they'll pick a VizAlerts schedule rather than a standard schedule. So that's a fine convention. But you could always change it and update your VizAlertsConfig workbook to match accordingly, if you wanted.

                   

                  If you still can't figure it out, feel free to send me a sanitized version of your logs\*, config\vizalerts.yaml, ops\vizalerts.state, and ideally an extracted version of your Scheduled trigger viz view, and I'll take a look. Probably better to send that stuff via email rather than attaching here.

                  • 6. Re: Subscriptions and Triggers--Processing a total of 0 alerts
                    Matt Coles

                    Were you able to get this figured out, Johan?

                    • 7. Re: Subscriptions and Triggers--Processing a total of 0 alerts
                      johan.sohn

                      Hey Matt,

                       

                      Yes, the alert wasn't being sent because I had created customized copies of the vizalerts.py script to handle some database post-processing after certain alerts were sent, but I didn't make any changes to how the state file gets updated. Now I just run everything off of one script and the alerts get sent as expected.

                       

                      Thanks,

                      Johan

                      • 8. Re: Subscriptions and Triggers--Processing a total of 0 alerts
                        Matt Coles

                        Thanks for following up! Note that altering the VizAlerts code voids our nonexistent warranty.

                        • 9. Re: Subscriptions and Triggers--Processing a total of 0 alerts
                          Toby Erkson

                          Johan Sohn wrote:

                           

                          Hey Matt,

                           

                          Yes, the alert wasn't being sent because I had created customized copies of the vizalerts.py script to handle some database post-processing after certain alerts were sent, but I didn't make any changes to how the state file gets updated. Now I just run everything off of one script and the alerts get sent as expected.

                           

                          Thanks,

                          Johan

                          Yeah...stating this in the beginning would have been helpful.

                          • 10. Re: Subscriptions and Triggers--Processing a total of 0 alerts
                            Toby Erkson

                            Mr. Pot,

                            Stating it in the beginning would've helped with the trouble-shooting process, thus saving Matt or anyone else looking at it from spinning their wheels on the wrong stuff.  For example, after seeing your response to Matt about what you found wrong, my first thought was if you had even tried VizAlerts first in its original form to see if it was still functional...or was that supposed to be obvious, too?

                             

                            Sincerely,

                               Mr. Kettle 

                            2 of 2 people found this helpful
                            • 11. Re: Subscriptions and Triggers--Processing a total of 0 alerts
                              Matt Coles

                              Be nice, please guys. The VizAlerts group is a friendly place. Yes, it would have been good to know up front that it was customized, but I don't know that my answers or the effort I put in would have changed even in that case. I'm not upset about it.