4 Replies Latest reply on Dec 9, 2015 3:26 PM by Matt Coles

    PostgreSQL repository returned 0 rows, probably missing something simple

    tim.latona

      I'm sure this is probably something I'm overlooking that is pretty simple, or a something in the manual that I've missed, but I can't figure this out. I've tried my best though! Sorry if I end up with a, "oh...duh..." moment

       

      I'm running vizalerts.py from our Dev box against our QA primary box and have also tried QA worker1. I've subscribed a few views to the Alerts subscription, which is named –źlerts – hourly. I have not edited the SQL at the bottom of the .py.

       

      I've tried running vizalerts.py with that subscription disabled, enabled, 15 minutes, 60 minutes. But it never seems that the postgres repository is seeing that I've subscribed any views. When I was trying to run the python script on our QA primary against the QA primary, I ran into issues. I was initially seeing issues with the -1 trusted ticket error.

       

      Here's the entirety of the messaging when the .py is run, any ideas?

       

      D:\VizAlerts\VizAlerts-master>python vizalerts.py

      2015-12-09 11:18:58 - [INFO] - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2015-12-09.log

      2015-12-09 11:18:58 - [DEBUG] - trusted_ticket_test - testing trusted ticket: <QA cluster primary>, <userid>, None

      2015-12-09 11:18:58 - [DEBUG] - get_trusted_ticket - Generating trusted ticket. Request details: Server: <QA cluster primary>, Site: , Username: <userid>, Url: http://<QA cluster primary>/trusted, Postdata: username=<userid>.

      2015-12-09 11:18:59 - [DEBUG] - get_trusted_ticket - Got ticket: 1moeuDpRcHHrLEYAH5LyQx6C

      2015-12-09 11:18:59 - [DEBUG] - trusted_ticket_test - Generated test trusted ticket. Value is: 1moeuDpRcHHrLEYAH5LyQx6C

      2015-12-09 11:18:59 - [DEBUG] - get_views - PostgreSQL repository returned 0 rows

      2015-12-09 11:18:59 - [INFO] - main - Processing a total of 0 views

       

      This is the step in the help documentation that I'm stumped with:

       

      Now, for a more extensive test. Subscribe to any Tableau Server View on an Alerts schedule that you set up (pick a view that renders in less than 10 seconds or so). I recommend subscribing on an Alerts schedule that runs every 15 minutes for this test, even if you just remove it afterward. After you subscribe, run the command again:

      python C:\VizAlerts\vizalerts.py

      Now, wait 15 minutes, then run the same command again. If data is present in the viz, you should receive an email! If not, you shouldn’t. Simple as that!

        • 1. Re: PostgreSQL repository returned 0 rows, probably missing something simple
          Matt Coles

          You're right, the PostgreSQL repository isn't seeing your subscription on the QA Primary. Couple of things you might check:

           

          1. Is db.host in the config file is pointed to the QA Primary host (or whatever worker within it is running the Repository)?

          2. Double check there are no leading spaces or anything in your schedule names (and yes, they need to be disabled). The SQL in the config is looking for them to start with (any character) followed by "lerts".

           

          That's all I can think of for right now, but I'll give it a bit more thought. You're close--this shouldn't be too hard to figure out.

          • 2. Re: PostgreSQL repository returned 0 rows, probably missing something simple
            Matt Coles

            A few more things you can try:

             

            1. Open the view on your QA server, and add the comment "test_alert", using the comment box at the bottom. Then run the vizalerts.py script twice. If it doesn't pick anything up, I'd suspect a bad hostname in the db.host config value. If it does show up, it means that it's either a name match issue with your schedules, or some other weird data condition that's causing the SQL not to return anything.

             

            2. Another (more hardcore) idea to troubleshoot is to copy the SQL from the config file and run manually as Custom SQL in Tableau, pointed to your QA Server repository database. If it were me and I was still stuck on data not coming back, I'd start removing lines from the WHERE clause, then if I still wasn't getting what I needed, change the SELECT list to "*", and start slowly commenting tables out until I found out what was up. But honestly, if things were that jacked up (it'd be either a bug or a heinous data issue, at that point), I'd be very surprised.

             

            If you are still stuck after all that, let me know--we'll get this working one way or another.

            • 3. Re: PostgreSQL repository returned 0 rows, probably missing something simple
              tim.latona

              Hey Matt,

               

              Thanks. My issue ended up being the db.host field, I had iterated through so many  variations of the data that I just didn't find the right combination. I was able to successfully send an alert with VizAlerts a few minutes ago. The problem lies purely with my process, not at all with the documentation...

               

              Thanks for the lightning fast support, very excited to have this in my hands. Our users have been clamoring for this functionality since we exited POC, and I just can't get the budget for the other tools that advertise these abilities.

               

              Definitely excited to play some more and make some cool alerts.

               

              -Tim

              • 4. Re: PostgreSQL repository returned 0 rows, probably missing something simple
                Matt Coles

                Awesome, glad to hear it's working! And don't feel too bad. The install process is the hardest thing, and I need a way to make it easier. Just too many things to do--I still don't think I've ever set it up from scratch without missing something myself.