Ruby: hitting read_timeout even when changed












1















From my Ruby code il make a call to a API.
On the testsystem with few data it works without a flaw.
On the Productive System it works too, but only if not much data is transmitted. If its too much data il get:




/usr/lib/ruby/2.3.0/net/protocol.rb:158:in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from /usr/lib/ruby/2.3.0/net/protocol.rb:136:in
readuntil'
from /usr/lib/ruby/2.3.0/net/protocol.rb:146:in readline'
from /usr/lib/ruby/2.3.0/net/http/response.rb:40:in
read_status_line'
from /usr/lib/ruby/2.3.0/net/http/response.rb:29:in read_new'
from /usr/lib/ruby/2.3.0/net/http.rb:1437:in
block in transport_request'
from /usr/lib/ruby/2.3.0/net/http.rb:1434:in catch'
from /usr/lib/ruby/2.3.0/net/http.rb:1434:in
transport_request'
from /usr/lib/ruby/2.3.0/net/http.rb:1407:in `request'




the relevant part in the code seems to be:



http = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :verify_mode => OpenSSL::SSL::VERIFY_NONE, :read_timeout => @timeout)


i bumped the @timeout to 900 and id didnt work eater.



Any ideas how i can get that to work or how i can debug that issue?










share|improve this question


















  • 1





    How long does it actually take to query and receive all data from the API? Did you check that?

    – spickermann
    Nov 13 '18 at 18:01











  • It takes around 10 minutes. But with 15 minutes my setting should be safe.

    – Dorian Gaensslen
    Nov 14 '18 at 7:24











  • When do you get the timeout? After around 15 minutes or earlier – for example after 90 seconds?

    – spickermann
    Nov 14 '18 at 9:35











  • @spickermann I underestimated the duration. The script takes almost 16 minutes. after I've observed that, I altered the timeout again to 30 Minutes. I don't get the error anymore, but now the next each statement fails 18 Minutes after start, because it has no return values undefined method `each_value' for nil:NilClass (NoMethodError)

    – Dorian Gaensslen
    Nov 28 '18 at 13:12













  • There is no each_value in your question. You will need to add the relevant code to your question. What do you want to do your application instead when it runs into the timeout? Do nothing? Raise an error? Use a fallback?

    – spickermann
    Nov 28 '18 at 13:15
















1















From my Ruby code il make a call to a API.
On the testsystem with few data it works without a flaw.
On the Productive System it works too, but only if not much data is transmitted. If its too much data il get:




/usr/lib/ruby/2.3.0/net/protocol.rb:158:in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from /usr/lib/ruby/2.3.0/net/protocol.rb:136:in
readuntil'
from /usr/lib/ruby/2.3.0/net/protocol.rb:146:in readline'
from /usr/lib/ruby/2.3.0/net/http/response.rb:40:in
read_status_line'
from /usr/lib/ruby/2.3.0/net/http/response.rb:29:in read_new'
from /usr/lib/ruby/2.3.0/net/http.rb:1437:in
block in transport_request'
from /usr/lib/ruby/2.3.0/net/http.rb:1434:in catch'
from /usr/lib/ruby/2.3.0/net/http.rb:1434:in
transport_request'
from /usr/lib/ruby/2.3.0/net/http.rb:1407:in `request'




the relevant part in the code seems to be:



http = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :verify_mode => OpenSSL::SSL::VERIFY_NONE, :read_timeout => @timeout)


i bumped the @timeout to 900 and id didnt work eater.



Any ideas how i can get that to work or how i can debug that issue?










share|improve this question


















  • 1





    How long does it actually take to query and receive all data from the API? Did you check that?

    – spickermann
    Nov 13 '18 at 18:01











  • It takes around 10 minutes. But with 15 minutes my setting should be safe.

    – Dorian Gaensslen
    Nov 14 '18 at 7:24











  • When do you get the timeout? After around 15 minutes or earlier – for example after 90 seconds?

    – spickermann
    Nov 14 '18 at 9:35











  • @spickermann I underestimated the duration. The script takes almost 16 minutes. after I've observed that, I altered the timeout again to 30 Minutes. I don't get the error anymore, but now the next each statement fails 18 Minutes after start, because it has no return values undefined method `each_value' for nil:NilClass (NoMethodError)

    – Dorian Gaensslen
    Nov 28 '18 at 13:12













  • There is no each_value in your question. You will need to add the relevant code to your question. What do you want to do your application instead when it runs into the timeout? Do nothing? Raise an error? Use a fallback?

    – spickermann
    Nov 28 '18 at 13:15














1












1








1








From my Ruby code il make a call to a API.
On the testsystem with few data it works without a flaw.
On the Productive System it works too, but only if not much data is transmitted. If its too much data il get:




