Project

General

Profile

Rake commands failing when migrating db and plugins

Added by Jacob Spaid almost 11 years ago

I'm working on getting a disaster recovery setup for our company redmine install, in the case the server goes down and we need to do a full install. The issue with this is that I was not the one that installed redmine on our server so I am very new to it in general. What i'm attempting to do is create a mirrored version of redmine using the backups we create nightly on a separate computer, then create the scripts and documentation after.
So here's where I'm at
Computer OS: Ubuntu Server 12.04
Database structure: MySQL
Server Version - 5.5.32
Redmine Ver: 2.3.1.stable
Ruby Ver: 1.9.3
Rails Ver: 3.2.13

So what i have done is followed this guide (http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_231_On_Ubuntu_1204_with_git_and_Redmine_Git_Hosting_plugin) to install Redmine from scratch, which seemed to be successful. I then ran gunzip < $dbname"_"`date +%y_%m_%d`.gz |mysql -u root -p"DBPASSWORD" $dbname to grab our backup of the database which was successful.
Here's where the errors start:
I ran RAILS_ENV=production rake db:migrate
Got this error:
Mysql2::Error: SELECT command denied to user '' @ '192.168.183.101' for column 'value' in table 'custom_values': SHOW FULL FIELDS FROM 'DeveloperReworks'

Now this IP address is foreign to me, it is not he ip of the box, or any thing in our network that i can see. Also this command worked fine when i was creating the environment, before i copied the database over. Additionally the site is running as expected with all the data and plugins in it EXCEPT i can not get to Settings or load My Account.
My biggest question is where would it be pulling this user information from? my database.yml is as follows for production
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: my_password
encoding: utf8

Any help would be great, i've been searching for the past couple days.


Replies (2)

RE: Rake commands failing when migrating db and plugins - Added by Jan Niggemann (redmine.org team member) almost 11 years ago

Mysql2::Error: SELECT command denied to user '' @ '192.168.183.101' for column 'value' in table 'custom_values': SHOW FULL FIELDS FROM 'DeveloperReworks'

Are you sure no one's messing around your systems? Although the IP seems to be from the 192.168. Class C net (and therefore shouldn't be routed), it may as well be forged...

Now this IP address is foreign to me, it is not he ip of the box

Which box? The production system where Redmine is running on, the system you're using as a desaster recovery machine, your personal workstation, ...?

Anyway, I'd like to work together with you, because although we're running on Debian, we need similar recovery procedures and I have not yet begun to write any.

RE: Rake commands failing when migrating db and plugins - Added by Jacob Spaid almost 11 years ago

So i found the issue, it is a mysql error. Our backup database has a Definer set on 2 of the tables. Since that user doesn't exist on our DR machine, it was unable to log in to use the views and therefore the rake commands failed on those 2 tables. The tables were DeveloperReworks and DeveloperReworkDetails which may have been created by one of the plugins we were using.

What i did for testing purposes was recreated the 2 views in MySql with the definer set to a user that did exist, as i didn't think i could give the user with that IP access to the DR box (As i'm still not sure what the IP is from) That is not the IP of our Production box or the DR box, or my local box.

The reason our Settings and My Accounts were not work was because the user needed access to the tmp/cache folder to create the 900 folder. Now i'm not sure how to set the user access for this (i'm not sure what user needed access or where to set it) so we set it to be 777 (i know bad practice, but again testing) the folder was created by user: Nobody :group NoGroup and settings and my account now work.

So the site is working, tho i did some short cuts that will need to be fixed for the actual DR but i'm at a place where if needed we can bring it up. I just need to work on scripting it if my company still wants to go with this path (Talking about getting hosted with our hosting provider so we don't have to manage it anymore) but right now i'm learning a lot about linux and redmine and that is all that matters haha.

As for our plan, we are basically following the same idea as migrating to a new server, Backup of the Database and Files nightly along with having a backup of the plugins folder (only updated when we add plugins).
Install Ubuntu from scratch
Install Redmine using the guide in the OP
Import the DB, Plugins, and Files to the new redmine instance

Thanks for the response maybe you can help me with my remaining minor errors haha.

    (1-2/2)