Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async MDN isn't working in version 4.4.4 (Missing start boundary) #97

Closed
ihudedi opened this issue Oct 7, 2019 · 44 comments
Closed

Async MDN isn't working in version 4.4.4 (Missing start boundary) #97

ihudedi opened this issue Oct 7, 2019 · 44 comments
Assignees
Labels

Comments

@ihudedi
Copy link

ihudedi commented Oct 7, 2019

Hi Philip,
When I try to perfrom async mdn I am failing in :
2019-10-07 16:05:43,199 DEBUG [AS2ConnectionThread-AS2MftMDNReceiverModule] (BCCryptoHelper:685) - BCCryptoHelper.verify; X509 subject=CN=CTM_MFT,OU=CONTROL-MaD,O=BMC Software Ltd.,L=Houston,ST=TX,C=US; useCertificateInBodyPart=true; forceVerify=false
2019-10-07 16:05:43,201 INFO [AS2ConnectionThread-AS2MftMDNReceiverModule] (OpenAS2Exception:118) - OpenAS2 NetException terminated: Address = /127.0.0.1 port = 56675
com.helger.as2lib.exception.WrappedOpenAS2Exception: javax.mail.internet.ParseException: Missing start boundary
at com.helger.as2lib.exception.WrappedOpenAS2Exception.wrap(WrappedOpenAS2Exception.java:66) ~[as2-lib-4.4.4.jar!/:4.4.4]
at com.helger.as2lib.processor.receiver.net.AS2MDNReceiverHandler.receiveMDN(AS2MDNReceiverHandler.java:291) ~[classes!/:4.4.4]
at com.helger.as2lib.processor.receiver.net.AS2MDNReceiverHandler.handle(AS2MDNReceiverHandler.java:173) [classes!/:4.4.4]
at com.helger.as2lib.processor.receiver.AbstractActiveNetModule$ConnectionThread.run(AbstractActiveNetModule.java:264) [as2-lib-4.4.4.jar!/:4.4.4]
Caused by: javax.mail.internet.ParseException: Missing start boundary
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:680) ~[javax.mail-1.6.2.jar!/:1.6.2]
at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:698) ~[javax.mail-1.6.2.jar!/:1.6.2]
at com.helger.as2lib.crypto.BCCryptoHelper.verify(BCCryptoHelper.java:696) ~[as2-lib-4.4.4.jar!/:4.4.4]
at com.helger.as2lib.util.AS2Helper.parseMDN(AS2Helper.java:404) ~[as2-lib-4.4.4.jar!/:4.4.4]
at com.helger.as2lib.processor.receiver.net.AS2MDNReceiverHandler.receiveMDN(AS2MDNReceiverHandler.java:238) ~[classes!/:4.4.4]
... 2 more

Do you know how to solve this issue?
Thanks,
Itay

@ihudedi ihudedi changed the title Async MDN isn't working in version 4.4.4 Async MDN isn't working in version 4.4.4 (Missing start boundary) Oct 7, 2019
@phax phax self-assigned this Oct 7, 2019
@phax phax added the question label Oct 7, 2019
@phax
Copy link
Owner

phax commented Oct 7, 2019

Hi,
do you eventually have an incoming dump of the message?
It seems like the MDN is not a MIME message but might be something else like plain text or so?

@ihudedi
Copy link
Author

ihudedi commented Oct 7, 2019

Hi,
In sync mode the mdn is returned fine.I didnt modify code.It was working in the previous version.

@ihudedi
Copy link
Author

ihudedi commented Oct 7, 2019

In version 4.4.2 the sync is also not working and getting disposition type is null.

@phax
Copy link
Owner

phax commented Oct 7, 2019

Okay, do you have the dump of the incoming MDN for evaluation?

@ihudedi
Copy link
Author

ihudedi commented Oct 7, 2019

Hi,
Where do I find the incoming mdn? The mdn that stored in the server before resend him?

@phax
Copy link
Owner

phax commented Oct 7, 2019

That depends on your setup... and the setup of the sending side.
See the system properties for how to dump incoming messages: https://github.com/phax/as2-lib/wiki/Running

@ihudedi
Copy link
Author

ihudedi commented Oct 7, 2019

ASYNC-as2-incoming-1570473703393-0.http.log
ASYNC-as2-incoming-1570473703565-0.http.log
SYNC-as2-incoming-1570473512359-0.http.log
SYNC-as2-incoming-1570473512422-0.http.log

