substrakt / letsencrypt-heroku

Make any Heroku application secure in just a couple of minutes.
https://substrakt.com/heroku-ssl-me-weve-come-a-long-way/
MIT License
524 stars 19 forks source link

Certificate comes up as null #27

Closed richardsimko closed 7 years ago

richardsimko commented 7 years ago

For some reason the certificate is nil (From what I understand it, not a Ruby expert).

Do you guys have any idea what might be going wrong? We're using Heroku Teams and the app is owned by the team, not sure if you guys have tried that combo before but if not that might be related.

2016-11-09T15:35:56.068386+00:00 app[worker.1]: 4 TID-otktdy67s WARN: NoMethodError: undefined method `fullchain_to_pem' for nil:NilClass
2016-11-09T15:35:56.068425+00:00 app[worker.1]: 4 TID-otktdy67s WARN: /app/lib/certificate_generation.rb:92:in `deploy_certificate'
2016-11-09T15:35:56.068427+00:00 app[worker.1]: /app/lib/certificate_generation.rb:72:in `provision!'
2016-11-09T15:35:56.068428+00:00 app[worker.1]: /app/workers/worker.rb:11:in `perform'
2016-11-09T15:35:56.068428+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/processor.rb:152:in `execute_job'
2016-11-09T15:35:56.068429+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/processor.rb:134:in `block (2 levels) in process'
2016-11-09T15:35:56.068430+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
2016-11-09T15:35:56.068431+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
2016-11-09T15:35:56.068431+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
2016-11-09T15:35:56.068432+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/middleware/server/logging.rb:11:in `block in call'
2016-11-09T15:35:56.068433+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/logging.rb:32:in `with_context'
2016-11-09T15:35:56.068433+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/middleware/server/logging.rb:7:in `call'
2016-11-09T15:35:56.068434+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
2016-11-09T15:35:56.068435+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/middleware/chain.rb:133:in `invoke'
2016-11-09T15:35:56.068435+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/processor.rb:129:in `block in process'
2016-11-09T15:35:56.068436+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/processor.rb:168:in `stats'
2016-11-09T15:35:56.068436+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/processor.rb:128:in `process'
2016-11-09T15:35:56.068437+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/processor.rb:80:in `process_one'
2016-11-09T15:35:56.068438+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/processor.rb:68:in `run'
2016-11-09T15:35:56.068438+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/util.rb:17:in `watchdog'
2016-11-09T15:35:56.068439+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.3.0/gems/sidekiq-4.1.4/lib/sidekiq/util.rb:25:in `block in safe_thread'
richardsimko commented 7 years ago

And also, in spite of this it shows the process as successful even though it's not.

maxehmookau commented 7 years ago

I would guess that if it's nil, that the certificate wasn't generated successfully in the first place.

Due to the popularity of this library, we're currently undertaking a rewrite of the main worker job to hopefully resolve this (and many other issues!) Sorry for the problems you faced though!

richardsimko commented 7 years ago

Yeah, I figured as much I was just wondering if you might have any idea on how to debug what goes wrong.

Do you have any ETA on the re-write? I really like the idea of this lib!

maxehmookau commented 7 years ago

Unfortunately not at the moment. It's fair to say that this lib has noble ideas that haven't quite been implemented in the best way. Bearing in mind its unexpected popularity the re-write has begun! Hopefully we should have something to show in the not-too-distance future.

maxehmookau commented 7 years ago

FWIW, you can follow progress https://github.com/substrakt/letsencrypt-heroku/pull/28

I've made a start on writing some tests to the actual API endpoints and then will move no to rewriting the actual worker jobs to generate the certificates.

richardsimko commented 7 years ago

Thanks!