Project

General

Profile

Actions

Defect #11013

closed

Fetching Email from IMAP/POP3 - uninitialized constant RAILS_DEFAULT_LOGGER error

Added by Andrei Neacsu almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Hi Everyone,

I have just updated to Redmine 2.0 and it seams that I can't fetch incoming emails anymore.

For fetching them I use a cron job like:
rake -f /path/to/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com port=993 ssl=1 username= password=************

When there's no email to fetch the above command is not throwing any error but when an email is received it throws:
rake aborted!
uninitialized constant RAILS_DEFAULT_LOGGER

Database: MySQL 5.1.61
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.8.17
Rack version 1.4
Rails version 3.2.3
Redmine version 2.0

Error stack trace:
  • Invoke redmine:email:receive_imap (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute redmine:email:receive_imap
    rake aborted!
    uninitialized constant RAILS_DEFAULT_LOGGER
    /var/www/redmine/lib/redmine/imap.rb:56:in `logger'
    /var/www/redmine/lib/redmine/imap.rb:34:in `check'
    /var/www/redmine/lib/redmine/imap.rb:32:in `each'
    /var/www/redmine/lib/redmine/imap.rb:32:in `check'
    /var/www/redmine/lib/tasks/email.rake:133
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
    /usr/lib64/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33
    /usr/bin/rake:19:in `load'
    /usr/bin/rake:19
Actions #1

Updated by Etienne Massip almost 12 years ago

  • Status changed from New to Confirmed
  • Target version set to 2.0.1

Indeed, deprecated constant has been removed 2 years ago.

Actions #2

Updated by Andrei Neacsu almost 12 years ago

I have been able to fix it by changing the lib/redmine/imap.rb file's lines:

def logger
RAILS_DEFAULT_LOGGER
end

in

def logger
Logger.new(STDERR)
end

I'm not a Ruby developer, so I really don't know if this is the best way of do it. I just had to find a quick path in order to activate this feature, since redmine is running on my company's development server.

Actions #3

Updated by Etienne Massip almost 12 years ago

I think it should be replaced by ::Rails.logger.

Actions #4

Updated by Andrei Neacsu almost 12 years ago

You are right.
Thank you very much for your help.

The same issue is valid for pop3.rb.

Actions #5

Updated by Jean-Philippe Lang almost 12 years ago

  • Status changed from Confirmed to Resolved
  • Resolution set to Fixed

Fix committed in r9712, thanks.

Actions #6

Updated by Jean-Philippe Lang almost 12 years ago

  • Subject changed from Fetching Email from IMAP - uninitialized constant RAILS_DEFAULT_LOGGER error to Fetching Email from IMAP/POP3 - uninitialized constant RAILS_DEFAULT_LOGGER error
Actions #7

Updated by Jean-Philippe Lang almost 12 years ago

  • Status changed from Resolved to Closed

Merged.

Actions

Also available in: Atom PDF