Indy idftp client "Invalid argument to time encode" - delphi

Using Delphi 2010 and Indy 10.5.8.0.
Against the server Titan FTP I'm getting all the time the exception "Invalid argument to time encode" (EConvertError) when connecting.
The server log tells me:
FEAT<EOL>
211-Extensions Supported<EOL> COMB<EOL> MLST type*;size*;modify*;create*;perm*;<EOL> SIZE<EOL> MDTM<EOL> XCRC<EOL> REST STREAM<EOL> AUTH SSL<EOL> AUTH TLS<EOL> CCC<EOL> PBSZ<EOL> PROT<EOL> EPRT<EOL> EPSV<EOL> DQTA<EOL>211 End<EOL>
TYPE A<EOL>
200 Type set to A.<EOL>
The user "*****" has initiated a session on "217.********:21"
SYST<EOL>
215 UNIX Type: L8<EOL>
SITE ZONE<EOL>
210 UTC-2147483647<EOL>
QUIT<EOL>
221 Session Ended. Downloaded 0KB, Uploaded 0KB. Goodbye *** from 130.******.<EOL>
Any ideas?

The server is sending a faulty UTC offset in response to the SITE ZONE command. That is a bug in Titan. When Indy tries to parse the value for use in later TDateTime operations, the parse fails. Contact the Titan devs and let them know about the bug. In the meantime, I will look into updating TIdFTP to handle that error in the future.

Related

WSO2 token generation, /oauth2/token service failing after 20th request been hit

I am using WSO2 for token generation. By using this console: https://localhost:9443/carbon/admin/login.jsp
I am calling http://localhost:9763**/oauth2/token** service by passing required parameters
<{username=[], password=[], grant_type=[password], client_id=[], client_secret=[], scope=[]},[Content-Type:"application/x-www-form-urlencoded"]> after 20th request its failing and giving below error.
{ErrorMessage: I/O error on POST request for "http://192.168.200.83:9763/oauth2/token": Connection reset; nested exception is java.net.SocketException: Connection reset.}
How can I increase the number of requests to be served from 20 to 50 or more?

NoHttpResponseException is a retriable exception?

We implemented connection pooling in our client code to invoke a server which closes(sends Connection:close in response headers) a connection after 2.5mins. Due to server behaviour we sometimes/intermittently get NoHttpResponseException. And this may occur at high TPS or at low TPS as well.
We are using apache http client version 4.5.11. And there is one validateAfterInactivity setting in PoolingHttpClientConnectionManager which is by-default set to 2000ms. But i think we may get same exception if we try to get the connection in 2000ms period.
We can choose to set aggressive value for validateAfterInactivity but i heard that it can degrade the performance by ~20 to 30ms for each request.
is retrying this exception a good solution ?
And also align to same context, can we retry in case of java.net.SocketException: Connection reset ?
#ok2c any suggestion here ?
Thanks in advance.
NoHttpResponseException is considered safe to retry for idempotent methods.
In your particular case however I would consider limiting the TTL (total to live) of client connections to 2.5 minutes to match that of the server endpoints.

wso2 esb how to increase endpoint timeout

I have JMS queue message processor sequence where request is send to SOAP endpoint. However request to this endpoint can take a long time, up to 30 minutes or so. How can I can configure ESB to allow long timeout values ? Currently I'm getting following error after 60 seconds:
[2014-01-20 14:18:31,772] WARN - TargetHandler http-outgoing-4: Connection time out while in state: REQUEST_DONE
[2014-01-20 14:18:31,775] WARN - SynapseCallbackReceiver Synapse received a response for the request with message Id : urn:uuid:c6a023c2-7fb4-4321-b1c2-d78e9bb13add But a callback is not registered (anymore) to process this response
Thanks for any help
Edit: I added http.socket.timeout=1800000 -property in repository/conf/passthru-http.properties which seems to solve the timeout issue.
Assuming this is a "Scheduled Message Forwarding Processor", to increase the send timeout up to 30 minutes :
In your endpoint, verify that "connection timeout" is "never
timeout" (edit the endpoint in the console and "Show Advanced
options")
Edit repository/conf/synapse.properties and modify
synapse.global_timeout_interval (in ms) : this is the maximum time a
callback instance will exist in wso2 to receive the response
copy the sample axis2 conf file
from samples/axis2Client/client_repo/conf/axis2.xml to, for example,
repository/conf/axis2/axis2_mp.xml
Edit this axis2_mp.xml config, find
transportSender name="http" and add a parameter "SO_TIMEOUT" (in ms) : <parameter name="SO_TIMEOUT" locked="false">108000000</parameter>
Edit your Message Processor and in Show Additional Parameters, specify the entry "Axis2 Configuration" to repository/conf/axis2/axis2_mp.xml
SO_TIMEOUT is the time to wait for the response.
You can specify CONNECTION_TIMEOUT for the max time to establish the connection.
Pay attention : all callbacks will persist up to 30 minutes in the ESB !

