pglombardo / PasswordPusher

🔐 Securely share sensitive information with automatic expiration & deletion after a set number of views or duration. Track who, what and when with full audit logs.
https://docs.pwpush.com
Apache License 2.0
2.08k stars 359 forks source link

v1.11.6+ has issues starting - cannot load such file -- net/smtp #296

Closed rjhenry closed 2 years ago

rjhenry commented 2 years ago

Hi,

Trying to run versions v1.11.6 and 1.11.7 result in failures, with the following logs:

Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
[8] Puma starting in cluster mode...
[8] * Puma version: 5.6.2 (ruby 3.1.0-p0) ("Birdie's Version")
[8] *  Min threads: 5
[8] *  Max threads: 5
[8] *  Environment: production
[8] *   Master PID: 8
[8] *      Workers: 2
[8] *     Restarts: (✔) hot (✖) phased
[8] * Preloading application
[8] ! Unable to load application: LoadError: cannot load such file -- net/smtp
bundler: failed to load command: puma (/opt/PasswordPusher/vendor/bundle/ruby/3.1.0/bin/puma)
/opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require': cannot load such file -- net/smtp (LoadError)
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail.rb:9:in `<module:Mail>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail.rb:3:in `<main>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/actionmailer-6.1.4.6/lib/action_mailer/base.rb:3:in `<main>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.4.6/lib/active_support/inflector/methods.rb:288:in `const_get'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.4.6/lib/active_support/inflector/methods.rb:288:in `block in constantize'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.4.6/lib/active_support/inflector/methods.rb:284:in `each'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.4.6/lib/active_support/inflector/methods.rb:284:in `inject'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.4.6/lib/active_support/inflector/methods.rb:284:in `constantize'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.4.6/lib/active_support/core_ext/string/inflections.rb:74:in `constantize'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/devise-4.8.1/app/mailers/devise/mailer.rb:4:in `<main>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `const_get'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `cget'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:237:in `block (2 levels) in eager_load'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:26:in `block in ls'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `each_child'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `ls'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:232:in `block in eager_load'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `synchronize'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `eager_load'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `each'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `eager_load_all'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/application/finisher.rb:133:in `block in <module:Finisher>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in `instance_exec'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in `run'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:61:in `block in run_initializers'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `each'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `call'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
    from /usr/local/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:60:in `run_initializers'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/railties-6.1.4.6/lib/rails/application.rb:391:in `initialize!'
    from /opt/PasswordPusher/config/environment.rb:82:in `<top (required)>'
    from config.ru:3:in `require'
    from config.ru:3:in `block in <main>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/puma-5.6.2/lib/puma/configuration.rb:348:in `load_rackup'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/puma-5.6.2/lib/puma/configuration.rb:270:in `app'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/puma-5.6.2/lib/puma/runner.rb:150:in `load_and_bind'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/puma-5.6.2/lib/puma/cluster.rb:357:in `run'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/puma-5.6.2/lib/puma/launcher.rb:182:in `run'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/puma-5.6.2/lib/puma/cli.rb:81:in `run'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/puma-5.6.2/bin/puma:10:in `<top (required)>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/bin/puma:25:in `load'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/bin/puma:25:in `<top (required)>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/cli/exec.rb:58:in `load'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/cli/exec.rb:58:in `kernel_load'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/cli/exec.rb:23:in `run'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/cli.rb:478:in `exec'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/cli.rb:31:in `dispatch'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/cli.rb:25:in `start'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/exe/bundle:49:in `block in <top (required)>'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
    from /opt/PasswordPusher/vendor/bundle/ruby/3.1.0/gems/bundler-2.2.30/exe/bundle:37:in `<top (required)>'
    from /usr/local/bundle/bin/bundle:25:in `load'
    from /usr/local/bundle/bin/bundle:25:in `<main>'

This particular instance is pwpush-postgres running in Kubernetes, and the same issue is not replicated with the ephemeral image on my local workstation. It is replicated in an instance of pwpush-postgres with a throwaway database spun up in a parallel container.

Looking at diffs between v1.11.5 and v1.11.6, it appears that there was change to the required version of mail_form which seems a likely starting point.

pglombardo commented 2 years ago

Thanks for reporting! The Ruby version was upgraded in these containers and that seems to be the culprit. I'll have a fix out shortly.

The release tag hasn't been updated to point to these versions yet (luckily).

pglombardo commented 2 years ago

Keeping open until the fix is verified...

rjhenry commented 2 years ago

Pulled v1.11.8 and it seems to be running without issues. Failure was usually in the first few seconds of the pod running, and this is now working fine for (wow!) two whole minutes.

Many thanks for your super-quick response!