Project

General

Profile

Actions

Defect #35531

closed

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

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

Added by anju dhiman over 5 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Resolution:
Duplicate
Affected version:

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?


Related issues 1 (0 open — 1 closed)

Is duplicate of Redmine - Defect #35100: MailHandler raises NameError exception when generating error messageClosedGo MAEDAActions

Updated by Go MAEDA over 5 years ago Actions #1

Could you provide full error message?

Updated by Go MAEDA over 5 years ago Actions #2

  • Category set to Email receiving

Updated by anju dhiman over 5 years ago Actions #3

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

Updated by anju dhiman over 5 years ago Actions #4

Any update?

Updated by Go MAEDA over 5 years ago Actions #5

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'

Updated by Massimiliano Calipari about 5 years ago Actions #6

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

Updated by Go MAEDA 3 months ago Actions #7

  • Is duplicate of Defect #35100: MailHandler raises NameError exception when generating error message added

Updated by Go MAEDA 3 months ago Actions #8

  • Status changed from New to Closed
  • Resolution set to Duplicate

This should have been fixed in #35100.

Actions

Also available in: PDF Atom