Closed akhilesharora closed 6 years ago
Sorry, I don’t understand what do you want from us.
I want to solve the problem.
la -laF redmine/plugins
Did you run migrations?
Yeah I did run migrations.
So in config/environments/development.rb config.eager_load = false
whereas in production config.eager_load = true
total 44
drwxrwxr-x 8 akhilesh akhilesh 4096 mrt 14 15:21 ./
drwxrwxr-x 20 akhilesh akhilesh 4096 mrt 14 15:19 ../
-rw-rw-r-- 1 akhilesh akhilesh 31 mrt 13 21:12 README
drwxrwxr-x 8 akhilesh akhilesh 4096 mrt 13 21:13 redmine_2fa/
drwxrwxr-x 7 akhilesh akhilesh 4096 mrt 14 13:09 redmine_telegram_common/
Does it work without our plugins?
Yeah..Once I make config.eager_load = false
in config/environments/production.rb then it runs fine. But that is just a quick hack since in prod eager_load should be true.
So now it works? Is your problem in our plugins?
Yeah. The application fails in production because its unable to load the Telegram_bot somewhere since the eager_load => true in production. Whereas in development eager_load => false, so it does not break. But at the end of the day I want to use the plugin in production but I am unable to do that.
Eager load code on boot. This eager loads most of Rails and your application in memory, allowing both threaded web servers and those relying on copy on write to perform better.
Which versions of redmine_2fa and redmine_telegram_common do you have?
name 'Redmine 2FA' => version '1.4.0' name 'Redmine Telegram Common plugin' => version '0.3.0'
Okay, versions are consistent. I'm not sure that it will help you, but I suggest to try using Puma or something else instead of Webrick in production environment since webrick is not suited for production. Actually we use Puma on our production server (with eager_load option set to true), and it works.
I am using Passenger in my production environment. With webrick I was just testing why it was failing.
Please, try to remove this line:
Rails.application.config.eager_load_paths += Dir.glob("#{Rails.application.config.root}/plugins/redmine_telegram_common/{lib,app/workers,app/models,app/controllers}")
in redmine_telegram_common/init.rb and let us know if it helped you.
It did help. As of now it does not throw any errors. Thanks @funk-yourself
@akhilesharora glad that it helped you, but it's still a workaround, not a proper fix. It would be great if you can send me your redmine folder since I can't reproduce this bug myself. My E-mail is v.yashin.work@gmail.com
Please open issue if you still want to fix problem.
It breaks in production whereas in development it works fine. Telegram common plugin is already installed.