Mirth Connect HTTP Listener Mapping Response ACK message

We are trying to merge two Mirth servers. One server (let's call it Server 1) is keeping all records and another server (Server 2) is getting HL7 message from the first one and writes messages to the database.
Everything was perfect so far. But Server 1, after sending each HL7 message, waits for ACK to consider this transaction as completed and to send another message from the list.
The success status coming from the Server 2 (which writes to the database) contains MySQL response such as "Success: Database write success. 1 rows updated.". This is not what Server 1 is expecting.
Therefore, the Server 1 considers this ACK as invalid, produces an error "Message Read Error - Will Retry" and keeps trying to send the same message again, causing Server 2 to duplicate messages in the database.
We are using Mirth Connect HTTP listener and we could not find any solution to send ACK msg to our first server the same screen HTTP listener.
Is there any way to do this? Any Suggestion?
Really need help.
The problem is you are not setting the response from server 2 correctly, so it just returns what the destination has. You can create an ACK by code on the destination transformer:
var ackMessage = ACKGenerator.generateAckResponse(connectorMessage.getRawData(), "AA", "Message Successfully Received");
responseMap.put("ackresp", ResponseFactory.getSentResponse(ackMessage));
And on your source connector select "ackresp" as response. Your server 1 will receive that ACK instead of the log of the database write.

Get extended error information when an error 11004 occurs using TIdSmtp.Connect() method?

I have a Delphi 6 application that sends E-mails with attachments. When I first tested it I got an 11004 error (policy violation) when I called TIdSmtp.Connect(). It turned out my E-mail server SMTP setting were wrong and now it works fine. But know my users are going to run into trouble and I'd like to know if there is a way to get more extensive error information back from the SMTP server via the Indy components to help with my debugging efforts. I am using Indy 9 with Delphi 6.
Is there a way to get a much richer report and find out what the probable cause for the error is? (e.g. - SSL required, From field not filled in, rejected domain, etc). Also, same question but when an error occurs on the TIdSmtp.Send() method?
EIdSMTPReplyError is raised in response to an error message from the SMTP server at the SMTP protocol layer. 11004 is a socket/DNS error, not an SMTP error. There would be no additional error information available other than the basic OS error message (which you can get from SysErrorMessage()):
The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for.
Regarding TIdSMTP.Send(), you can look for EIdSMTPReplyError exceptions, eg:
try
IdSMTP1.Connect;
try
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect;
end;
except
on E: EIdSMTPReplyError do
Application.MessageBox(
PChar(
'Error message: ' + E.Message + sLineBreak +
'Error code: ' + IntToStr(E.ErrorCode) + sLineBreak +
'Error reply: ' + E.EnhancedCode.ReplyAsStr
),
'SMTP Error...', MB_OK + MB_ICONSTOP + MB_TOPMOST);
end;
That will help some, and if the server supports Extended Error Codes then you might get a little bit closer. But more times then not, you will not likely be able to distinquish EXACTLY what went wrong without looking at the actual SMTP command/response traffic over the wire.
Regarding SSL/TLS errors in particular, one of several different things may happen, depending on your TIdSMTP configuration:
1) you might get a general EIdSocketError exception raised, like with your 11004 error.
2) You might get an EIdSMTPReplyError exception with a malformed error code if you connect to a server port that requires Implicit SSL/TLS but you do not have TIdSMTP.UseTLS set to utUseImplicitTLS.
2) You might get an EIdOSSLConnectError or other OpenSSL-related exception if you have UseTLS=utUseImplicitTLS assigned but the server is not expecting Implicit SSL/TLS.
3) You have UseTLS set to either utUseExplicitTLS or utRequiresTLS and the server supports Explicit TLS, but the SSL/TLS handshake fails for whatever reason, you will get a TIdSMTP.OnTLSHandShakeFailed event triggered only for utUseExplicitTLS. If the event handler does not set VContinue=True, or you used utRequiresTLS, you will get an EIdTLSClientTLSHandShakeFailed exception raised.
4) You have UseTLS set to either utUseExplicitTLS or utRequiresTLS and the server does not support Explicit TLS, you will get a TIdSMTP.OnTLSNotAvailable event triggered for utUseExplicitTLS only. If the event handler does not set VContinue=True, or you used utRequiresTLS, you will then get an EIdTLSClientTLSNotAvailable exception raised.

Resources