Project

General

Profile

Internal error after hitting issue create button (redmine 5.1.3 on Debian 11)

Added by Rob Maris 6 months ago

After successfully having installed redmine on a debian 11 server, I encounter the following error when I save a newly generated issue:

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

The appropriate log file section says:

I, [2024-06-19T12:47:32.546622 #360516]  INFO -- : [8016529a-67c1-4ff7-a147-ef9fe6f4b060]   Current user: robm (id=1)
I, [2024-06-19T12:47:32.571371 #360516]  INFO -- : [8016529a-67c1-4ff7-a147-ef9fe6f4b060] Completed 500 Internal Server Error in 30ms (ActiveRecord: 3.3ms | Allocations: 26028)
F, [2024-06-19T12:47:32.577986 #360516] FATAL -- : [8016529a-67c1-4ff7-a147-ef9fe6f4b060]   
[8016529a-67c1-4ff7-a147-ef9fe6f4b060] NoMethodError (undefined method `id' for nil:NilClass

      self.priority_id ||= IssuePriority.default&.id || IssuePriority.active.first.id
                                                                                  ^^^):
[8016529a-67c1-4ff7-a147-ef9fe6f4b060]   
[8016529a-67c1-4ff7-a147-ef9fe6f4b060] app/models/issue.rb:2072:in `clear_disabled_fields'
[8016529a-67c1-4ff7-a147-ef9fe6f4b060] app/controllers/issues_controller.rb:152:in `create'
[8016529a-67c1-4ff7-a147-ef9fe6f4b060] lib/redmine/sudo_mode.rb:61:in `sudo_mode'

Upon little investigation, I see that sudo_mode is meant a Ruby resource, not Debians sudo.
Any hints are appreciated.


Replies (3)

RE: Internal error after hitting issue create button (redmine 5.1.3 on Debian 11) - Added by Holger Just 6 months ago

The cause of the error is that you have not defined any issue priorities (which is generally expected from Redmine).

Generally, after you have installed Redmine, you should load the common default data set. This should have been offered on the Administration page. If this is not desired, you can add thr desird priorities in Administration -> Enumerations manually.

With that being said, Redmine should not bailout with an internal error in this case. I have opened #40860 to handle this.

RE: Internal error after hitting issue create button (redmine 5.1.3 on Debian 11) - Added by Rob Maris 6 months ago

Thanks for quick identification of the problem cause.
At first I added the missing '&' in the code line. Well, then I also see that the priority field goes accompanied with an asterisk (because it is red, was seen but not really attended.
Indeed, no priorities were defined.

I had a bit to prepare in order to get redmine operating in a mode that makes sense. With that I recognize that the system offers a high degree of flexibility and sophistication. E.g. I had to read about how to define Workflows, which is quite cool.

After having defined priorities, I don't care about the field's content because it always presents a value/text, also when none of the priorities are defined as 'default'. Having found this, it seems quite logically that the error page does normally never occur and gets undetected.

I believe that a common default settings set was not offered. It isn't in settings.yml , and the administrator page seems not to offer a reset to 'factory' state of administrator settings, including basic enumerations. Perhaps I have missed a dialog entry upon the very first start of redmine.

RE: Internal error after hitting issue create button (redmine 5.1.3 on Debian 11) - Added by Holger Just 6 months ago

The option to load some default data is only offered if your Redmine database appears to be "empty", specifically if there are no defined custom roles, trackers, issue statuses, enumerations, or saved queries. If any of these exist, we assume that the initial database was already used and do not offer to add to or/ overwrite this custom configuration anymore.

And yeah, without at least one defined issue priority in the database, it's not possible to create any issues as he priority is a mandatory field for all issues. If you have not defined a default priority we will generally use the first one (although we still recommend to set a default priority, even if you don't use the field otherwise).

    (1-3/3)