hectorsq

hectorsq

Read_only problem with HTTP client

Hi,

I’ve developed a Phoenix application that functions as a REST to SOAP converter. Instead of using a SOAP client package, I’ve implemented it using pure HTTP.

The application receives a JSON message from the client approximately every two seconds, converts it to XML, and forwards it to a SOAP server (SAP).

I’m utilizing Req, which in turn utilizes Finch and Mint.

After successfully sending several hundred messages, I encounter the following errors:

%Finch.Error{reason: :read_only}

03:43:47.343 [error] #PID<0.3996.0> running ErpInterfaceWeb.Endpoint (connection #PID<0.3995.0>, stream id 1) terminated

Restarting my app, which is hosted on Fly.io, resolves the issue.

I’m unsure if there’s a problem with my application, if the external server is blocking me, or if there’s an issue with Finch.

I’ve researched the “read_only” error but haven’t found any useful information. I’m uncertain whether this signifies a problem within my app or with the external server.

I’m considering replacing Req with Tesla, hoping it might resolve the issue.

Any insights would be greatly appreciated.

Regards,
Hector Sansores

First Post!

dimitarvp

dimitarvp

According to a quick GitHub search, “the connection is closed for writing”. :thinking:

This file (the first of two matches in the GitHub search) has 26 matches of read_only, I’d go read it in more detail. (Some of the matches are actually in the symbols outline on the right but still, at least 15 matches in the file from what I’ve seen.)

And this file (the second match) implies that the server “has sent GOAWAY and then replies, we get the replies but are closed for writing” which might be I don’t know, rate limit hit? Or maybe you have inadvertently opened it in HTTP2 streaming mode without the option to write to the connection (as one of the code matches implies)?

Last Post!

al2o3cr

al2o3cr

Sounds like what would happen if you were using a connection kept open with HTTP Keepalive and the remote end decided to close anyways.

For instance, if the remote service wants to deploy a new version of their code they’d likely “drain” persistent connections to the old servers.

I wouldn’t expect that kind of thing to require a reboot though - something should be supervising the connections and reconnect them afterwards. :thinking:

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54006 488
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement