altsol / redmine_mattermost

Mattermost notification plugin for Redmine
Other
66 stars 96 forks source link

Empty custom field for channel leads to server side timeout #17

Closed mehmetalianil closed 7 years ago

mehmetalianil commented 7 years ago

Description

We are using several projects in our redmine installation that I have been able to communicate with mattermost.

In our case, there are several projects that has its Mattermost Channel custom field empty. We have old projects which we don't have channels for. If that is the case, when a new issue is entered for that project, the server doesn't respond in time, and the user sees a 500 Internal Server Error.

Steps

Logs

Apache

[ 2017-01-23 14:13:28.4244 30165/7fe80c5eb700 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 25064, application /opt/redmine/redmine (production)
App 26941 stdout:
App 26986 stdout:
[ 2017-01-23 14:23:14.3131 30165/7fe80c5eb700 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 26986, application /opt/redmine/redmine (production)
App 29059 stdout:
App 29096 stdout:
[ 2017-01-23 14:30:30.9608 30165/7fe80c5eb700 age/Cor/CoreMain.cpp:793 ]: Disconnecting long-running connections for process 30353, application /opt/redmine/redmine (production)

Redmine

Started POST "/redmine/projects/projectname/issues" for 192.168.67.4 at 2017-01-24 10:21:28 +0200
Processing by IssuesController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"CFMEw91DrFlYDRFg27ram2CuQ8dSms2mmXuEMJ/uA6DXGsjhL2iJc5g1D2xc3PSsLO6hENf+SG3e9aLn13XF9Q==", "issue"=>{"is_private"=>"0", "tracker_id"=>"1", etc ...}, "was_default_status"=>"1", "attachments"=>{"1"=>{"filename"=>"DSC_0131.JPG", "description"=>"", "token"=>"265.49e10c14e6b1d3a0bec1aba67f980f9d"}}, "continue"=>"Oluştur ve devam et", "project_id"=>"projectname"}
  Current user: user.name (id=19)
  Rendered mailer/_issue.text.erb (7.7ms)
  Rendered mailer/issue_add.text.erb within layouts/mailer (8.8ms)
  Rendered mailer/_issue.html.erb (6.3ms)
  Rendered mailer/issue_add.html.erb within layouts/mailer (7.1ms)
Completed 500 Internal Server Error in 8246ms (ActiveRecord: 121.8ms)

Relevant

Environment:

Redmine version 3.1.3.stable Ruby version 2.1.7-p400 (2015-08-18) [x86_64-linux-gnu] Rails version 4.2.5 Environment production Database adapter Mysql2

SCM:

Subversion 1.8.8 Git 1.9.1 Filesystem

Redmine plugins:

redmine_checklists 3.1.3 redmine_mattermost 0.5 redmine_project_alias_2 1.0.2 sidebar_hide 0.0.8

mehmetalianil commented 7 years ago

I must say that any non empty custom field resolves this issue. Even ones that doesnt have a counterpart.

thanosk commented 7 years ago

I've pushed a patch for this issue, can you please test? Also note that at the current state, you need to fill at least one channel field under the hierarchy: global in settings -> parent project -> project. If all are empty, no notification will be posted in Mattermost.

mehmetalianil commented 7 years ago

Thanks a lot @thanosk ! I will try this soon, but I am a lil busy.

mehmetalianil commented 7 years ago

Seems to have resolved. mattermost_redmine