12 Replies Latest reply on Jul 12, 2016 8:21 AM by Matt Coles

    Date Format Error

    Sharon Graves

      Good afternoon all,

      I've finally have VizAlerts working.. well.. sort of.

      I was able to get it to send me an email on data change (first test)

      But when I attempted to have it send me the email based on 'test_alert' in the comments I receive the following error:

      <<error snippet>>

      [ERROR] - get_views - Error accessing .\ops\vizalerts.state while getting views to process:  time data '2016-06-20 22:31:02' does not match format '%Y-%m-%d %H: %M: %S'

       

      Thoughts?

        • 1. Re: Date Format Error
          Matt Coles

          Hey Sharon. I've seen that one before, but only when I've manually edited the vizalerts.state file, and screwed up the timestamp while doing so. I notice that the format string in your response is slightly different from the format string in the vizalerts.py file. I'm not sure if that's because of the way the output is being printed, or maybe even the Community forum changing things a bit, or a legit difference, but it's something to look at:

           

          '%Y-%m-%d %H: %M: %S' (from the post above)

          vs

          '%Y-%m-%d %H:%M:%S' (in lines 427 through 447 of vizalerts.py)

           

          Do you know if you started with v1.0.8, then "upgraded" to v1.1.0? Or happened to save over the file with any particular kind of text editor that may have introduced the extra spaces, or maybe used find/replace somehow? Grasping at straws to try and explain what might have caused this one...

          1 of 1 people found this helpful
          • 2. Re: Date Format Error
            Sharon Graves

            Thanks Matt,

            No idea how or why that file had the format with the spaces, but it definitely did.

            I don't believe I upgraded, I think I started with v1.1.0.

            Anyway, I'm not longer getting the date format error.

            However I'm still not getting the emails from the 'test_alert' test.

            I'll keep playing with that and see what I can figure out.

             

            Thanks for your quick response

            1 of 1 people found this helpful
            • 3. Re: Date Format Error
              Sharon Graves

              Yeah!! received the burst of emails from the test_alert step.

              Soo.. only issue.. on the embedded viz images. I'm only getting a red x.

              I do subscribe to several workbooks in Tableau and those images come thru fine.

              Thoughts?

              • 4. Re: Date Format Error
                Matt Coles

                Nice!

                 

                For your alert, is this from the demo workbook included with VizAlerts, or are you building your own?

                 

                If the demo, which alert did you run?

                 

                If your own, is this a simple or "Advanced" alert? If Advanced, how are you referencing the image of the viz you want in your alert email?

                • 5. Re: Date Format Error
                  Sharon Graves

                  For your alert, is this from the demo workbook included with VizAlerts, or are you building your own?

                  - The VizAlerts workbook

                   

                  If the demo, which alert did you run?

                  - test_alert comment

                   

                  One of the test specifically is 'Test 28: Consolidated emails w/multiple VIZ_Images

                  from log file:

                  2016-06-21 08:47:40 - [DEBUG] - process_csv - Starting iteration 26, consolidate_email_ctr is 1

                  2016-06-21 08:47:40 - [DEBUG] - process_csv - Body row: 

                  2016-06-21 08:47:40 - [DEBUG] - process_csv - Body row:  Should see the Overview dashboard below:<br/>VIZ_IMAGE(VizAlertsDemo/Overview)

                  2016-06-21 08:47:40 - [DEBUG] - process_csv - Starting email action

                  2016-06-21 08:47:40 - [DEBUG] - process_csv - Consolidate value is true, row index is 26, rowcount is 44

                  2016-06-21 08:47:40 - [DEBUG] - process_csv - Next row does not match recips and subject, sending consolidated email

                  2016-06-21 08:47:40 - [INFO] - process_csv - Sending email to (email removed), CC None, BCC None, Subject Test 28: Consolidated emails w/ multiple VIZ_IMAGEs

                  2016-06-21 08:47:40 - [DEBUG] - append_body_and_inlineattachments - Replacing body text with exact content references for inline attachments and hyperlinks

                  2016-06-21 08:47:40 - [INFO] - send_email - sending email:  relay-app.secureserver.net,(from email removed),(to email removed),None,None,Test 28: Consolidated emails w/ multiple VIZ_IMAGEs,[{'view_url_suffix': u'VizAlertsDemo/Overview', 'imagepath': u'.\\temp\\20160621084713833000_VizAlertsDemo-Overview.png', 'vizref': u'VIZ_IMAGE(VizAlertsDemo/Overview)', 'formatstring': 'PNG'}, {'view_url_suffix': u'VizAlertsDemo/Overview?Region=East', 'imagepath': u'.\\temp\\20160621084738276000_VizAlertsDemo-Overview.png', 'vizref': u'VIZ_IMAGE(VizAlertsDemo/Overview?Region=East)', 'formatstring': 'PNG'}]

                  2016-06-21 08:47:40 - [DEBUG] - send_email - email body:  Should see the Overview dashboard below:<br/><img src="cid: 20160621084713833000_VizAlertsDemo-Overview.png">Should see the Overview dashboard filtered to just East below:<br/><img src="cid: 20160621084738276000_VizAlertsDemo-Overview.png">

                  2

                  • 6. Re: Date Format Error
                    Matt Coles

                    Thanks for all the detail, that's helpful. Very strange--I've never had the embedded images not show up like that before. If you right-click them in Outlook, do you have the option to download the images? I'm wondering if your email server stripped the images out for some reason. One way to tell if that happened is if you run Papercut on your VizAlerts machine, and change the vizalerts.yaml file so that the smtp.serv value is "localhost" again. Papercut will display the email as VizAlerts sends, them without the middleman of your real SMTP server. You can even then forward the generated emails off to yourself to see how they come out on the other side.

                    • 7. Re: Date Format Error
                      Sharon Graves

                      Hey Matt,

                      I didn't get a chance to try Papercut yet but did notice in the email source that the image is coming in with a CID code.

                      <img src="cid: 20160622161032220000_VizAlertsDemo-AdvancedAlertsTests.png">

                       

                      is that expected?

                      • 8. Re: Date Format Error
                        Matt Coles

                        Yes, it's a reference to an attachment in the email of that name. But for some reason the attachment is not there, that's why it shows as a red "X". Why is the attachment not there? That's the question Papercut should help us answer.

                        • 9. Re: Date Format Error
                          Matt Coles

                          On second glance, there's a space between "cid:" and "20160622161032220000_VizAlertsDemo-AdvancedAlertsTests.png"...and this is another colon character. This feels a lot like the issue you had originally, with the date strings.

                           

                          I am going to go ahead and recommend that you re-download the .py files from GitHub and copy them over the ones you currently have, then double-check to make sure that no spaces were introduced after those colons.

                          1 of 1 people found this helpful
                          • 10. Re: Date Format Error
                            Sharon Graves

                            Woot Woot!!! awesome.. it's all working now.

                             

                            Sweet.. not sure what happened with my py file but. all good now!

                             

                            Do you still need testers?  I saw a message from a while back.

                            Happy to add my name if needed.

                            • 11. Re: Date Format Error
                              Matt Coles

                              Nice! We don't need testers at this point, but are always very interested in what kinds of alerts people are building, and what benefit they are getting from it. If something proves particularly useful, tell us what you did and why it's good!

                               

                              thanks,

                              Matt

                              • 12. Re: Date Format Error
                                Matt Coles

                                If your question was answered, would you mind marking the right response "correct", please? Thank you!