Attached 4 files from incoming dump.
2 files are sync method that wroks fine ( I modify the file to be SYNC)
2 files are asynced that not working( ASYNC file)
Thanks,
Itay
Please let me know how to resolve the issue.
Thanks a lot,
Itay

@phax
Copy link
Owner

phax commented Oct 8, 2019

It contains the error message "Large File Support: body was not read yet". That means that dumping is not possible :(

@phax
Copy link
Owner

phax commented Oct 8, 2019

The last file contains data. And there you can see, that they are sending the header with a newline:

Content-Type: multipart/report; report-type=disposition-notification; 
  boundary="----=_Part_30_418994727.1570473512375"

May that be the cause for that?

@ihudedi
Copy link
Author

ihudedi commented Oct 8, 2019

Last file is sync mode.its working fine.I am testing the async mode via as2 server - sending from client to server and server send back to the same host for return the mdn.only as2 server of you not external as2 server.

@ihudedi
Copy link
Author

ihudedi commented Oct 8, 2019

Dont know how to proceed.it was working fine 2-3 months ago.

@phax
Copy link
Owner

phax commented Oct 8, 2019

Thank you for the explanation. Will check

@ihudedi
Copy link
Author

ihudedi commented Oct 10, 2019

If you have any fix for this issue.Please let me know.
Thanks,
Itay

@phax
Copy link
Owner

phax commented Oct 10, 2019

Sure of course. I'm tracking it down...

@ihudedi
Copy link
Author

ihudedi commented Oct 16, 2019

Any updates?

@phax
Copy link
Owner

phax commented Oct 21, 2019

Can you please try with 4.4.6 - I tried to aligned header handling between receiving and async MDN. thx

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

Hi philip,
same issue for 4.4.6
com.helger.as2lib.exception.WrappedOpenAS2Exception: javax.mail.internet.ParseException: Missing start boundary
at com.helger.as2lib.exception.WrappedOpenAS2Exception.wrap(WrappedOpenAS2Exception.java:66) ~[as2-lib-4.4.6.jar!/:4.4.6]
at com.helger.as2lib.processor.receiver.net.AS2MDNReceiverHandler.receiveMDN(AS2MDNReceiverHandler.java:303) ~[classes!/:4.4.6]
at com.helger.as2lib.processor.receiver.net.AS2MDNReceiverHandler.handle(AS2MDNReceiverHandler.java:185) [classes!/:4.4.6]
at com.helger.as2lib.processor.receiver.AbstractActiveNetModule$ConnectionThread.run(AbstractActiveNetModule.java:264) [as2-lib-4.4.6.jar!/:4.4.6]
Caused by: javax.mail.internet.ParseException: Missing start boundary
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:656) ~[jakarta.mail-1.6.4.jar!/:1.6.4]
at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:674) ~[jakarta.mail-1.6.4.jar!/:1.6.4]
at com.helger.as2lib.crypto.BCCryptoHelper.verify(BCCryptoHelper.java:698) ~[as2-lib-4.4.6.jar!/:4.4.6]
at com.helger.as2lib.util.AS2Helper.parseMDN(AS2Helper.java:404) ~[as2-lib-4.4.6.jar!/:4.4.6]
at com.helger.as2lib.processor.receiver.net.AS2MDNReceiverHandler.receiveMDN(AS2MDNReceiverHandler.java:250) ~[classes!/:4.4.6]
... 2 more
Hi Philip,
I attach the server log regarding async operation.
Maybe you will find something.

async.log

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

Hi Philip,
I attach the server log regarding async operation.
Maybe you will find something.

@phax
Copy link
Owner

phax commented Oct 22, 2019

The log is interesting. The boundary at the end is missing. I'm checking if a flush is missing

@phax
Copy link
Owner

phax commented Oct 22, 2019

I added an explicit flush on async MDN. Can you pls test with the 4.4.7-SNAPSHOT version?

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

Hi Philip,
Another thing I saw that you are using
javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:656) ~[jakarta.mail-1.6.4.jar!/:1.6.4]
and not using the javax.mail-1.6.1.jar or later as you used in older versions

@phax
Copy link
Owner

phax commented Oct 22, 2019

Yes, that is correct, because the Jakarta-artefacts are replacing the old Sun Java EE artefacts (as part of the migration to Eclipse). So this is functionally the same, just a new name

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

