-
Notifications
You must be signed in to change notification settings - Fork 9
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
ERROR -- : uninitialized constant OpenSSL::SSL::SSLErrorWaitReadable (NameError) #16
Comments
Although I wonder if the error would happen also on the development platform, you shouldn't experience the issue when deploying your application since you really shouldn't use SSL on any Heroku deployment. Heroku's SSL is handled by Heroku's stack and your application will be invoked by Heroku's stack after decrypting the SSL data.. If you deploy your application in clear text, you will notice that both clear text and SSL are working properly. However, if you deploy your application using SSL internally, then neither clear text nor SSL will work when deploying on Heroku... ... your clear text services will require SSL and your SSL services will require twice the SSL handshake (and experience double encryption) which isn't supported by the client side (and is a protocol error). Try removing the SSL flags in your application and see if the deployment works properly. |
P.S. Where, in your application, are you using SSL? |
I use devise to manage authentication, and I only add one line of SSL: #/initializers/devise.rb
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE if Rails.env.development? However, removing this line did not solve this issue... |
Is there a way for me to look over the code? Here's a quick and dirty hack that might help until we resolve the matter. You can add the following to your application's: module OpenSSL
module SSL
SSLErrorWaitReadable = IO::WaitReadable
end
end
require 'openssl' |
Here is the repo: https://github.com/davidjuin0519/chatty. Here is the log:
How can I prevent this from happening? Thanks! |
Hi, I read through some of the code, not all of it, and it seems to me that there are a little too many assumptions and hacks being performed, which might produce unexpected results or raise exceptions. for example... user_session = ObjectSpace.each_object(ActionDispatch::Request::Session).
to_a.select do |session|
session.id == cookies['_chatty_session']
end.
first
# user_session might be (and probably is) `nil`, but you're not checking.
values = user_session['warden.user.user.key'] Also, I'm not sure why you experience the server shutting down. It doesn't happen on my machine. It could be related to the code here: if Rails.const_defined?('API') || Rails.const_defined?('Console')
Iodine.protocol = nil
elsif Rails.const_defined?('Server')
# require_relative '../app/sync/plezi_sync.rb'
end I wonder if Heroku effects this code somehow... I would try limiting this code to the development environment. i.e.: if ENV['RACK_ENV'] == "development" && ( Rails.const_defined?('API') || Rails.const_defined?('Console') )
Iodine.protocol = nil
elsif Rails.const_defined?('Server')
# require_relative '../app/sync/plezi_sync.rb'
end Also, you're using JSON a lot and you're moving very heavy data within every simple chat message. This will prevent your application from being able to scale. Here are a few thoughts:
I recommend, before you try mixing Plezi and Rails, that you attempt the Hello Chatroom tutorial and implement the Later, try adding events to the chat, such as private messages and maybe a chatroom counter (I would suggest using a It's not as easy is it might sound, because there are a lot of new concepts related to websockets, concurrency, event queues (event handling) and other new concepts that are related to the Websocket world. After you mastered the websockets and discovered how Plezi can help you make websocket management easy (read: easier), then try to integrate Rails and Plezi together. At that point, I would consider the best way to share user data and authentication between the two frameworks, since their session data isn't unified. Good Luck! and let me know how it goes :-) |
Hi Bo, Thank you for your advice! I will try to follow your suggestion to accomplish my project and keep it updated with you. I just did an experiment. I created a vary basic app I deployed to heroku without any additional setup, and the same error message still pops out: So this address 2 questions for me: Thanks! |
Hi david, Before posting my answer (but after writing it), I looked over your repo. It seems that you're still using Rails in your application... could the issue be related to Rails? I would suggest you try to use Plezi without Rails and see if you still have this error. This way, we can isolate the error, find it and resolve it. Thank you! Bo. old answerI'm now working very hard on Plezi's server, Iodine, and re-writing it from it's core in C. Iodine 0.2.x is very different and the issue your experiencing seems to be related to the Iodine 0.1.21 version. I think somewhere along the way (although I don't experience this issue), Iodine isn't requiring the
As to how come the application is still working - I don't know, because I can't reproduce the error... However, I did design the application to withstand many different errors without crashing. So, as long as it's not a core error, it should keep working... (although I would have thought that this error would be a core error). When we move to Plezi 0.13.0, we will be using a totally different server (Iodine 0.2.x) which will support many more concurrent connections (Ruby's I'm sure that this error is limited to the Iodine 0.1.x versions. |
Hi Bo, Just a suggestion: Would you mind to add some reminding on the doc? And I will continue to view the doc and source code. Thank you! |
Woohooo! Thanks! I'm super happy it's working for you now and I'm happy you found the error - I don't think I would have discovered it, nice work. 👍🏻👍🏻👍🏻👍🏻👍🏻 |
When I tried to deploy to heroku, the server could not function properly. Here is the error message:
I tried to rollback to the workable version, but it crashed as well...
How can I make this work? Thank you!
The text was updated successfully, but these errors were encountered: