New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uninitialized constant OpenSSL::SSL::SSLErrorWaitReadable #103
Comments
Hello! I noticed the same kind of issues yesterday: YouTube API was having problems and glitches and would not let me retrieve data. I tried your same query today and it worked… try again and tell me what you see, thanks! [6] pry(main)> v = Yt::Video.new url: 'https://www.youtube.com/watch?v=lE3a5-Kep3Y'
=> #<Yt::Models::Video:0x007fa83b51f730 ...
[7] pry(main)> v.title
=> "Самый смешной футбольный матч в мире!" |
@claudiofullscreen Strangely enough it is still the same. :( |
Upd: Still the same. YT APIv2 works. |
@claudiofullscreen Okay, after a while I've returned to this problem and seems like there was glitches after all. Thank you for the reply! |
I'm getting the same problem.... Any idea? |
@cqcn1991 This can also be caused by the incorrect setup of your app in the Google Developers Console. You should enable YouTube Data API v3, Google+ API and YouTube Analytics. I am planning to relese the updated version of my tutorial (http://www.sitepoint.com/youtube-rails/) on working with YT API and will cover all these steps. |
I am also now getting this problem @bodrovis I was initially following your tutorial to get started and had been successfully using youtube_it in development. It all of a sudden stopped working and I have now converted over to yt and I am getting this error as well. I noticed it because video data was no longer getting fetched during my testing and using pry to inspect this: def get_video_data
begin
video = Yt::Video.new id: uid
binding.pry
self.title = video.title
self.author = video.author.name
rescue
self.title = ''
self.author = ''
end
end Inspecting with pry:
Not sure what is going on; I have all 3 APIs mentioned above working and was succesfully pulling this data a few days ago. |
@dustinleblanc Well, once again I can only recommend checking that you have enabled all the necessary APIs in the Google Console (see above). I didn't find any other causes for this problem unfortunately. The new version of tutorial is coming soon btw. |
@bodrovis looking forward to it, the first version was really helpful to get me started. thanks again! At least VCR was able to capture a successful transaction before it broke so that my test suite still runs :) |
@dustinleblanc If you are interested the source for the new tutorial is already on GitHub. Maybe it could help https://github.com/bodrovis/YTv3 |
@bodrovis very cool. for kicks here is a gist of my model file with the logic involved; this is running in an existing refinery 1.0 site: https://gist.github.com/anonymous/2e05e3ea2c123f82c991 Ignore the |
With some input from some other developers we realized this is because |
I'm using ruby 2.0.0p353 with rails "3.2.13" and I got the same error:
And yes, I have the 3 APIs enabled in google console. |
@moradtaleeb you could try using our forked version of the gem at https://github.com/singlebrook/yt and see if it gets rid of your error then report back here. Rspec seems to run the specs fine for Ruby2 but the conditional check we added allowed the gem to operate fine on our ruby 1.9.3 / rails 3.2 site. |
@dustinleblanc I used ruby 1.9.3 and with the gem you mentioned [ gem 'yt', '~> 0.13.8' ] and got the same error. I tried to use the queries on the gem readme file too to make sure, and the same error appeared:
|
@moradtaleeb did you make sure to require the SB forked version of the gem? as in putting |
@dustinleblanc now this worked :) thanks |
Great, at least that's a second person the patched version has worked for, I wouldn't rely on our patch indefinitely but it's good to get some confirmation that it is working outside our bubble |
Hello! Let me recap what is happening to see if I understand everything:
# Returns the list of server errors worth retrying the request once.
def server_errors
[
OpenSSL::SSL::SSLError,
OpenSSL::SSL::SSLErrorWaitReadable,
Errno::ETIMEDOUT,
Errno::ENETUNREACH,
Errno::ECONNRESET,
Net::HTTPServerError
]
end
Which versions of Ruby do not include the constant above? According to @dustinleblanc, the constant was introduced in Ruby 2.0. In fact the constant exists in Ruby Doc 2.0 and is missing in Ruby Doc 1.9.3. Therefore, I think the correct solution to this issue is simply to merge #110. What surprises me, though, is people reporting the same issue on Ruby 2.0. @dustinleblanc @bodrovis What do you say? Is this issue on Ruby 2.0 really a thing? Can you still reproduce it? Otherwise I would just go and merge #110 and close this ticket. |
Yeah the reports of issues in Ruby 2.0 are a bit puzzling since when we tested it here at SB, specs ran fine on a ruby 2.0 install and error out on a 1.9.3 install. I am fairly positive travis-ci was reporting the same but its been some time since we looked into it. Can we run new builds against both versions on Travis and see if that can quickly confirm a difference? |
@claudiofullscreen That's really strange but I can't reproduce it anymore with Ruby 2.1 at least (I just tried disabing YT API via Developers Console and running some API calls). I believe it is safe to merge this one. |
@moradtaleeb Thanks to @dustinleblanc this issue is now fixed! You don't have to reference a separate branch anymore, just add this to your Gemfile and you're good: gem 'yt', '~> 0.14.3' |
@claudiofullscreen @dustinleblanc now, it worked fine with ruby 1.9.3 and ruby 2.2.0 BUT didn't work with ruby 2.0.0 Note: Didn't test it on 2.1 |
Yeah, seems like it is exactly the same I had with Ruby 2.0. I've switched to 2.1 some time ago... |
@moradtaleeb Are you saying you still experience the same issue with Ruby 2.0 and yt 0.14.3? |
hmmm, perhaps the Ruby docs are inaccurate and that constant doesn't exist until 2.1? If that's the case we could probably advance the version constraint in both the test and lib files? Weird edge cases o_O |
https://github.com/ruby/ruby/search?utf8=%E2%9C%93&q=OpenSSL%3A%3ASSL%3A%3ASSLErrorWaitReadable&type=Code searching the 2_0_0 Branch of Ruby repo for the constant isn't yielding great results. |
Seems that's the case. Really weird. |
The constant was introduced in ruby/ruby@0626d9 Therefore, the first version of Ruby with that constant should be Ruby 2.0.0-p195 @dustinleblanc @moradtaleeb Could you run |
I was testing with 1.9.3-p545 (site I initially was using this on) and On Sun, Apr 12, 2015 at 9:11 PM claudiofullscreen notifications@github.com
|
2.0.0-p0 fails rspec tests. Can we spec the patch level in the code and tests? wowza |
Thanks for your help! I guess that's the right thing to do… I'm curious On Mon, Apr 13, 2015 at 8:54 AM, Dustin LeBlanc notifications@github.com
Claudio Baccigalupo | Software Writer | Fullscreen, Inc. |
The original solution could work, simply include it if it is defined and then perhaps remove the reference to ruby 2.0 specifically, and just be like "some versions of Ruby don't have this 🤷" |
🙇 You are so right! |
I'm continuing to get |
@simplecircle Could you run the following commands and tell me what you see? Thanks: ~$ ruby --version
# ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
~$ irb
irb(main):001:0> require 'openssl'
# => true
irb(main):002:0> OpenSSL::SSL::SSLErrorWaitReadable
# => OpenSSL::SSL::SSLErrorWaitReadable |
|
yuppers:
It's somewhere between those versions |
@simplecircle I think I have fixed the issue. Can you download |
Thanks for that. I will. Before that I need to get a valid access token. My Web App (non iOS ) is using YT on it's behalf not a "User". Which Application type should I use for OAuth setup, "Web app", "Service acct" or "Installed app"? I have read so much conflicting info on this seemingly simple topic but don't know which scheme to choose. Thanks for the help |
Here you go, I've written an article on that: http://www.sitepoint.com/youtube-api-version-3-rails/ If you don't need any user interations, just request server key. |
@simplecircle You should be good following https://github.com/Fullscreen/yt#apps-that-do-not-require-user-interactions |
@bodrovis @claudiofullscreen Thanks for the links! I'll dig in. Once I get a token, I'll test the new patch and report back. |
Looks like the ``0.14.6` fixed things. Thanks so much @claudiofullscreen |
Hello and thanks for the great gem.
Using the latest version I get an error
uninitialized constant OpenSSL::SSL::SSLErrorWaitReadable
. Error trace:This can be reproduced by creating a video resource like
and issuing
or similar method (like
comment_count
).The text was updated successfully, but these errors were encountered: