Application crash when deleting an issue from issue list with SQLServer
When viewing the list of issues, right-click the issue to be deleted, and then click delete. Redmine crashes with a "500 Internal Server Error".
ActiveRecord::StatementInvalid (TinyTds::Error: The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.: EXEC sp_executesql N'DELETE FROM [custom_values] WHERE [custom_values].[id] IN (SELECT [custom_values].[id] FROM [custom_values] LEFT OUTER JOIN [custom_fields] ON [custom_fields].[id] = [custom_values].[custom_field_id] WHERE [custom_values].[customized_id] = @0 AND [custom_values].[customized_type] = @1 ORDER BY custom_fields.position); SELECT @@ROWCOUNT AS AffectedRows', N'@0 int, @1 nvarchar(30)', @0 = 13895, @1 = N'Issue'):`
Environment: Redmine version 4.0.0.devel (cloned from GIT master branch) Ruby version 2.5.3-p105 (2018-10-18) [x64-mingw32] Rails version 5.2.2 Environment production Database adapter SQLServer Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Git 2.20.0 Filesystem Redmine plugins: redmine_agile 1.4.7
#3 Updated by Nigel Wilson 8 months ago
Hi Go MAEDA, this issue isn't related (in my opinion) to Defect #30211.
This issue occurs once Redmine is up and running. Users were accessing the website and creating/updating tickets as normal. The error reported only occurred when trying to delete a ticket.