3

I am getting this bizarre error when I try to run an UPDATE statement against a PostgreSQL database. I can't figure out what I even changed that is causing it, and I'm suspecting is a coincidental system error that is ancillary to something else I broke and fixed.

I'm literally at the "see if a reboot fixes it" point, but I want to know if anyone can tell me what this error means. I don't really understand sockets or transport interfaces very well.

Exception while reading from stream
Inner exception:
Unable to read data from the transport connection: Operation on non-blocking socket would block. 
Inner exception: Operation on non-blocking socket would block
7
  • 3
    Nothing in the PostgreSQL code would throw such an error. In what language is the client code written (tag!) and what does the code look like? Commented Sep 26, 2018 at 21:12
  • @LaurenzAlbe I deliberately didn't paste my code because the error is so crazy that the nearest relevant code doesn't look like anything that would cause that error. I have written this same type of code hundreds of times as boilerplate without ever having this problem. But since you said nothing in PostgreSQL could throw such an error, that helps. I'm reverting to an older commit to see if that fixes the problem. Then maybe I can figure out how I broke it. Commented Sep 26, 2018 at 21:20
  • 1
    Ok. I mean, how can anybody answer a question like that without the faintest clue what you are doing? Commented Sep 26, 2018 at 21:22
  • @LaurenzAlbe Actually, your answer was extremely helpful. It told me that PostgreSQL shouldn't be the problem. :) But adding to that, I actually did revert to a commit of the code that was working fine, and the error still persists. Something apparently got very screwed up in my environment. I'm gonna have to try numerous things. Commented Sep 26, 2018 at 21:24
  • @LaurenzAlbe Thank you for your help! :) It turned out the problem was indeed some kind of bizarre server environment problem. We changed one of our VPS hardware settings and something about that changed started throwing this error. Reverting the setting fixed the problem. It should have had nothing to do with the error! I would have kept thinking it was PostgreSQL had you not told me to look elsewhere. :) Problem solved! Commented Sep 27, 2018 at 1:25

1 Answer 1

6

It has been many months since I had this problem. I actually DID solve it, but I forgot to add an answer. I'm attempting to add an answer now.

As I recall, the problem was simply an ordinary timeout problem. I had to increase one of the timeout settings (of which there are multiple) for PostgreSQL on my Connection parameters object.

EDIT: I should add that I was working with NpgSql at the time.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.