After migrating, the ISSUES and the ROLES are not accessibles.

Added by Olivier Moreau almost 3 years ago

Hello everybody.

I'm running a Redmine 3.2.1 since a year and I'm doing a painful migration to 3.3.1-0 thru the Bitnami deploy. I'm obliged to do it because of a vulnerability problem and also because I want to change the hosting (from GCloud to my own server).

I did the following :
- Use "mysqldump" to create a full backup of the database
- Use FTP to create a full backup of the files
- Install the new server on Ubuntu
- Check that the new server was running fine by creating test data
- Import the dump file in the new database
- Copy the files to the new server

So far so good but then I run into a problem. The ISSUES and the ROLES were no longer accessible.
To determine the cause of the problem I redid the above procedure with a Windows deploy. I run into exactly the same problem so it's not a deployment issue.

Then I used phpMayAdmin to empty the ROLES table (truncate) and then migrated again (via a dump) from Redmine321 to 331 in the Windows deploy.

The issues are accessible, but unfortunately a problem remains with roles !
There is no roles left (normal) but it's impossible to create new one...
I got that error message and in the production log :


Started GET "/redmine/roles/new" for 127.0.0.1 at 2016-11-06 11:04:11 -0400
Processing by RolesController#new as HTML
  Current user: admin (id=1)
  Rendered roles/_form.html.erb (35.0ms)
  Rendered roles/new.html.erb within layouts/admin (63.0ms)
Completed 500 Internal Server Error in 189ms (ActiveRecord: 84.1ms)

ActionView::Template::Error (undefined method `accessor' for #<ActiveRecord::Type::Value:0xa1ab520>):
    84:         <%= hidden_field_tag "role[permissions_all_trackers][#{permission}]", '0', :id => nil %>
    85:         <%= check_box_tag "role[permissions_all_trackers][#{permission}]",
    86:               '1',
    87:               @role.permissions_all_trackers?(permission),
    88:               :class => "#{permission}_shown",
    89:               :data => {:disables => ".#{permission}_tracker"} %>
    90:       </td>
  app/models/role.rb:213:in `permissions_all_trackers'
  app/models/role.rb:222:in `permissions_all_trackers?'
  app/views/roles/_form.html.erb:87:in `block in _app_views_roles__form_html_erb___176638760_85034556'
  app/views/roles/_form.html.erb:82:in `each'
  app/views/roles/_form.html.erb:82:in `_app_views_roles__form_html_erb___176638760_85034556'
  app/views/roles/new.html.erb:4:in `block in _app_views_roles_new_html_erb___523145053_85020360'
  app/helpers/application_helper.rb:1051:in `labelled_form_for'
  app/views/roles/new.html.erb:3:in `_app_views_roles_new_html_erb___523145053_85020360'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Beside that, deleting all the roles is not a very safe move, so I'd like to keep them of course.
Anybody has an idea of what is going on and how to solve that problem ?
Thanks in advance for your help

Replies (11)

RE: After migrating, the ISSUES and the ROLES are not accessibles. - Added by Olivier Moreau almost 3 years ago

No I did not.
How do you run that command in Windows ? Is it an rake.exe command or what ?
OK I found the rake.bat but I got :

C:\Bitnami\redmine331\ruby\bin>rake db:migrate
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)

I trying to figure out what that means with http://guides.rubyonrails.org/command_line.html
But really why must I do "rake db:migrate" ?

RE: After migrating, the ISSUES and the ROLES are not accessibles. - Added by Olivier Moreau almost 3 years ago

Thanks Toshi for these interesting links.

I understand that "The rake migrates the changes into your database. It is which actually changes the database schema to match your previously generated scaffolded model."
Great, some kind of database repair or reindexing... Normal stuff, particularly after an upgrade, I guess.

But how do you rake ?

I got :
C:\Bitnami\redmine331\ruby\bin>rake db:migrate
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)

RE: After migrating, the ISSUES and the ROLES are not accessibles. - Added by Olivier Moreau almost 3 years ago

Hello everybody,

I'm stuck with that upgrade problem and as far as I can tell it's caused by the new "Tracker role-based permissions" (see : https://www.redmine.org/news/108)

I'm not going to RAKE the entire haystack until I find the bug !!! So I'm reverting to version 3.2.1 and that's it. Furthermore I'm really going to reconsider staying with Redmine on the long run. I just cannot waist time like that for a simple upgrade.

I'm also very surprised to be almost alone to have that problem (but not alone, see Brendan Pike story going on for two months. http://www.redmine.org/boards/2/topics/50880).

Should I post my problem as a bug and open a ticket ?

RE: After migrating, the ISSUES and the ROLES are not accessibles. - Added by James H almost 3 years ago

Might wanna try following/reading the instructions first:
http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade

Unless bitnami has their own instructions

RE: After migrating, the ISSUES and the ROLES are not accessibles. - Added by Olivier Moreau almost 3 years ago

Thanks James
I'm stuck with Step 4 - Update the database
bundle exec rake db:migrate RAILS_ENV=production

Never mind, back to 321...

RE: After migrating, the ISSUES and the ROLES are not accessibles. - Added by Toshi MARUYAMA almost 3 years ago

Olivier Moreau wrote:

I got :
C:\Bitnami\redmine331\ruby\bin>rake db:migrate
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)

You should run on Redmine root.

RE: After migrating, the ISSUES and the ROLES are not accessibles. - Added by Olivier Moreau almost 3 years ago

Toshi MARUYAMA wrote:

You should run on Redmine root.

I copied the result of the rake command in Windows but it's identical on Linux with sudo rake :

ubuntu@serveur-2:~$ sudo rake db:migrate
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)

(1-11/11)