[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2570) | XM Community
Skip to main content

Hello,
I occasionally get the above error while using the request function of the requests python library to access Qualtrics APIs.
I have the following automated workflow:

  • every day three csv containing user contacts are placed in a sftp (each csv is tied to a different survey)

  • as soon as a file is placed on the sftp, a script is triggered that recognizes the file, uploads the contacts into a contact list and downloads the distribution links

The problem is that sometimes the process crashes due to the above error. It's difficult to debug it because I don't see any pattern on the occurence:
  • most of the times, the process will complete successfully (and it actually ran smoothly for the past year)

  • when it fails, I can reprocess the same file by overwriting it in the sftp and it will complete successfully (so it's not a problem of the file)

My supsects is that the error is tied to multiple csvs being processed at the same time. Could that error message be tied to a request throttling from Qualtrics APIs?

If you /google that issue, it seems to stem from either a bad cert, if the message hash value has been modified en route, or a connection has changed or expired. I know Qualtrics does throttle their connections, but I don't think 3 calls at the same time runs up against that throttling. Are your API calls making more than 15 calls in 3 minutes? I don't remember if 3 minutes was the range, but it was something like that for us when we were running up against throttling limits. Qualtrics has some documentation surrounding throttling too:
image.png


Leave a Reply