Skip to content

Resending a message several times and failing after retry limit doesn't move the message to the /data/outbox/error-folder #418

@markieww

Description

@markieww

Issue

I noticed an issue, when sending a message to an AS2 server which rejects the message.

The AS2 server responds with a synchronous negative MDN, thus OpenAS2 renames the original message and resends the message. The AS2 server rejects the message again with a MDN and so on... After the retry limit has been reached there is no trace of the "original" message in the filesystem.

Only some WARN/ERRORs in the log like

WARN  org.openas2.util.AS2Util -- Cleanup could not find pendinginfo file: /opt/openas2/bin/../config/../data/pendinginfoMDN3/20250314152915+0100-477-AAAAID_BBBBID_555555.txt
...
ERROR org.openas2.util.AS2Util -- Error moving file to /opt/openas2/bin/../config/../data/outbox/error/2025-03-14/BBBBID : Source '/opt/openas2/bin/../config/../data/pendingMDN3/20250314152915+0100-477-AAAAID_BBBBID_555555.txt' does not exist

(Pasted here to allow others to find this issue by the error message)

Reproduction

See my annotated screenshot of a minimal example:

Image

The flow is

  1. the message in the filesystem is found and assigned a message number 477 (marked as red for illlustration) and send
  2. a negative MDN is received, 477 is renamed to 635 (marked as blue) and put into the resend queue
  3. !!! First issue: Cleanup could not find pendinginfo file: for a file 477
  4. 635 is picked up for sending
  5. a negative MDN is received, the retry limit has been reached and the resending process is aborted
  6. !!! Second issue: Error moving file to .... outbox/error/ for a file 477
  7. Neither 477 nor 635 is found the filesystem below /data

Analysis

You fixed similar issues in

Perhaps you missed that edge case?

Especially the Pending MDN MSG FILE deleted code introduced https://github.com/OpenAS2/OpenAs2App/pull/394/files#diff-36957f051b53aa4ba9e4c8756ee720e75b1674b945c3c6cad875781175a1981eR775 looks suspicious. The Pending MDN MSG FILE code deletes the file which is missing later.

Pending MDN MSG FILE deleted: /opt/openas2/bin/../config/../data/pendingMDN3/20250314152915+0100-477-AAAAID_BBBBID_555555.txt [<20250314152915+0100-477-AAAAID_BBBBID_555555.txt>]`
...
Error moving file to /opt/openas2/bin/../config/../data/outbox/error/2025-03-14/BBBBID : Source '/opt/openas2/bin/../config/../data/pendingMDN3/20250314152915+0100-477-AAAAID_BBBBID_555555.txt' does not exist

Environment

OpenAS2 4.0.x, Temurin 17

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