14 Replies Latest reply on Sep 1, 2016 2:35 PM by Matt Coles

    Vizalerts.yaml returning error

    teresa.grimes

      I am getting the following error when running the Python script.  What is not right in the Vizalerts.yaml file or other config value?

       

       

      2016-09-01 08:19:24 - [INFO] - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2016-09-01.log

      2016-09-01 08:19:24 - [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 0x02A357B0>) Stacktrace: <traceback object at 0x02A357B0>

      2016-09-01 08:19:24 - [ERROR] - <module> - An unhandled exception occurred: Traceback (most recent call last):

        File "D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py", line 1654, in <module>

          main()

        File "D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py", line 171, in main

          configs = validate_conf(configfile, logger)

        File "D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py", line 289, in validate_conf

          sys.exit(1)

      SystemExit: 1

      Traceback (most recent call last):

        File "D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py", line 1654, in <module>

          main()

        File "D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py", line 171, in main

          configs = validate_conf(configfile, logger)

        File "D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py", line 289, in validate_conf

          sys.exit(1)

      SystemExit: 1

        • 1. Re: Vizalerts.yaml returning error
          Matt Coles

          Hey Teresa. Make sure that you are attempting to run VizAlerts in the context of the folder you installed it in. So for example, if you installed it in D:\Installs\VizAlerts\VizAlerts-1.1.0, you'd want to do:

           

          cd D:\Installs\VizAlerts\VizAlerts-1.1.0

          python D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py

           

          That way VizAlerts can easily find the \config folder that your config file is stored in. You can optionally pass in the config file path as an argument, but let's keep it simple for troubleshooting your problem.

           

          Let me know if that helps!

           

          Matt

          • 2. Re: Vizalerts.yaml returning error
            teresa.grimes

            Matt,

            Thank you for your response.  I am running Python from the install directory for VizAlerts.  Here’s the CMD line info.  I have a question about the vizalerts.yaml file.  When I modified the file I used Notepad and when it was saved it was saved as a YAML file type.  Is the file name and file type right?

             

             

             

            Microsoft Windows

            (c) 2013 Microsoft Corporation. All rights reserved.

             

            C:\Windows\system32>cd /d D:\Installs\VizAlerts\VizAlerts-1.1.0

             

            D:\Installs\VizAlerts\VizAlerts-1.1.0>python D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py

             

            2016-09-01 09:17:52 -  - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2016-09-01.log

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

            2016-09-01 09:17:52 -  - validate_conf - An exception was raised loading the config file .\config\vizalerts.yaml:

            (

            2016-09-01 09:17:52 -  -

                main()

              File "D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py", line 171, in main

                configs = validate_conf(configfile, logger)

              File "D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py", line 289, in validate_conf

                sys.exit(1)

            SystemExit: 1

            • 3. Re: Vizalerts.yaml returning error
              teresa.grimes

              Matt,

              I used the full path to the config directory but file is still not being recognized.  Have I messed up the file type or filename?    (FYI - Tableau server is running release 10.0)

               

               

               

              Microsoft Windows

              (c) 2013 Microsoft Corporation. All rights reserved.

               

              C:\Windows\system32>cd /d D:\Installs\VizAlerts\VizAlerts-1.1.0\config

               

              D:\Installs\VizAlerts\VizAlerts-1.1.0\config>python vizalerts.yaml

              python: can't open file 'vizalerts.yaml':  No such file or directory

               

              D:\Installs\VizAlerts\VizAlerts-1.1.0\config>

              • 4. Re: Vizalerts.yaml returning error
                Matt Coles

                This looks right to me. The problem isn't with the contents of the .yaml file itself, but VizAlerts still can't find a file at "D:\Installs\VizAlerts\VizAlerts-1.1.0\config\vizalerts.yaml". So that, coupled with the fact that it's showing as an Internet Explorer icon associated with the file, makes me wonder if perhaps there isn't another extension on the end of the file? You probably already have thought of this but it's worth asking.

                 

                Could you do:

                 

                dir D:\Installs\VizAlerts\VizAlerts-1.1.0\config

                 

                ...and show me the results, please?

                • 5. Re: Vizalerts.yaml returning error
                  teresa.grimes

                  Yeah, I had already thought of this.   I renamed the file and now I’ve moved beyond the unable to find the file error.  The file is loading but erroring on line 2.  Here’s the various paths I’ve tried for locating the logs directory:

                   

                   

                   

                   

                   

                  Here’s the config screenshot:

                   

                   

                  Here’s the path to the logs directory but the syntax in the yaml isn’t working to get to this path.  I’ve tried the fully qualified path and that syntax doesn’t work either.

                  Since I have to execute python using the fully qualified path to the Config directory, I’m taking the path to the log back to the home directory but it doesn’t like that syntax and

                   

                  YAML line

                  1. Local paths settings

                  log.dir: "..
                  logs
                  "     # folder write dump log files to. Will be created if it does not exist.

                  • 6. Re: Vizalerts.yaml returning error
                    Matt Coles

                    Perfect! All you need to do now is make sure you're calling the python file, not the yaml file, with your python executable. So:

                     

                    cd D:\Installs\VizAlerts\VizAlerts-1.1.0

                    python D:\Installs\VizAlerts\VizAlerts-1.1.0\vizalerts.py

                     

                     

                    ... not

                     

                    cd D:\Installs\VizAlerts\VizAlerts-1.1.0\config

                    python D:\Installs\VizAlerts\VizAlerts-1.1.0\config\vizalerts.yaml

                    • 7. Re: Vizalerts.yaml returning error
                      teresa.grimes

                      Ran the command:

                       

                       

                       

                      Here’s the results written to the log file:

                       

                      2016-09-01 11:48:51 -  - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2016-09-01.log

                      2016-09-01 11:48:51 -  - validate_conf - An exception was raised loading the config file .\config\vizalerts.yaml: (

                      2016-09-01 11:48:51 -  -

                          main()

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

                          configs = validate_conf(configfile, logger)

                        File "vizalerts.py", line 289, in validate_conf

                          sys.exit(1)

                      SystemExit: 1

                      • 8. Re: Vizalerts.yaml returning error
                        Matt Coles

                        Bummer. Is the second line complete? The initial error you had was:

                         

                        2016-09-01 08:19:24 - [INFO] - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2016-09-01.log

                        2016-09-01 08:19:24 - [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 0x02A357B0>) Stacktrace: <traceback object at 0x02A357B0>

                        2016-09-01 08:19:24 - [ERROR] - <module> - An unhandled exception occurred: Traceback (most recent call last):

                         

                         

                        So I'm wondering if there's any more text on that line in this latest run that was missed in the copy/paste? If that's all there is, then I'm a bit at a loss to explain what the problem might be....

                         

                        If it is in fact finding the file now, the only two other things I can think of would be either a permissions problem (seems unlikely), or if you're getting a YAML scanner error, it's a formatting issue within the file itself.

                        • 9. Re: Vizalerts.yaml returning error
                          teresa.grimes

                          CMD line copy

                           

                          D:\Installs\VizAlerts\VizAlerts-1.1.0>python vizalerts.py

                          2016-09-01 11:48:51 -  - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2016-09-01.log

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

                          2016-09-01 11:48:51 -  - validate_conf - An exception was raised loading the config file .\config\vizalerts.yaml:

                          (

                          2016-09-01 11:48:51 -  -

                          • 10. Re: Vizalerts.yaml returning error
                            Matt Coles

                            Got it from the log file, thank you!

                             

                            2016-09-01 11:48:51 - [ERROR] - validate_conf - An exception was raised loading the config file .\config\vizalerts.yaml: (<class 'yaml.scanner.ScannerError'>, ScannerError(), <traceback object at 0x02ACA2B0>) Stacktrace: <traceback object at 0x02ACA2B0>

                             

                            So that means we're making progress . Just need to figure out what's up with the yaml file content:

                             

                            • Line 12: Looks like there's a tab character between your smtp.address.to value and the comment after it--you'll need to replace that with spaces.
                            • Lines 18 & 25:  There's a few places where you're using double quotes, that the various yaml validators I checked with online took issue with (why exactly, I'm not sure, but I suspect it has to do with the backslash). Try replacing with single quotes.
                            • 11. Re: Vizalerts.yaml returning error
                              teresa.grimes

                              Thanks for identifying those issues in the yaml.  I’ve fixed them and am running into

                               

                               

                              1)        “No suitable authentication method found” error

                                                               I’m using the same authentication information for email that Tableau Server uses so I’m puzzled why it isn’t finding a suitable authentication method.

                               

                               

                               

                              2)      PostgreSQL permission issue now.

                               

                              Do you have to use “readonly” username?

                               

                              I’m using the same authentication information for email that Tableau Server uses so I’m puzzled why it isn’t finding a suitable authentication method.

                               

                              2016-09-01 13:24:21 -  - LoggerQuickSetup - Logging initialized, writing to .\logs\vizalerts.log_2016-09-01.log

                              2016-09-01 13:24:21 -  - trusted_ticket_test - testing trusted ticket: tableaud2s1.alsac.local, ALSACNT\grimest, None

                              2016-09-01 13:24:21 -  - get_trusted_ticket - Generating trusted ticket. Request details: Server: tableaud2s1.alsac.local, Site: , Username: ALSACNT\grimest, Url: https://tableaud2s1.alsac.local/trusted, Postdata: username=ALSACNT%5Cgrimest.

                              2016-09-01 13:24:21 -  - get_trusted_ticket - Got ticket: fas8CxiYZQFaUMv08TYQFaQx

                              2016-09-01 13:24:21 -  - trusted_ticket_test - Generated test trusted ticket. Value is: fas8CxiYZQFaUMv08TYQFaQx

                              2016-09-01 13:24:21 -  - get_views - Failed to execute query against PostgreSQL repository: permission denied for relation users

                               

                              2016-09-01 13:24:21 -  - send_email - sending email: smtp.alsac.local,BusinessIntelligence@stjude.org,Teresa.Grimes@stjude.org,None,None,ALERT: VizAlerts failed to execute properly,None

                              2016-09-01 13:24:21 -  - send_email - email body: Failed to execute query against PostgreSQL repository: permission denied for relation users

                               

                              2016-09-01 13:24:21 -  - send_email - Email failed to send; there was an issue sending mail via SMTP server: No suitable authentication method found.

                              2016-09-01 13:24:21 -  - quit_script - Unknown error-sending exception alert email: No suitable authentication method found.

                              2016-09-01 13:24:21 -  -

                                  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

                              • 12. Re: Vizalerts.yaml returning error
                                Matt Coles

                                1. Set both smtp.user and smtp.password back to null and try it again. I don't know why you wouldn't be able to use the same credentials as you use to have Tableau Server talk to your smtp server...but usually this error means you should be sending no credentials in.

                                 

                                2. See tabadmin commands for dbpass. Readonly is the account that grants nearly full access to the data, and yes, you'll need that to run VizAlerts. The Tableau account permissions are too restricted.

                                • 13. Re: Vizalerts.yaml returning error
                                  teresa.grimes

                                  Matt,

                                  Thank you for your help today.  Here’s what I know now:

                                   

                                   

                                  1)      Don’t use double quotes around usernames, servernames, passwords – use single quotes

                                   

                                  2)      When modifying the vizalerts.yaml file, don’t save it as vizalerts.yaml – save as vizalerts  and file type should be YAML

                                   

                                  3)      Use the readonly user for querying the PostgreSQL db, even if you already have a user set up for that purpose

                                   

                                  4)      Leave the SMTP authentication to null

                                   

                                  5)      Execute python from the vizalerts home directory, not from the .\config directory

                                   

                                  I think I have a successful run:

                                   

                                   

                                  1 of 1 people found this helpful
                                  • 14. Re: Vizalerts.yaml returning error
                                    Matt Coles

                                    Looking good, nice work!