/usr/lib/ruby/2.3.0/net/protocol.rb:158:in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from /usr/lib/ruby/2.3.0/net/protocol.rb:136:in
readuntil'
from /usr/lib/ruby/2.3.0/net/protocol.rb:146:in readline'
from /usr/lib/ruby/2.3.0/net/http/response.rb:40:in
read_status_line'
from /usr/lib/ruby/2.3.0/net/http/response.rb:29:in read_new'
from /usr/lib/ruby/2.3.0/net/http.rb:1437:in
block in transport_request'
from /usr/lib/ruby/2.3.0/net/http.rb:1434:in catch'
from /usr/lib/ruby/2.3.0/net/http.rb:1434:in
transport_request'
from /usr/lib/ruby/2.3.0/net/http.rb:1407:in `request'




the relevant part in the code seems to be:



http = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :verify_mode => OpenSSL::SSL::VERIFY_NONE, :read_timeout => @timeout)


i bumped the @timeout to 900 and id didnt work eater.



Any ideas how i can get that to work or how i can debug that issue?










share|improve this question














From my Ruby code il make a call to a API.
On the testsystem with few data it works without a flaw.
On the Productive System it works too, but only if not much data is transmitted. If its too much data il get:




/usr/lib/ruby/2.3.0/net/protocol.rb:158:in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from /usr/lib/ruby/2.3.0/net/protocol.rb:136:in
readuntil'
from /usr/lib/ruby/2.3.0/net/protocol.rb:146:in readline'
from /usr/lib/ruby/2.3.0/net/http/response.rb:40:in
read_status_line'
from /usr/lib/ruby/2.3.0/net/http/response.rb:29:in read_new'
from /usr/lib/ruby/2.3.0/net/http.rb:1437:in
block in transport_request'
from /usr/lib/ruby/2.3.0/net/http.rb:1434:in catch'
from /usr/lib/ruby/2.3.0/net/http.rb:1434:in
transport_request'
from /usr/lib/ruby/2.3.0/net/http.rb:1407:in `request'




the relevant part in the code seems to be:



http = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :verify_mode => OpenSSL::SSL::VERIFY_NONE, :read_timeout => @timeout)


i bumped the @timeout to 900 and id didnt work eater.



Any ideas how i can get that to work or how i can debug that issue?







ruby api http timeout






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 13 '18 at 16:21









Dorian GaensslenDorian Gaensslen

64




64








  • 1





    How long does it actually take to query and receive all data from the API? Did you check that?

    – spickermann
    Nov 13 '18 at 18:01











  • It takes around 10 minutes. But with 15 minutes my setting should be safe.

    – Dorian Gaensslen
    Nov 14 '18 at 7:24











  • When do you get the timeout? After around 15 minutes or earlier – for example after 90 seconds?

    – spickermann
    Nov 14 '18 at 9:35











  • @spickermann I underestimated the duration. The script takes almost 16 minutes. after I've observed that, I altered the timeout again to 30 Minutes. I don't get the error anymore, but now the next each statement fails 18 Minutes after start, because it has no return values undefined method `each_value' for nil:NilClass (NoMethodError)

    – Dorian Gaensslen
    Nov 28 '18 at 13:12













  • There is no each_value in your question. You will need to add the relevant code to your question. What do you want to do your application instead when it runs into the timeout? Do nothing? Raise an error? Use a fallback?

    – spickermann
    Nov 28 '18 at 13:15














  • 1





    How long does it actually take to query and receive all data from the API? Did you check that?

    – spickermann
    Nov 13 '18 at 18:01











  • It takes around 10 minutes. But with 15 minutes my setting should be safe.

    – Dorian Gaensslen
    Nov 14 '18 at 7:24











  • When do you get the timeout? After around 15 minutes or earlier – for example after 90 seconds?

    – spickermann
    Nov 14 '18 at 9:35











  • @spickermann I underestimated the duration. The script takes almost 16 minutes. after I've observed that, I altered the timeout again to 30 Minutes. I don't get the error anymore, but now the next each statement fails 18 Minutes after start, because it has no return values undefined method `each_value' for nil:NilClass (NoMethodError)

    – Dorian Gaensslen
    Nov 28 '18 at 13:12













  • There is no each_value in your question. You will need to add the relevant code to your question. What do you want to do your application instead when it runs into the timeout? Do nothing? Raise an error? Use a fallback?

    – spickermann
    Nov 28 '18 at 13:15








1




1





How long does it actually take to query and receive all data from the API? Did you check that?

– spickermann
Nov 13 '18 at 18:01





How long does it actually take to query and receive all data from the API? Did you check that?

– spickermann
Nov 13 '18 at 18:01













It takes around 10 minutes. But with 15 minutes my setting should be safe.

– Dorian Gaensslen
Nov 14 '18 at 7:24





It takes around 10 minutes. But with 15 minutes my setting should be safe.

– Dorian Gaensslen
Nov 14 '18 at 7:24













When do you get the timeout? After around 15 minutes or earlier – for example after 90 seconds?

– spickermann
Nov 14 '18 at 9:35





When do you get the timeout? After around 15 minutes or earlier – for example after 90 seconds?

– spickermann
Nov 14 '18 at 9:35













@spickermann I underestimated the duration. The script takes almost 16 minutes. after I've observed that, I altered the timeout again to 30 Minutes. I don't get the error anymore, but now the next each statement fails 18 Minutes after start, because it has no return values undefined method `each_value' for nil:NilClass (NoMethodError)

– Dorian Gaensslen
Nov 28 '18 at 13:12







@spickermann I underestimated the duration. The script takes almost 16 minutes. after I've observed that, I altered the timeout again to 30 Minutes. I don't get the error anymore, but now the next each statement fails 18 Minutes after start, because it has no return values undefined method `each_value' for nil:NilClass (NoMethodError)

– Dorian Gaensslen
Nov 28 '18 at 13:12















There is no each_value in your question. You will need to add the relevant code to your question. What do you want to do your application instead when it runs into the timeout? Do nothing? Raise an error? Use a fallback?

– spickermann
Nov 28 '18 at 13:15





There is no each_value in your question. You will need to add the relevant code to your question. What do you want to do your application instead when it runs into the timeout? Do nothing? Raise an error? Use a fallback?

– spickermann
Nov 28 '18 at 13:15












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53285264%2fruby-hitting-read-timeout-even-when-changed%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53285264%2fruby-hitting-read-timeout-even-when-changed%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Full-time equivalent

Bicuculline

さくらももこ