Project

General

Profile

Actions

Defect #24258

closed

ERROR "MailHandler: an unexpected error occurred when receiving email: uninitialized constant User::RequestStore" when parsing emails from IMAP

Added by Jan Hejl over 8 years ago. Updated about 8 years ago.

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

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

When parsing emails from IMAP mailbox with:

rake --trace -f /var/lib/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.excello.cz username=__username__ password=__password__

commands email parsing fails without any message. After modifying config/environments/production.rb to debug:

# config.action_mailer.logger = nil
config.action_mailer.logger = Logger.new("/var/log/redmine/production.log")
config.action_mailer.logger.level = Logger::DEBUG

production.log contains:

I, [2016-11-02T19:57:49.310669 #7196]  INFO -- : 
Received mail (14.9ms)
D, [2016-11-02T19:57:49.310796 #7196] DEBUG -- : Return-Path: <jh@excello.cz>
Received: from [IPv6:2001:67c:1590:0:79b4:dfe9:fad6:f2c6] (unknown [IPv6:2001:67c:1590:0:79b4:dfe9:fad6:f2c6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by posta.excello.cz (Postfix) with ESMTPSA id 2DCEA2C8EDF for <ExcelloRedmine@excello.cz>; Wed, 02 Nov 2016 19:53:21 +0100
Date: Wed, 02 Nov 2016 19:53:20 +0100
From: Jan Hejl <jh@excello.cz>
To: ExcelloRedmine@excello.cz
Message-ID: <cbe84481-c70b-7506-d907-e4dbec380930@excello.cz>
In-Reply-To: <redmine.journal-13706.20161102160327.0f74b28fd64f7c94@excello.cz>
References: <redmine.issue-3523.20161012120731@excello.cz>
 <redmine.journal-13706.20161102160327.0f74b28fd64f7c94@excello.cz>
Subject: =?UTF-8?Q?Re:_[Virusfree_support_-_Feature_#3523]?=
 =?UTF-8?Q?_=28=C5=98e=C5=A1=C3=AD_se=29_Prispievanie_do_Redmine_pomocou?=
 =?UTF-8?Q?_emailu?=
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary=------------6B6723D4BD3FE7422B9CE1DB;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Original-To: ExcelloRedmine@excello.cz
Delivered-To: excelloredmine@excello.cz
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0

... cut message body ...

E, [2016-11-02T19:57:49.310971 #7196] ERROR -- : MailHandler: an unexpected error occurred when receiving email: uninitialized constant User::RequestStore

Environment:

Environment:
  Redmine version                3.2.1.stable
  Ruby version                   2.1.9-p490 (2016-03-30) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            2.7.3
  Filesystem                     
Redmine plugins:
  no plugin installed

Actions #1

Updated by Toshi MARUYAMA over 8 years ago

  • Status changed from New to Needs feedback

Try "bundle exec rake ..." on Redmine root directory.

Actions #2

Updated by Jan Hejl over 8 years ago

Still the same.

Actions #3

Updated by Toshi MARUYAMA over 8 years ago

RequestStore should be loaded by "request_store" gem.
source:tags/3.2.1/Gemfile#L11

Actions #4

Updated by Jan Hejl about 8 years ago

Tried both ways - with bundle GEMs or system installed GEMs. Still the same error.

Any thoughts on how to debug this? (I'm not a Ruby person, sorry.)

Actions #5

Updated by Jan Hejl about 8 years ago

Adding:

require 'request_store'
at the begining of the /var/lib/redmine/app/models/mail_handler.rb (first line exactly) solves the issue. The question is why?

Actions #6

Updated by Toshi MARUYAMA about 8 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Invalid

Jan Hejl wrote:

The question is why?

No idea.
It is obvious your install problem.

Actions

Also available in: Atom PDF