プロジェクト

全般

プロフィール

Vote #71911

完了

Fetching Email from IMAP/POP3 - uninitialized constant RAILS_DEFAULT_LOGGER error

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Email receiving_29
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
29
version_id:
49
issue_org_id:
11013
author_id:
50484
assigned_to_id:
0
comments:
7
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
43
ステータス-->[Closed]

説明

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=redmine@domain.com 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


journals

Indeed, deprecated constant "has been removed 2 years ago":https://github.com/rails/rails/commit/800695ad4cef33347bcfef6df7634ff533582449.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
I think it should be replaced by @::Rails.logger@.
--------------------------------------------------------------------------------
You are right.
Thank you very much for your help.

The same issue is valid for pop3.rb.
--------------------------------------------------------------------------------
Fix committed in r9712, thanks.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリEmail receiving_29 にセット
  • 対象バージョン2.0.1_49 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0