Defect #35531

redmine unexpected undefined local variable or method `project'" for mail handler , did you mean project_url

Added by anju dhiman 3 months ago. Updated 18 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:-
Resolution: Affected version:4.1.1

Description

Hi,

I am getting an error on Redmine while reading a particular email, error is :
Redmine unexpected undefined local variable or method `project'" for mail handler, did you mean project_url?

Email is getting read but it's not creating tickets in Redmine.

Could you guys please help us?

History

#1 Updated by Go MAEDA 3 months ago

Could you provide full error message?

#2 Updated by Go MAEDA 3 months ago

  • Category set to Email receiving

#3 Updated by anju dhiman 3 months ago

Hi,

Exact issue is :
MailHandler: an unexpected error occurred when receiving email: undefined local variable or method `project' for #<MailHandler:0x0000561f96fae478>
Did you mean? project_url

#4 Updated by anju dhiman 3 months ago

Any update?

#5 Updated by Go MAEDA 3 months ago

anju dhiman wrote:

Exact issue is :
MailHandler: an unexpected error occurred when receiving email: undefined local variable or method `project' for #<MailHandler:0x0000561f96fae478>
Did you mean? project_url

I want to know where the error occurs. Without the information, it is difficult to figure out the cause.

In log/production.log file, there may be more detailed information under the error line. It looks something like the following.

app/models/issue.rb:187:in `editable?'
app/views/issues/_action_menu.html.erb:4
app/views/issues/show.html.erb:1
app/controllers/issues_controller.rb:118:in `block (2 levels) in show'
app/controllers/issues_controller.rb:110:in `show'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'

#6 Updated by Massimiliano Calipari 18 days ago

Hi, I had the same issue.
Tring to figure out what was wrong I noticed that the issue occurred only if the email sender was a user not known for redmine.

My cron job settings already had the option "unknown_user=accept" so reading the documentation better I found that "Permissions have to be consistent with the chosen option. E.g. if you choose 'create', the 'Non member' role must have the 'Add issues' permission so that an issue can be created by an unknown user via email."
So I decided to add the "no_permission_check=1" option and the issue is gone!

The main issue is that the error message is misleading

Creating scope :system. Overwriting existing method Enumeration.system.
Creating scope :sorted. Overwriting existing method Group.sorted.
Creating scope :sorted. Overwriting existing method User.sorted.
MailHandler: an unexpected error occurred when receiving email: undefined local variable or method `project' for #<MailHandler:0x0000000001cb2400>
Did you mean?  project_url
MailHandler: an unexpected error occurred when receiving email: undefined local variable or method `project' for #<MailHandler:0x0000000006fcee90>
Did you mean?  project_url

Also available in: Atom PDF