Skip to content
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

Puma SSL mode produces “no implicit conversion of nil into String” #1483

Closed
Labels

Comments

@igravious
Copy link

Steps to reproduce

  1. enable SSL for localhost

  2. start Puma with bin/rails s -b 'ssl://127.0.0.1:3001?key=/home/groobiest/.ssh/server.key&cert=/home/groobiest/.ssh/server.crt'

  3. visit a web page

  4. ...

Expected behavior

No errors

Actual behavior

(a) Lots of no implicit conversion of nil into String errors.

(b) Complains noisily about zero length web pages

System configuration

Ruby version: ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
Rails version: Rails 5.2.0.alpha
Puma version: Version 3.11.0 (ruby 2.3.3-p222), codename: Love Song

@jerryjohnjacob
Copy link

Facing the same issue. Happens only on puma 3.11.0. Reverted to 3.10.0 and the error disappeared. I'm on Ruby 2.4.2 and Rails 5.1.4.

@igravious
Copy link
Author

igravious commented Dec 13, 2017

@jerryjohnjacob Do you get any hanging Rails server sessions in development mode or production mode using the combo of Ruby 2.4.2 and Rails 5.1.4 and Puma 3.10.0 either with or without SSL enabled? I'm troubled that the stack I'm using is too bleeding edge. 🤕 Apologies for polluting this bug thread folks! 🌵

@jerryjohnjacob
Copy link

@igravious No, haven't faced that issue before. The closest is that the application server or console refuses to quit after sending a SIGINT. But this is only in development mode and I'm quite positive it is due to spring.

@drewish
Copy link

drewish commented Dec 18, 2017

I've see this on Ruby 2.3.5 with Rails 4.2.10.

@igravious
Copy link
Author

@jerryjohnjacob I've noticed that SIGINT (hitting Ctrl-c you mean?) doesn't immediately cause Puma to quit, it does eventually. I am impatient so I find to the process id and shoot it in the head.

@drewish Which? The main SSL issue or the Rails server sessions in dev mode hanging thing?

@drewish
Copy link

drewish commented Dec 20, 2017

I'm not sure what the main SSL issue is but I've had it hanging occasionally in dev mode with the "no implicit conversion of nil into String" errors but also seeing another error from the reactor. I'll bump back up to 3.11.x and get an exact copy of that error message.

@Petercopter
Copy link

Petercopter commented Dec 23, 2017

Same problem here. Trying to implement SSL for localhost. Ruby 2.4.2 and Rails 5.2beta. Things appear to be fine, just seeing the error message on load. It seems intermittent, more likely to happen on empty pages (a react router endpoint). The word 'Reactor' sometimes comes up as well.

Let me know if I can provide more details, this is happening in a small app, and I can probably isolate a test case.

This is Puma 3.11. Going back to 3.10 doesn't appear to have the same issue.

@jerryjohnjacob
Copy link

@Petercopter I'm no contributor or member of the Puma project, but I do think it'd be helpful if there were additional details so that when someone does work on this, they have a good foundation to build on :)

@sanjibukai
Copy link

Same problem here.
I'm using docker (ruby:stretch image with ruby 2.4.2p198) with rails 5.1.4.
Switching to puma 3.10 solves the problem.

@vincentwoo
Copy link

Sorry for splitting the thread, but interested parties may want to check out #1502

lgebhardt added a commit to lgebhardt/publishers that referenced this issue Jan 22, 2018
Temporary work around for “no implicit conversion of nil into String”
See puma/puma#1483 and puma/puma#1502
@dayudodo
Copy link

dayudodo commented Feb 6, 2018

when I change puma from 3.11.0 to 3.10, the errors like:

Error reached top of thread-pool: no implicit conversion of nil into String (TypeError)

disappeared, thanks !
and don't forget to add config.force_ssl = true in your development.rb if you're in the development mode.
ruby version : ruby 2.4.1-p111
rails version: 5.1.4

however, the new error occur:

SSL error, peer: 127.0.0.1, peer cert: , #<Puma::MiniSSL::SSLError: System error: Undefined error: 0 - 0>

how should I do?

@SyxALM
Copy link

SyxALM commented Feb 9, 2018

# Can any one help me, There is a same issue with the production environment.
<TypeError: no implicit conversion of Puma::MiniSSL::Socket into Integer
in my environment,rb file config.force_ssl = false
Puma version 3.10.0
Rails version Rails 4.0.12
Ruby version ruby 2.2.2p95

Any fixes for same let me know.

@evanphx evanphx closed this as completed in 61c875f Mar 6, 2018
@evanphx
Copy link
Member

evanphx commented Mar 6, 2018

There were a couple of other changes tonight that should fix this. I closed it with the above commit because @dayudodo mentions an issue where he's getting SSLErrors which is what that commit fixes.

@kdanaher1986
Copy link

I'm getting back into developing apps again after taking a break, and now having the worst problems launching a brand new app to the server, which I've never had or seen before, even in tutorials. This comes up in the terminal whenever I run rails s:

Booting Puma
=> Rails 5.1.5 application starting in development
=> Run rails server -h for more startup options
Puma starting in single mode...

  • Version 3.11.3 (ruby 2.4.1-p111), codename: Love Song
  • Min threads: 5, max threads: 5
  • Environment: development
  • Listening on tcp://0.0.0.0:3000

I have never seen this issue before and very confused what's causing it.

I upgraded the puma gem from 3.7 to 3.11 but still having the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment