Defect #25342

ActionView::Template::Error (undefined method `accessor' for #<ActiveRecord::Type::Value:0xa91ee78>):

Added by di yu almost 5 years ago. Updated over 3 years ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution: Affected version:


ActionView::Template::Error (undefined method `accessor' for #<ActiveRecord::Type::Value:0xa91ee78>):
15: <% end >
17: <
if @issue.safe_attribute? 'assigned_to_id' >
18: <p><
= :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true, :required => @issue.required_attribute?('assigned_to_id') ></p>
19: <
end >
21: <
if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>
app/models/role.rb:213:in `permissions_all_trackers'
app/models/role.rb:222:in `permissions_all_trackers?'
app/models/role.rb:228:in `permissions_tracker?'
app/models/project.rb:532:in `block in assignable_users'
app/models/project.rb:532:in `assignable_users'
app/models/issue.rb:863:in `assignable_users'
app/views/issues/_attributes.html.erb:18:in `block in app_views_issues_attributes_html_erb___393264238_89404116'
app/helpers/application_helper.rb:1058:in `labelled_fields_for'
app/views/issues/_attributes.html.erb:1:in `_app_views_issues__attributes_html_erb___393264238_89404116'
app/views/issues/_form.html.erb:42:in `block in app_views_issues_form_html_erb__208462307_88996968'
app/helpers/application_helper.rb:1058:in `labelled_fields_for'
app/views/issues/_form.html.erb:1:in `_app_views_issues__form_html_erb__208462307_88996968'
app/views/issues/new.html.erb:11:in `block in app_views_issues_new_html_erb_739418024_88663224'
app/helpers/application_helper.rb:1051:in `labelled_form_for'
app/views/issues/new.html.erb:5:in `_app_views_issues_new_html_erb__739418024_88663224'
app/controllers/issues_controller.rb:129:in `block (2 levels) in new'
app/controllers/issues_controller.rb:128:in `new'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'


#1 Updated by di yu almost 5 years ago

Ruby:2.2.0 redmine:3.3.1 mysql:5.7.17

#2 Updated by Toshi MARUYAMA almost 5 years ago

  • Status changed from New to Needs feedback
  • Priority changed from High to Normal

Did you run "rake db:migarate"?
Your log is same with Update Redmine 3.2.1 -> 3.3.0 partially failed.

#3 Updated by di yu almost 5 years ago

Rerun the action "rake db:migarate",And execut the same steps again, no erroe occured.
But produce a similar log when creat the new custom attributes, as follows, how to solve the problem?

Processing by CustomFieldsController#new as HTML
Parameters: {"utf8"=>"✓", "type"=>"IssueCustomField"}
Current user: admin (id=1)
Rendered custom_fields/formats/_regexp.html.erb (1.5ms)
Rendered custom_fields/formats/_string.html.erb (212.2ms)
Rendered custom_fields/_form.html.erb (216.2ms)
Rendered custom_fields/new.html.erb within layouts/admin (218.2ms)
Completed 500 Internal Server Error in 238ms (ActiveRecord: 5.0ms)

ActionView::Template::Error (undefined method `accessor' for #<ActiveRecord::Type::Value:0xbd71748>):
1: <%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
2: <p><%= f.check_box :text_formatting, {:label => :setting_text_formatting, :data => {:disables => '#custom_field_url_pattern'}}, 'full', '' %></p>
3: <p><%= f.text_field(:default_value) %></p>
4: <p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
lib/redmine/views/labelled_form_builder.rb:34:in `check_box'
app/views/custom_fields/formats/_string.html.erb:2:in `_app_views_custom_fields_formats__string_html_erb___139403577_96357720'
app/helpers/custom_fields_helper.rb:66:in `render_custom_field_format_partial'
app/views/custom_fields/_form.html.erb:18:in `_app_views_custom_fields__form_html_erb__541308781_96596952'
app/views/custom_fields/new.html.erb:4:in `block in app_views_custom_fields_new_html_erb_623355388_96652752'
app/helpers/application_helper.rb:1051:in `labelled_form_for'
app/views/custom_fields/new.html.erb:3:in `_app_views_custom_fields_new_html_erb__623355388_96652752'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

#4 Updated by Toshi MARUYAMA almost 5 years ago

No idea.
MySQL 5.7 is not supported.

#5 Updated by Zer00 CooL over 3 years ago

The same with GNU/Linux Mint 19 Tara.
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
mysql Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using EditLine wrapper
Redmine version 3.4.4.stable

I can't create a new issue with redmine.
I have installed Redmine with this tutorial :

My way for resolve that, in french.

Lancer rake db:migrate
(Voir ce qui semble être la solution à la fin de ce message et noter que rake db:migrate a été tenté avec PassengerDefaultUser www-data puis avec PassengerDefaultUser redmine)
/usr/share/redmine/db/migrate$ sudo rake db:migrate

Des erreurs de droits d'accès sur les fichiers suivants sont reportées dans le terminal.
cd /usr/share/redmine/instances/default/config
sudo chown redmine:redmine secret_key.txt database.yml email.yml
sudo chmod 755 secret_key.txt database.yml email.yml
Les trois fichiers sont bien donnés à l'utilisateur et au groupe redmine avec les droits 755.

A la suite de ça, la procédure rake db:migrate affiche une nouvelle erreur de droits sur le fichier schema.rb
Changer les droits ne suffit pas pour rake db:migrate ou sudo rake db:migrate et l'erreur réapparaît.
/usr/share/redmine/db$ sudo chown redmine:redmine schema.rb
sudo chmod 755 schema.rb

cd /etc/apache2/mods-available
Je laisse le propriétaire et le groupe du fichier passenger.conf à root.

Je modifie la configuration dans le fichier passenger.conf
sudo nano passenger.conf

Vérifier PassengerDefaultUser www-data
Remplacer par PassengerDefaultUser redmine
Redémarrer Apache2 après la modification : /etc/init.d/apache2 restart
Relancer la mise à jour de la base de données avec sudo rake db:migrate
L'erreur lors de l'ajout d'une issue depuis Redmine a changée avec PassengerDefaultUser redmine mais l'ajout d'une issue reste toujours en erreur.
Je remet PassengerDefaultUser www-data et redémarre Apache2 et l'issue peut maintenant être créée.

/usr/share/redmine/db/migrate$ sudo rake db:migrate
(in /usr/share/redmine)
/usr/lib/ruby/vendor_ruby/sprockets/digest_utils.rb:47: warning: constant ::Fixnum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/digest_utils.rb:51: warning: constant ::Bignum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/processor_utils.rb:110: warning: constant ::Fixnum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/processor_utils.rb:111: warning: constant ::Bignum is deprecated
Storing outgoing emails configuration in config/email.yml is deprecated. You should now store it in config/configuration.yml using the email_delivery setting.
/usr/lib/ruby/vendor_ruby/builder/xchar.rb:111: warning: constant ::Fixnum is deprecated

Malgré les warnings, cette fois, les issues peuvent être ajoutées à nouveau.

Je n'ai pas spécialement bien compris pourquoi l'erreur était présente.
Sûrement du fait que j'ai créé un utilisateur redmine qui est ajouté au groupe www-data mais surtout que les fichiers de redmine ont été donnés (chown) à redmine:redmine
(J'ai pu oublier de tout donner à redmine:redmine ce qui est possible aussi.)

Malgré tout, les issues peuvent être ajoutées à nouveau.

Also available in: Atom PDF