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

undefined method `eager_autoload!' for Mail:Module #1553

Closed
KeithP opened this issue Jan 3, 2023 · 3 comments
Closed

undefined method `eager_autoload!' for Mail:Module #1553

KeithP opened this issue Jan 3, 2023 · 3 comments

Comments

@KeithP
Copy link

KeithP commented Jan 3, 2023

ruby 2.7.0
rails 6.1.6.1
mail 2.8.0

config/environments/production.rb :

config.eager_load = true

exception :

[21756] ! Unable to start worker
[21756] undefined method eager_autoload!' for Mail:Module [21756] /var/app/current/vendor/bundle/ruby/2.7.0/gems/actionmailer-6.1.6.1/lib/action_mailer.rb:61:in eager_load!'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/finisher.rb:134:in each' /var/app/current/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/finisher.rb:134:in block in module:Finisher'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in instance_exec' /var/app/current/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in run'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:61:in block in run_initializers' /opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:228:in block in tsort_each'
/opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component' /opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:431:in each_strongly_connected_component_from'
/opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:349:in block in each_strongly_connected_component' /opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:347:in each'
/opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:347:in call' /opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:347:in each_strongly_connected_component'
/opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:226:in tsort_each' /opt/rubies/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:205:in tsort_each'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:60:in run_initializers' /var/app/current/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application.rb:391:in initialize!'
/var/app/current/config/environment.rb:6:in <top (required)>' config.ru:3:in require_relative'
config.ru:3:in block in <main>' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/rack/builder.rb:186:in instance_eval'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/rack/builder.rb:186:in initialize' config.ru:in new'
config.ru:in <main>' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/rack/builder.rb:172:in eval'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/rack/builder.rb:172:in new_from_string' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/rack/builder.rb:163:in parse_file'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/configuration.rb:364:in load_rackup' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/configuration.rb:286:in app'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/runner.rb:169:in app' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/runner.rb:173:in start_server'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster/worker.rb:60:in run' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:208:in worker'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:101:in block in spawn_worker' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:101:in fork'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:101:in spawn_worker' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:83:in block in spawn_workers'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:76:in times' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:76:in spawn_workers'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:165:in check_workers' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cluster.rb:438:in run'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/launcher.rb:186:in run' /opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/lib/puma/cli.rb:75:in run'
/opt/rubies/ruby-2.7.7/lib/ruby/gems/2.7.0/gems/puma-6.0.0/bin/puma:10:in <top (required)>' /opt/elasticbeanstalk/.rbenv/versions/2.7.7/bin/puma:25:in load'
/opt/elasticbeanstalk/.rbenv/versions/2.7.7/bin/puma:25:in `

'

with mail 2.7.1, it works fine

@thekendalmiller
Copy link

thekendalmiller commented Jan 4, 2023

We were also hitting this. While troubleshooting, the error would match the original post above, but also sometimes it would be

[29716] Early termination of worker
[29719] ! Unable to start worker
[29719] uninitialized constant Mail::TestMailer
Did you mean?  SystemMailer
[29719] /var/app/bundle/ruby/2.7.0/gems/actionmailer-6.1.7/lib/action_mailer/delivery_methods.rb:42:in `<module:ClassMethods>'
    /var/app/bundle/ruby/2.7.0/gems/actionmailer-6.1.7/lib/action_mailer/delivery_methods.rb:40:in `<module:DeliveryMethods>'
    /var/app/bundle/ruby/2.7.0/gems/actionmailer-6.1.7/lib/action_mailer/delivery_methods.rb:8:in `<module:ActionMailer>'
    /var/app/bundle/ruby/2.7.0/gems/actionmailer-6.1.7/lib/action_mailer/delivery_methods.rb:5:in `<top (required)>'
    /var/app/bundle/ruby/2.7.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
    /var/app/bundle/ruby/2.7.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
    /var/app/bundle/ruby/2.7.0/gems/actionmailer-6.1.7/lib/action_mailer/base.rb:438:in `<class:Base>'
    /var/app/bundle/ruby/2.7.0/gems/actionmailer-6.1.7/lib/action_mailer/base.rb:437:in `<module:ActionMailer>'
    /var/app/bundle/ruby/2.7.0/gems/actionmailer-6.1.7/lib/action_mailer/base.rb:12:in `<top (required)>'
    /var/app/bundle/ruby/2.7.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
    /var/app/bundle/ruby/2.7.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
    /var/app/current/app/mailers/application_mailer.rb:1:in `<top (required)>'

ruby 2.7.7
rails 6.1.7
mail 2.8.0

@chitty
Copy link

chitty commented Jan 5, 2023

We also ran into this issue, and found it was caused by the incorrect file permissions in 2.8.0 bug. Pinning mail version to 2.7.1 fixed it.

@eval
Copy link
Collaborator

eval commented Jan 18, 2023

Closing as this was related to the permission problem which is fixed as of v2.8.0.1.

@eval eval closed this as completed Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants