Stuck message

Posted on
Sun Feb 18, 2018 3:29 am
rhanson offline
Posts: 141
Joined: Apr 30, 2013

Stuck message

I sent an mms programatically. It worked fine, but I'm seeing this message every poll interval for the plugin:

Code: Select all
   Twilio Error                    checkMessages: twilioClient.messages.delete error: HTTP 409 error: Cannot delete message because delivery has not been completed.
Traceback (most recent call last):
  File "plugin.py", line 379, in checkMessages
    self.twilioClient.messages.delete(message.sid)
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Twilio.indigoPlugin/Contents/Server Plugin/twilio/rest/resources/messages.py", line 153, in delete
    return self.delete_instance(sid)
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Twilio.indigoPlugin/Contents/Server Plugin/twilio/rest/resources/base.py", line 380, in delete_instance
    resp, instance = self.request("DELETE", uri)
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Twilio.indigoPlugin/Contents/Server Plugin/twilio/rest/resources/base.py", line 200, in request
    resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Twilio.indigoPlugin/Contents/Server Plugin/twilio/rest/resources/base.py", line 164, in make_twilio_request
    uri=resp.url, msg=message, code=code)
TwilioRestException: HTTP 409 error: Cannot delete message because delivery has not been completed.


There doesn't seem to be a way to clear this message entry. I've looked on the Twilio console, and tried reloading the plugin and restarting Indigo.

It sounds like there's a message in the queue, but that's not what the Twilio console shows:

Code: Select all
Twilio Platform    Message Created    0:35:45.50 PST 2018-02-18    —
Outbound Queue    Enqueued    0:35:45.64 PST 2018-02-18    0.14 sec
    Enqueued    0:35:45.98 PST 2018-02-18    0.49 sec
    Enqueued    0:35:47.40 PST 2018-02-18    1.9 secs
    Sent    0:35:57.46 PST 2018-02-18    11.97 secs


I tried Redacting the message manually via the API, and it returned the same error. So Twilio on one hand thinks it is still pending, and on the other calls it Sent. I've opened a ticket with them.

Just wondering if anyone has ever seen this.

Is there a reason for Redacting/deleting messages after they are sent? Can we just pull that out of the loop?

Posted on
Sun Feb 18, 2018 7:20 am
FlyingDiver offline
Posts: 2437
Joined: Jun 07, 2014
Location: Cape Coral, FL

Re: Stuck message

I've never seen that error before. Please do let me know what Twilio says.

Is there a reason for Redacting/deleting messages after they are sent? Can we just pull that out of the loop?


You can disable the deletion in the config dialog for the Twilio device (not the plugin config).

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Feb 18, 2018 12:36 pm
FlyingDiver offline
Posts: 2437
Joined: Jun 07, 2014
Location: Cape Coral, FL

Re: Stuck message

I pushed a commit to the GitHub repository that fixes the exception you're getting with that error. You can grab it and install it manually if you want.

Also, redacting a message will not take it out of the message lists. Redacting removes the content (body) of the message from the Twilio server, but leaves the headers. Useful for purging attachments and sensitive content, but not for solving this problem.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Feb 19, 2018 2:11 am
rhanson offline
Posts: 141
Joined: Apr 30, 2013

Re: Stuck message

Cool, thanks! The issue is definitely a Twilio thing as I saw the same errors via direct API. After about 22 hours, the error stopped occurring, so I guess they have some sort of garbage collection on their end for the messages list.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests