Skip to content

Investigate twilio sending empty sms messages #124

@xuset

Description

@xuset

From the below traceback, it appears someone texted our number with an empty message. From what I know, most sms clients like iMessage/Android's sms, do not allow empty texts to be sent. Was an empty text actually sent?

ERROR:root:ValidationException: 400 Bad Request
{'message': 'One or more parameter values were invalid: An AttributeValue may not contain an empty string', '__type': 'com.amazon.coral.validate#ValidationException'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/gator/api/gator/endpoints/sms.py", line 62, in handle_sms
    transactions.send_message(transaction, text_message_body, True, MTypes.TEXT)
  File "/var/gator/api/gator/logic/transactions.py", line 67, in send_message
    if not transaction.save():
  File "/var/gator/api/gator/core/models.py", line 144, in save
    return self.item.partial_save()
  File "/usr/local/lib/python3.4/dist-packages/boto/dynamodb2/items.py", line 410, in partial_save
    returned = self.table._update_item(key, final_data, expects=expects)
  File "/usr/local/lib/python3.4/dist-packages/boto/dynamodb2/table.py", line 852, in _update_item
    self.connection.update_item(self.table_name, raw_key, item_data, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/boto/dynamodb2/layer1.py", line 2765, in update_item
    body=json.dumps(params))
  File "/usr/local/lib/python3.4/dist-packages/boto/dynamodb2/layer1.py", line 2842, in make_request
    retry_handler=self._retry_handler)
  File "/usr/local/lib/python3.4/dist-packages/boto/connection.py", line 954, in _mexe
    status = retry_handler(response, i, next_sleep)
  File "/usr/local/lib/python3.4/dist-packages/boto/dynamodb2/layer1.py", line 2882, in _retry_handler
    response.status, response.reason, data)
boto.dynamodb2.exceptions.ValidationException: ValidationException: 400 Bad Request
{'message': 'One or more parameter values were invalid: An AttributeValue may not contain an empty string', '__type': 'com.amazon.coral.validate#ValidationException'}
172.31.32.60 - - [11/Apr/2016:01:31:59 +0000] "POST /sms/handle_sms?token=NDQzODUyNjQ2ODYwMDE2NTY4OmFwaToxNjAxNTAxNjYwOklzbHcyTHlRelBCZU1SQmFHRDNWVXcrSEJNYVRCZ1FVNEh6bUlacGdBdkk9 HTTP/1.1" 500 75 "-      " "TwilioProxy/1.1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions