"Error writing request to target" error

We are facing this error in Apigee on-prem 4.50 version for one particular API for brief periods of time (about 10-15 mins) each day in our Production environment. Any pointers on the possible causes for this. Could not find any details in the documentation or the troubleshooting guide.

{"fault":{"faultstring":"Error writing request to target","detail":{"errorcode":"messaging.adaptors.http.flow.ErrorWritingRequestToTarget"}}}

Found this reference on the community, but not much details there as well. https://community.apigee.com/questions/87643/error-writing-request-to-target-error.html

Any help on this is greatly appreciated.

0 5 3,311
5 REPLIES 5

This could be due to the request failing to send to the backend system?

Are you able to capture and analyze the network traffic on the Message Processor and backend? Are there any other layers in between? Is the backend or MP under excessive load at these times?

Has a load test previously been run against your backend?

Thanks Dane.

Yes Dane, the request is failing while sending to the backend system.

There are no other layers in between - Message processor talks to the app over https (one-way SSL) We analyzed from the logs that the MP is fine during those times - all other APIs that connect to other backends are functioning fine, except this specific API that is having an issue.

Yes a load test has been run in a perf test env on the backend, but not in prod.

We reached to our network team for further analysis, after we found that there was a DNS resolution issue when we try to directly connect to the backend, when this error occurred.

I will update more on the findings/resolution once we have more information from the network team.

Not applicable

error writing means, apigee is not able to write the full request to the backend. This means the request is very big or during the write process of request there is a timeout happening by the backend or message processor.

I would suggest to check the message processor log, if you can find any write time, write byte information, which will help analysing more the root casue.

Apigee shows this error when a DNS can not be resolved. You can replicate the error setting a non-existing DNS (something like "totally.fake.dns.4.testing.com") in the Target Server used by your API, and you will see that Apigee says "Error writing request to target".

I don't think this is a good idea. A non-existing DNS should have its own faultstring in Apigee, or at least any error regarding DNS resolution problems. I don't understand why Apigee mixes this with errors writing request to target, for most users that's confusing.

Hello
I was testing an API and got the same error response "Error writing request to destination".
I solved it by correcting the destination server, that was the reason why I couldn't write to the backend.
I hope it helps you.
Greetings