Hi Philip,
I can't download the snapshot version in my office.could you register it as version not snapshot?

@phax
Copy link
Owner

phax commented Oct 22, 2019

Can you manually download from https://oss.sonatype.org/content/repositories/snapshots/com/helger/as2-lib/4.4.7-SNAPSHOT/ - I don't want to make a release that does not work ;-)
And than use it locally as 4.4.7 with this: https://stackoverflow.com/questions/44697389/run-maven-build-with-manually-downloaded-dependencies
hth

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

The fix is in as2-lib.jar ?

@phax
Copy link
Owner

phax commented Oct 22, 2019

Hopefully. I want you to test before I release :D

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

So I need to replace as2-lib.jar and as2-server.jar and that is?

@phax
Copy link
Owner

phax commented Oct 22, 2019

Yes exactly. Just grab them from oss.sonatype.org and replace them. Than test pls :)

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

Same issue.
Attahch log.
I replace in my env the 4.4.6 version with latest 4.4.7-snapshot
async.log

@phax
Copy link
Owner

phax commented Oct 22, 2019

Okay, I tried to fix it. The sending of the async MDN happened asynchronously what makes no sense and causes a lot of issues (as you can see in your logfile). So I made the sending synchronously, especially because the "async" in "async MDN" only refers to the receipt of the original message, but not to the sending process itself.
Additionally I added a missing unification (avoid multiline values) that should do the trick.
So please download again the JAR files (filename is "...-6...") and try one more time. If it works now, I will build a release asap.

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

HI Philip,
It solved the issue.
Please also in AS2SenderModule::storePendingInfo

final String sPendingFolder = FilenameHelper.getAsSecureValidASCIIFilename (getSession ().getMessageProcessor ()
.attrs ()
.getAsString (ATTR_PENDINGMDNINFO));
final String sMsgFilename = AS2IOHelper.getFilenameFromMessageID (aMsg.getMessageID ());
final String sPendingFilename = FilenameHelper.getAsSecureValidASCIIFilename (getSession ().getMessageProcessor ()
.attrs ()
.getAsString (ATTR_PENDINGMDN)) +
"/" +
sMsgFilename;

remove the call to getAsSecureValidASCIIFilename for folders.it's needed for filenames becasue
sPendingFolder can be start with \
also for sPendingFilename that contains the folder name.

Thanks a lot ,
Itay

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

Please let me know when the 4.4.7 release can be ready for download including the minor fix in AS2SenderModule

@phax
Copy link
Owner

phax commented Oct 22, 2019

Thanks for testing - will do :)

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

I am really need this version.When you finish repack the version just email me.
Thanks a lot for your time and dedication.
Really appreciate.
Itay

@phax
Copy link
Owner

phax commented Oct 22, 2019

Release 4.4.7 is available, fixing both issues

@phax phax closed this as completed Oct 22, 2019
@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

Hi Philip,
I can't set mdnpendinginfo or mdmpending as Z:\test
: can be in the drive for windows
In addiiton modify this line
aWriter.write (aMIC.getAsAS2String () + "\n" + sPendingFilename);
to
aWriter.write(aMIC.getAsAS2String() + System.lineSeparator() + sPendingFilename);

phax added a commit that referenced this issue Oct 22, 2019
phax added a commit that referenced this issue Oct 22, 2019
@phax
Copy link
Owner

phax commented Oct 22, 2019

4.4.8-SNAPSHOT does the trick

@ihudedi
Copy link
Author

ihudedi commented Oct 22, 2019

Hi Philip, could you please create version 4.4.8? I would like to use this version.10x:)

@ihudedi
Copy link
Author

ihudedi commented Oct 23, 2019

Thanks for the quick response
Waiting for release 4.4.8

@ihudedi
Copy link
Author

ihudedi commented Oct 23, 2019

Is it possible to issue 4.4.8?

@phax
Copy link
Owner

phax commented Oct 23, 2019

yes later. I am on vacation. .

@ihudedi
Copy link
Author

ihudedi commented Oct 23, 2019

10x:) really appreciate your help.

@phax
Copy link
Owner

phax commented Oct 23, 2019

4.4.8 is out. New requests as new issue pls. Thx.

@ihudedi
Copy link
Author

ihudedi commented Oct 24, 2019

10x a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants