Project

General

Profile

422 Unprocessable Entity - rdm_mailhandler.rb

Added by Jason Butz over 13 years ago

I am recieving 422 Unprocessable Entity errors for some emails sent to my redmine install.

Here is my line in /etc/aliases:

redmine: "/usr/local/bin/rdm-mailhandler.rb --allow-override=project,priority --no-permission-check --unknown-user=accept  --url http://******/redmine --key ****************" 

Here is the entry from production.log:

Processing MailHandlerController#index (for 127.0.1.1 at 2011-08-10 14:33:24) [POST]
  Parameters: {"no_permission_check"=>"1", "unknown_user"=>"accept", "allow_override"=>"project,priority", "key"=>"EYNdpdJagm9poa3ZUfRz", "email"=>"**********************"}
Completed in 28ms (View: 0, DB: 3) | 422 Unprocessable Entity [http://*****************/redmine/mail_handler]

The email address that the message is coming from is a redmine user. The E-Mail has

Project: PROJECTNAME
at the top of the body. What am I missing?


Replies (3)

RE: 422 Unprocessable Entity - rdm_mailhandler.rb - Added by Jason Butz over 13 years ago

Here is a more detailed log output for your consumption:

Processing MailHandlerController#index (for 127.0.1.1 at 2011-08-16 16:46:43) [POST]
  Parameters: {"no_permission_check"=>"1", "unknown_user"=>"accept", "allow_override"=>"project,priority", "key"=>"*********************", "email"=>"From noreply@***************  Tue Aug 16 16:46:43 2011\nReturn-Path: <noreply@***************>\nX-Original-To: redmine@webapps.***************\nDelivered-To: redmine@webapps.***************\nReceived: from localhost (intranet.*************** [10.10.33.63])\n\tby webapps.*************** (Postfix) with ESMTP id 6C868702\n\tfor <redmine@webapps.***************>; Tue, 16 Aug 2011 16:46:43 -0500 (CDT)\nFrom: noreply@***************\nSubject: Team Member Movement - TEST T TEST\n\nProject: it\n\nSubmitted on:\t\tTuesday, August 16, 2011, 4:46 pm\nMovement Type:\t\tEquipment Request \nEffective Date:\t\t08/16/2011\nTeam Member Name:\t\tTEST T TEST\nLocation:\t\t\t01 - Corporate (Evansville, IN) \nCurrent Department:\tNot Applicable \nNew Department:\t\t \nTitle / Position:\t\tTESTING \nSupervisor:\t\t\tTESTING \nShift:\t\t\t\nFull Time:\t\t\t\nTM replaces:\t\t \nAvailable for Re-hire:\t\t \n\nNew Equipment: \n\tDesktop PC:\t\t  \n\tLaptop PC:\t\t  \n\tDesk Phone:\t\t \n\tWireless Phone:\t \n\tCellular Phone:\t \nNew Services: \n\tWindows Login:\t \n\ERP Login:\t  \n\tEmail Address:\t  \n\tVoice Mail:\t\t  \n\tRemote Access:\t \n\tWOTRK:\t\t \n\nCalibrated Tools Movement:\t No\n\tNew Location:\t \n\tNew Custodian:\t \n\nSpecial Instructions: TESTING \n\nAdditional Info :\nIP = 10.10.33.53 \n\nFrom: JCB (jbutz@***************)\n\n\n\n\n\nProject: it\n\n"}
  User Load (0.1ms)   SELECT * FROM `users` WHERE (LOWER(mail) = 'noreply@***************') AND ( (`users`.`type` = 'User' OR `users`.`type` = 'AnonymousUser' ) ) LIMIT 1
  Project Load (0.1ms)   SELECT * FROM `projects` WHERE (`projects`.`identifier` = 'it') LIMIT 1
  IssueStatus Load (0.1ms)   SELECT * FROM `issue_statuses` WHERE (`issue_statuses`.`id` = 0) 
  IssueStatus Load (0.1ms)   SELECT * FROM `issue_statuses` WHERE (is_default=1) LIMIT 1
  IssuePriority Load (0.1ms)   SELECT * FROM `enumerations` WHERE (`enumerations`.`id` = 0) AND ( (`enumerations`.`type` = 'IssuePriority' ) ) ORDER BY enumerations.position ASC
  IssuePriority Load (0.1ms)   SELECT * FROM `enumerations` WHERE (`enumerations`.`is_default` = 1) AND ( (`enumerations`.`type` = 'IssuePriority' ) ) ORDER BY enumerations.position ASC LIMIT 1
  Tracker Load (0.1ms)   SELECT * FROM `trackers` INNER JOIN `projects_trackers` ON `trackers`.id = `projects_trackers`.tracker_id WHERE (`projects_trackers`.project_id = 1 ) ORDER BY trackers.position LIMIT 1
  Member Load Including Associations (0.1ms)   SELECT `members`.`id` AS t0_r0, `members`.`user_id` AS t0_r1, `members`.`project_id` AS t0_r2, `members`.`created_on` AS t0_r3, `members`.`mail_notification` AS t0_r4, `projects`.`id` AS t1_r0, `projects`.`name` AS t1_r1, `projects`.`description` AS t1_r2, `projects`.`homepage` AS t1_r3, `projects`.`is_public` AS t1_r4, `projects`.`parent_id` AS t1_r5, `projects`.`created_on` AS t1_r6, `projects`.`updated_on` AS t1_r7, `projects`.`identifier` AS t1_r8, `projects`.`status` AS t1_r9, `projects`.`lft` AS t1_r10, `projects`.`rgt` AS t1_r11, `roles`.`id` AS t2_r0, `roles`.`name` AS t2_r1, `roles`.`position` AS t2_r2, `roles`.`assignable` AS t2_r3, `roles`.`builtin` AS t2_r4, `roles`.`permissions` AS t2_r5, `roles`.`issues_visibility` AS t2_r6 FROM `members` LEFT OUTER JOIN `projects` ON `projects`.id = `members`.project_id LEFT OUTER JOIN `member_roles` ON (`members`.`id` = `member_roles`.`member_id`) LEFT OUTER JOIN `roles` ON (`roles`.`id` = `member_roles`.`role_id`) WHERE (`members`.user_id = 61 AND (projects.status=1)) ORDER BY projects.name
  Role Load (0.1ms)   SELECT * FROM `roles` WHERE (`roles`.`builtin` = 1) LIMIT 1
  Tracker Load (0.1ms)   SELECT * FROM `trackers` WHERE (`trackers`.`id` = 0) 
  EnabledModule Load (0.1ms)   SELECT name FROM `enabled_modules` WHERE (`enabled_modules`.project_id = 1) 
  Tracker Load (0.1ms)   SELECT * FROM `trackers` WHERE (`trackers`.`id` = 3) 
  IssueCustomField Load (0.1ms)   SELECT * FROM `custom_fields` WHERE (is_for_all=1) AND ( (`custom_fields`.`type` = 'IssueCustomField' ) ) ORDER BY position
  IssueCustomField Load (0.1ms)   SELECT * FROM `custom_fields` INNER JOIN `custom_fields_projects` ON `custom_fields`.id = `custom_fields_projects`.custom_field_id WHERE (`custom_fields_projects`.project_id = 1 ) AND ( (`custom_fields`.`type` = 'IssueCustomField' ) ) ORDER BY custom_fields.position
  IssueCustomField Load (0.1ms)   SELECT `custom_fields`.* FROM `custom_fields` INNER JOIN `custom_fields_trackers` ON `custom_fields`.id = `custom_fields_trackers`.custom_field_id WHERE (`custom_fields_trackers`.tracker_id = 3 ) AND ( (`custom_fields`.`type` = 'IssueCustomField' ) ) 
  Workflow Load (0.1ms)   SELECT * FROM `workflows` WHERE (`workflows`.old_status_id = 1 AND (`workflows`.`tracker_id` = 3 AND `workflows`.`role_id` IN (1) AND `workflows`.`assignee` = 0)) 
  SQL (0.1ms)   BEGIN
  SQL (0.1ms)   COMMIT
  SQL (0.0ms)   BEGIN
  Tracker Load (0.1ms)   SELECT `trackers`.id FROM `trackers` INNER JOIN `projects_trackers` ON `trackers`.id = `projects_trackers`.tracker_id WHERE (`trackers`.`id` = 3) AND (`projects_trackers`.project_id = 1 ) ORDER BY trackers.position LIMIT 1
  SQL (0.1ms)   ROLLBACK
Completed in 29ms (View: 0, DB: 2) | 422 Unprocessable Entity [http://webapps.***************/redmine/mail_handler]

RE: 422 Unprocessable Entity - rdm_mailhandler.rb - Added by Jason Butz over 13 years ago

Nevermind, I took care of it. I have a custom field that corresponded to part of the email, even though I didn't want it to, and the values didn't match.

    (1-3/3)