Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'AttributeError' object has no attribute 'message' error when downloading alert CSV #206

Open
jdrummey opened this issue Mar 28, 2023 · 2 comments

Comments

@jdrummey
Copy link
Collaborator

Occasionally we're getting failures on SMS alerts where it seems like something's gone wrong in the download of the alert CSV, here's the email we're getting:

The following errors were encountered trying to process your alert:

General errors:

Unable to process alert [alert view name] as csv, error: 'AttributeError' object has no attribute 'message'

Alert Information:

View URL: https://[tableau server]/t/[site URL stub]/views/[workbook URL stub]/[alert view URL stub]
Subscriber: [subscriber username] w/mailto link
View Owner: [owner username] w/mailto link
Site Id: [site name]
Project: [project name]

When I paste in the alert view URL manually with the .csv extension to download the file I'm getting just one record (when there are ~144 records). When I edit the view to remove that record I end up getting two copies of the file when I download it so I'm really not sure what's going on.

@mcoles
Copy link
Contributor

mcoles commented Mar 29, 2023

Weird...is it a multi-sheet dashboard, or a single-sheet standalone view? Sounds like it is either a Tableau Server bug, or (if a multi-sheet), possibly a behavior change?

@dwalker3rd
Copy link

this is happening in the sms_number_to_e164 function in smsaction.py. when an invalid smsnumber is detected, a UserWarning is raised which is caught by the except at line 312. in the except, the logger tries to log "e.message". however, there's no message attribute for the UserWarning class. as a result, another exception is thrown: error: 'AttributeError' object has no attribute 'message'. i believe changing line 313 to log.logger.error(e) would fix the issue.

270  def smsnumber_to_e164(smsnumber, iso2countrycode):
271      """Tries to convert a string into an E.164 formatted phone number
272         Raises exception if it can't, returns the E.164 number as a string, if it can """
273  
274      try:
275          log.logger.debug('Converting {} to E.164 format, country code {}'.format(smsnumber, iso2countrycode))
...
298          if not phonenumbers.is_valid_number(smsnumber_obj):
299              errormessage = 'SMS Number is not valid: {}.'.format(smsnumber)
300              log.logger.error(errormessage)
301              raise UserWarning(errormessage)
...
310          # all good, return it!
311          return e164_number
312      except Exception as e:
313          log.logger.error(e.message)
314          return None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants