近期建立或是批次編輯issue會遇到error 500
由 Deng Wilson 在 大约一年 之前添加
各位大大好
上次有一陣子容易遇到500 error https://www.redmineplugins.cn/issues/480 是在query view的時候 後來把 config/database.yml 的timeout 調整變長 就解決
但現在遇到另外的問題 就是最近 可能是再新增issue 或是多個issue要批次進行更新資料時 會遇到以下error (附檔)
(交叉驗證幾次 跟編輯的數量無關 因為即使只編輯一個issue也會遇到) 我也嘗試調整timeout 但發現沒有用
不知道是否有大神可以協助解答
謝謝
Rendered mailer/issue_edit.html.erb within layouts/mailer (0.0ms)
Completed 500 Internal Server Error in 19387ms (ActiveRecord: 10967.2ms)
ActiveRecord::StatementInvalid (TinyTds::Error: The request failed to run because the batch is aborted, this can be caused by abort signal sent from client, or another request is running in the same session, which makes the session busy.: EXEC sp_executesql N’SELECT [member_roles].* FROM [member_roles] WHERE [member_roles].[member_id] IN (2536)'):
app/models/user.rb:543:in `block in membership’
app/models/user.rb:545:in `yield’
app/models/user.rb:545:in `membership’
app/models/user.rb:557:in `roles_for_project’
app/models/user.rb:636:in `allowed_to?'
app/models/issue.rb:153:in `visible?'
app/models/issue.rb:981:in `block in notified_users’
app/models/issue.rb:981:in `reject!'
app/models/issue.rb:981:in `notified_users’
app/models/journal.rb:142:in `notified_users’
app/models/mailer.rb:94:in `deliver_issue_edit’
app/models/journal.rb:302:in `send_notification’
app/models/journal.rb:67:in `save’
app/models/issue.rb:1708:in `create_journal’
app/models/issue.rb:210:in `create_or_update’
app/controllers/issues_controller.rb:304:in `block in bulk_update’
app/controllers/issues_controller.rb:290:in `each’
app/controllers/issues_controller.rb:290:in `bulk_update’
lib/redmine/sudo_mode.rb:63:in `sudo_mode’
redmine error.PNG (16 KB) redmine error.PNG |
回复 (1)
RE: 近期建立或是批次編輯issue會遇到error 500 - 由 guo hongxing 在 大约一年 之前添加
@Deng Wilson 你好,redmine可能存在性能问题,分析和建议如下:
app/controllers/issues_controller.rb:290:in `bulk_update’
首先上面的错误是在批量更新issues时发生了崩溃,因此问题应该与批量操作有关
app/models/issue.rb:981:in `block in notified_users’
ActiveRecord::StatementInvalid (TinyTds::Error: The request failed to run because the batch is aborted, this can be caused by abort signal sent from client, or another request is running in the same session, which makes the session busy.
redmine4.0以前的版本,批量更新操作issues会引发对相关干系人(notified_users)以“同步方式”批量邮件通知,可能潜在性能问题
#480 使用了 Redmine版本: 3.3.*
https://www.redmine.org/projects/redmine/wiki/EmailConfiguration
Asynchronous delivery_methodsThe :async_smtp and :async_sendmail use asynchronous sends, which means Redmine does not wait for the email to be sent to display the next page. See Asynchronous Email Delivery for more details. Some SMTP servers have delay period before processing takes place as an anti-spam feature, during which time synchronous method will block Redmine (10 seconds could be a default value, see also #11376 for more information).
建议升级到redmine 4.0或以上版本,并将redmine配置成“异步"邮件提醒,进一步提高redmine性能。试试看