Have you tried the steps in the troubleshooting section of the AS2 guide?
Is this a new partner or is this suddenly happening when the partner was working for some time?
First step is to remove the compression attribute.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been using since 2005, I compared previous properties no changes.
I removed <attribute name="compression_type" value="ZLIB"> here is the log:</attribute>
2022-07-16 06:49:38.184 ERROR AS2SenderModule: Unexpected error sending file: In
valid header: HTTP/1.1 404 Service Not Available [OPENAS2-16072022064823-0500-d
8218503-165c-49d4-9a8a-f810d0040f10@ARNE-DIST_001948520]
org.apache.http.client.ClientProtocolException
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttp
Client.java:187)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp
Client.java:83)
at org.openas2.util.HTTPUtil.execRequest(HTTPUtil.java:384)
at org.openas2.processor.sender.AS2SenderModule.sendMessage(AS2SenderMod
ule.java:190)
at org.openas2.processor.sender.AS2SenderModule.handle(AS2SenderModule.j
ava:133)
at org.openas2.processor.DefaultProcessor.handle(DefaultProcessor.java:5
5)
at org.openas2.processor.resender.DirectoryResenderModule.processFile(Di
rectoryResenderModule.java:189)
at org.openas2.processor.resender.DirectoryResenderModule.resend(Directo
ryResenderModule.java:109)
at org.openas2.processor.resender.BaseResenderModule$PollTask.run(BaseRe
senderModule.java:37)
at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
at java.base/java.util.TimerThread.run(Timer.java:516)
Caused by: org.apache.http.ProtocolException: Invalid header: HTTP/1.1 404 Servi
ce Not Available
at org.apache.http.impl.io.AbstractMessageParser.parseHeaders(AbstractMe
ssageParser.java:230)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessagePa
rser.java:266)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHead
er(DefaultBHttpClientConnection.java:163)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRe
questExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecu
tor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.
java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java
:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java
:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttp
Client.java:185)
... 10 more
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try this solution defined in section 14.5 of the 3.2.1 OpenAS2HowTo.pdf:
14.5. Content Length Versus Chunked
OpenAS2 will send all messages using the “chunked” mechanism whereby the actual size of the payload is not pre-determined and sent as a header ”Transfer-Encoding=chunked”. Some systems cannot handle the chunked mechanism (it was standardized in HTTP 1.1) and require the “Content-Length” header is used instead. To make OpenAS2 use the “Content-Length” header method, set the following attribute on the partnership that needs it:
<attribute name="prevent_chunking" value="true"></attribute>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
NOTE: Setting this attiribute will have a negative impact on performance for the larger the files are that are being transferred so it should only be set when needed.
Last edit: Christopher Broderick 2022-07-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you confirm if the file already exists in the C:\OpenAS2\config..
\data\xxxxxx\sent\2022\07 folder?
It is likely that the cleanup method had already been called and this is a 2nd call.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been getting following error message from trading partner. They bave no clue how to fix it.
2022-07-15 19:14:46.098 ERROR AS2SenderModule: Error sending message. URL: http:
//as2.xxxxxx:1881 ::: Response Code: 500 Internal server error ::: Response
Message: [B@2ce6959a [OPENAS2-15072022191444-0500-b1e8de5e-7f63-45f2-89d1-48284 23a1e4e@zzzz-ddddddnnnnnn]
I also have the following attributes:
<partnership name="XXXX-YYYY">
<pollerconfig enabled="true" outboxdir="$properties.storageBaseDir$\toYYYY" errordir="$properties.storageBaseDir$\toYYYYY\error\$date.YYYY$\$date.MM$" sendfilename="true" sentdir="$properties.storageBaseDir$\$partnership.sender.as2_id$-$partnership.receiver.as2_id$\sent\$date.YYYY$\$date.MM$" stored_error_filename="$msg.attributes.filename$-$date.YYYY$-$date.MM$-$msg.headers.message-id$" stored_sent_filename="$msg.attributes.filename$-$msg.headers.message-id$">
<sender name="XXXX">
<receiver name="YYYY">
<attribute name="protocol" value="as2">
<attribute name="content_transfer_encoding" value="binary">
<attribute name="compression_type" value="ZLIB">
<attribute name="no_chunked_max_size" value="104857600">
<attribute name="subject" value="File $attributes.filename$ sent from $sender.name$ to $receiver.name$">
<attribute name="as2_url" value="YYYY">
<attribute name="as2_mdn_to" value="http://localhost:5080">
<attribute name="as2_mdn_options" value="signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, $attribute.sign$">
<attribute name="encrypt" value="3DES">
<attribute name="sign" value="SHA256">
<attribute name="resend_max_retries" value="3">
<attribute name="prevent_canonicalization_for_mic" value="false">
<attribute name="rename_digest_to_old_name" value="true">
<attribute name="remove_cms_algorithm_protection_attrib" value="false">
</attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></receiver></sender></pollerconfig></partnership>
i am in 3.2.1
Have you tried the steps in the troubleshooting section of the AS2 guide?
Is this a new partner or is this suddenly happening when the partner was working for some time?
First step is to remove the compression attribute.
I have been using since 2005, I compared previous properties no changes.
I removed <attribute name="compression_type" value="ZLIB"> here is the log:</attribute>
2022-07-16 06:49:38.184 ERROR AS2SenderModule: Unexpected error sending file: In
valid header: HTTP/1.1 404 Service Not Available [OPENAS2-16072022064823-0500-d 8218503-165c-49d4-9a8a-f810d0040f10@ARNE-DIST_001948520]
org.apache.http.client.ClientProtocolException
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttp
Client.java:187)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp
Client.java:83)
at org.openas2.util.HTTPUtil.execRequest(HTTPUtil.java:384)
at org.openas2.processor.sender.AS2SenderModule.sendMessage(AS2SenderMod
ule.java:190)
at org.openas2.processor.sender.AS2SenderModule.handle(AS2SenderModule.j
ava:133)
at org.openas2.processor.DefaultProcessor.handle(DefaultProcessor.java:5
5)
at org.openas2.processor.resender.DirectoryResenderModule.processFile(Di
rectoryResenderModule.java:189)
at org.openas2.processor.resender.DirectoryResenderModule.resend(Directo
ryResenderModule.java:109)
at org.openas2.processor.resender.BaseResenderModule$PollTask.run(BaseRe
senderModule.java:37)
at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
at java.base/java.util.TimerThread.run(Timer.java:516)
Caused by: org.apache.http.ProtocolException: Invalid header: HTTP/1.1 404 Servi
ce Not Available
at org.apache.http.impl.io.AbstractMessageParser.parseHeaders(AbstractMe
ssageParser.java:230)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessagePa
rser.java:266)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHead
er(DefaultBHttpClientConnection.java:163)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRe
questExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecu
tor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.
java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java
:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java
:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttp
Client.java:185)
... 10 more
Does the partner get any log message on their end?
Note that your first post showed a HTTP 500 error and the latest is a HTTP 404 so something seems unstable on the remote end.
remote
Downgraded from 3.2.1 to 3.1.0 error went away. Here is the log from trading partner:
Attached
Try this solution defined in section 14.5 of the 3.2.1 OpenAS2HowTo.pdf:
14.5. Content Length Versus Chunked
OpenAS2 will send all messages using the “chunked” mechanism whereby the actual size of the payload is not pre-determined and sent as a header ”Transfer-Encoding=chunked”. Some systems cannot handle the chunked mechanism (it was standardized in HTTP 1.1) and require the “Content-Length” header is used instead. To make OpenAS2 use the “Content-Length” header method, set the following attribute on the partnership that needs it:
<attribute name="prevent_chunking" value="true"></attribute>
I changed following attribute in 3.2.1 :
<attribute name="prevent_chunking" value="true"></attribute>
It worked - all good now. No other places need changes, right? Thank you
It will be partner specific - any partner running old versions of AS2 implementations may need this attribute.
NOTE: Setting this attiribute will have a negative impact on performance for the larger the files are that are being transferred so it should only be set when needed.
Last edit: Christopher Broderick 2022-07-28
<partnership name="xxx-yyy">
<pollerconfig enabled="true" outboxdir="$properties.storageBaseDir$\toYYY" errordir="$properties.storageBaseDir$\toYYY\error\$date.YYYY$\$date.MM$" sendfilename="true" sentdir="$properties.storageBaseDir$\$partnership.sender.as2_id$-$partnership.receiver.as2_id$\sent\$date.YYYY$\$date.MM$" stored_error_filename="$msg.attributes.filename$-$date.YYYY$-$date.MM$-$msg.headers.message-id$" stored_sent_filename="$msg.attributes.filename$-$msg.headers.message-id$">
<sender name="XXX">
<receiver name="YYY">
<attribute name="protocol" value="as2">
<attribute name="content_transfer_encoding" value="binary">
<attribute name="compression_type" value="ZLIB">
<attribute name="no_chunked_max_size" value="104857600">
<attribute name="prevent_chunking" value="true">
<attribute name="subject" value="File $attributes.filename$ sent from $sender.name$ to $receiver.name$">
<attribute name="as2_url" value="XXX">
<attribute name="as2_mdn_to" value="http://localhost:5080">
<attribute name="as2_mdn_options" value="signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, $attribute.sign$">
<attribute name="encrypt" value="3DES">
<attribute name="sign" value="SHA256">
<attribute name="resend_max_retries" value="3">
<attribute name="prevent_canonicalization_for_mic" value="false">
<attribute name="rename_digest_to_old_name" value="true">
<attribute name="remove_cms_algorithm_protection_attrib" value="false">
</attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></attribute></receiver></sender></pollerconfig></partnership>
What other changes do you recommend?
You should remove "no_chunked_max_size" - if the file size reches that value then it will send chunked and will fail.
no_chunked_max_size - removed
One more issue:
2022-07-28 17:45:53.762 ERROR AS2Util: Error moving file to C:\OpenAS2\config..
\data\xxxxxx\sent\2022\07 : Source 'C:\OpenAS2\config..\data\pendi
ngMDN3\OPENAS2-28072022174552-0500-f5b051a7-badf-4ced-8f1b-cf0672d46a55@
' does not exist [OPENAS2-28072022174552-0500-f5b051a7-badf-4ced-8f1 b-cf0672d46a55@xxx]
java.io.FileNotFoundException: Source 'C:\OpenAS2\config..\data\pendingMDN3\OPE
NAS2-28072022174552-0500-f5b051a7-badf-4ced-8f1b-cf0672d46a55@xxxx' does not exist
Can you confirm if the file already exists in the C:\OpenAS2\config..
\data\xxxxxx\sent\2022\07 folder?
It is likely that the cleanup method had already been called and this is a 2nd call.
Only file exists in this folder:
C:\OpenAS2\data\XXXX-YYYY\sent\2022\07\E850094.txt-OPENAS2-29072022082130-0500-80d03a61-da51-48e6-a6cd-0263064f54dc@XXXX_YYYY
-da51-48e6-a6cd-0263064f54dc@XXX_YYYY [OPENAS2-29072022082130-0500-8 0d03a61-da51-48e6-a6cd-0263064f54dc@XXXX_YYYY]
2022-07-29 08:21:31.949 ERROR AS2Util: Error moving file to C:\OpenAS2\config..
\data\XXXX-YYYY\sent\2022\07 : Source 'C:\OpenAS2\config..\data\pendi
ngMDN3\OPENAS2-29072022082130-0500-80d03a61-da51-48e6-a6cd-0263064f54dc@XXXX_YYYY' does not exist [OPENAS2-29072022082130-0500-80d03a61-da51-48e6-a6c d-0263064f54dc@XXXX_YYYY]
java.io.FileNotFoundException: Source 'C:\OpenAS2\config..\data\pendingMDN3\OPE
NAS2-29072022082130-0500-80d03a61-da51-48e6-a6cd-0263064f54dc@_YYYY' does not exist
Last edit: Chikna 2022-07-29
FYI , DATA folder has only INBOX after deleting all files. I restarted the app and all files recreted amd