abhishek-ram/django-pyas2

Duplicate message because of 500 error

Closed this issue · 1 comments

Hi All,

I've got an issue with a new partner where they send the same message twice, because they receive a HTTP 500 error.
However i cannot find this 500 error on our server. I do see in the logging that we receive the 2nd (duplicate) message right before pyas2 was able the send a succesfull MDN back. It tries to process the dupilcate but fails and the parnters receives a failed MDN.

Anyone seen this behaviour before?
Here's the debug log for this issue.

`2023-09-08 10:24:48,158 pyas2 DEBUG Received an HTTP POST from 212.49.145.9 with payload : b'date: Fri, 08 Sep 2023 08:24:47 GMT\nmessage-id: O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com\n'
2023-09-08 10:24:48,158 pyas2 DEBUG Check to see if payload is an Asynchronous MDN.
2023-09-08 10:24:48,159 pyas2 DEBUG Payload is not an MDN parse it as an AS2 Message
2023-09-08 10:24:48,181 pyas2lib DEBUG Decrypting message O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com payload : b''
2023-09-08 10:24:48,186 pyas2lib DEBUG Verifying signed message O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com payload: b''
2023-09-08 10:24:48,187 pyas2lib DEBUG Building the MDN for message O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com with status processed and detailed-status None.
2023-09-08 10:24:48,188 pyas2lib DEBUG MDN report for message O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com created: b''
2023-09-08 10:24:48,189 pyas2lib DEBUG MDN generated for message O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com with content: b'Content-Transfer-Encoding: 7bit\r\n\r\nThe AS2 message has been successfully processed. Thank you for exchanging AS2 messages with pyAS2.\r\n\r\n'
2023-09-08 10:24:48,190 pyas2 INFO Received an AS2 message with id O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com for organization from partner.

2023-09-08 10:24:48,466 pyas2 DEBUG Received an HTTP POST from 212.49.145.9 with payload : b'message-id: O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com\n'
2023-09-08 10:24:48,466 pyas2 DEBUG Check to see if payload is an Asynchronous MDN.
2023-09-08 10:24:48,467 pyas2 DEBUG Payload is not an MDN parse it as an AS2 Message
2023-09-08 10:24:48,486 pyas2lib ERROR Failed to parse AS2 message
: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/pyas2lib/as2.py", line 568, in parse
"Duplicate message received, message with this ID already processed."
pyas2lib.exceptions.DuplicateDocument: Duplicate message received, message with this ID already processed.

2023-09-08 10:24:48,486 pyas2lib DEBUG Building the MDN for message O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com with status processed/Warning and detailed-status duplicate-document.
2023-09-08 10:24:48,487 pyas2lib DEBUG MDN report for message O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com created: b''
2023-09-08 10:24:48,489 pyas2lib DEBUG MDN generated for message O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com with content: b'Content-Transfer-Encoding: 7bit\r\n\r\nThe AS2 message could not be processed. The disposition-notification report has additional details.\r\n\r\n'
2023-09-08 10:24:48,489 pyas2 INFO Received an AS2 message with id O23090810244710198647742651_sedeb2b_gatewayEDI@eas.sedeb2b.com for organization from partner.`

Best regards,
Hans

I did find the issue.
pyas2 didn't had the right permissions to save the payload. after changing that it went just fine.
Would have been nice to find that somewhere in the logging:)

Thanks,
Hans