Migration from Windows to Linux server

Hi, I try to migrate from Windows installation to Linux one.
I was having Windows version 2.5.1-1 and wanted to move to Linux version 2.5.7-2.

So I first upgraded the Windows version 2.5.7-2 under Windows to avoid some convertion problems. This went well, I,m using MySQL database.

So I dump the previous database (into use_reviewboard env):

mysqldump -u root -p bitnami_reviewboard > backup.sql

I recorded the config file:

apps\reviewboard\htdocs\rb-sites\reviewboard\conf\settings_local.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'bitnami_reviewboard',
        'USER': 'bn_reviewboard',
        'PASSWORD': 'mySuperPassword',
        'HOST': '127.0.0.1',
        'PORT': '3306',
    },
}

I removed the 2.5.1-1 install and services.
I installed 2.5.7-2.

Reimported the mysql data (into the new use_reviewboard env):

mysql -u root -p
mysql> drop database bitnami_reviewboard;
mysql> create database bitnami_reviewboard;
mysql> grant all privileges on bitnami_redmine.* to 'bn_redmine'@'localhost' identified by 'mySuperPassword';
mysql> exit
mysql -u root -p bitnami_reviewboard < backup.sql

Then I upgraded the database info (into reviewboard env):

rb-site upgrade C:\Bitnami\reviewboard-2.5.7-2\apps\reviewboard\htdocs\rb-sites\reviewboard

The convertion started and completed ok, so I reinstalled the services and restart the mysql.

I had a 500 error something broke, so I copied the database password (‘mySuperPassword’) into the new

apps\reviewboard\htdocs\rb-sites\reviewboard\conf\settings_local.py

Then everything started just fine on Windows.

So I created my CentOS 7 VM machine and installed the bitnami 2.5.7-2 Linux version. Did the same backup/restore like I did for the Windows migration. The rb-site upgrade said nothing is required. I did change the settings_local.py file database password.

But I still get error 500 when accessing the dashboard (The landing page bitnami apache is working).
clear

there’s nothing into special or related into:

apps/reviewboard/htdocs/rb-sites/reviewboard/logs
mysql/data/mysqld.log
apache2/logs/error_log

So I wonder what is missing here?!? The database empty was working just fine. So I wonder if any setting into the tables data must be change when moving platforms?

Anybody have a clue on what I should check here?
How can I debug this??? any way to get more info above the

Something broke! (Error 500)
It appears something broke when you tried to go to here. This is either a bug in Review Board or a server configuration error. Please report this to your administrator.

Thanks,
Jerome

Here’s the log content when I try to access the dashboard:

bash-4.2# cat apache2/logs/access_log
10.1.30.177 - - [13/Jan/2017:14:15:45 -0500] "GET /reviewboard/ HTTP/1.1" 500 250
    10.1.30.177 - - [13/Jan/2017:14:15:52 -0500] "GET /reviewboard/ HTTP/1.1" 500 250
    10.1.30.177 - - [13/Jan/2017:14:15:53 -0500] "GET /favicon.ico HTTP/1.1" 200 1150
    10.1.30.177 - - [13/Jan/2017:14:15:56 -0500] "GET / HTTP/1.1" 200 803
    10.1.30.177 - - [13/Jan/2017:14:15:58 -0500] "GET /reviewboard/ HTTP/1.1" 500 250
    bash-4.2# cat apache2/logs/error_log
    [Fri Jan 13 14:03:59.162176 2017] [ssl:warn] [pid 24744] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
    [Fri Jan 13 14:03:59.230390 2017] [ssl:warn] [pid 24745] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
    [Fri Jan 13 14:03:59.244530 2017] [mpm_prefork:notice] [pid 24745] AH00163: Apache/2.4.23 (Unix) OpenSSL/1.0.2j mod_wsgi/3.5 Python/2.7.12 configured -- resuming normal operations
    [Fri Jan 13 14:03:59.244567 2017] [core:notice] [pid 24745] AH00094: Command line: '/opt/reviewboard-2.5.7-2/apache2/bin/httpd.bin -f /opt/reviewboard-2.5.7-2/apache2/conf/httpd.conf'
    [Fri Jan 13 14:16:05.143736 2017] [mpm_prefork:notice] [pid 24745] AH00169: caught SIGTERM, shutting down
    [Fri Jan 13 19:16:05.238568 2017] [pagespeed:error] [pid 24751] [mod_pagespeed 1.9.32.14-0 @24751] Attempt to destroy unknown SHM segment [1]/opt/reviewboard-2.5.7-2/apache2/var/cache/mod_pagespeed//named_locks.
    [Fri Jan 13 19:16:05.238635 2017] [pagespeed:error] [pid 24751] [mod_pagespeed 1.9.32.14-0 @24751] Attempt to destroy unknown SHM segment [1]pagespeed_default_shm/metadata_cache.
    [Fri Jan 13 19:16:05.238649 2017] [pagespeed:error] [pid 24751] [mod_pagespeed 1.9.32.14-0 @24751] Attempt to destroy unknown SHM segment [1]globalstatistics.
    [Fri Jan 13 19:16:05.238693 2017] [pagespeed:error] [pid 24751] [mod_pagespeed  @24751] [0113/191605:ERROR:google_message_handler.cc(41)] Attempt to destroy unknown SHM segment [1]SharedCircularBuffer.:0.
    [Fri Jan 13 19:16:05.249569 2017] [pagespeed:error] [pid 24749] [mod_pagespeed 1.9.32.14-0 @24749] Attempt to destroy unknown SHM segment [1]/opt/reviewboard-2.5.7-2/apache2/var/cache/mod_pagespeed//named_locks.
    [Fri Jan 13 19:16:05.249636 2017] [pagespeed:error] [pid 24749] [mod_pagespeed 1.9.32.14-0 @24749] Attempt to destroy unknown SHM segment [1]pagespeed_default_shm/metadata_cache.
    [Fri Jan 13 19:16:05.249651 2017] [pagespeed:error] [pid 24749] [mod_pagespeed 1.9.32.14-0 @24749] Attempt to destroy unknown SHM segment [1]globalstatistics.
    [Fri Jan 13 19:16:05.249697 2017] [pagespeed:error] [pid 24749] [mod_pagespeed  @24749] [0113/191605:ERROR:google_message_handler.cc(41)] Attempt to destroy unknown SHM segment [1]SharedCircularBuffer.:0.
bash-4.2# cat mysql/data/mysqld.log
170113 14:30:40 mysqld_safe Starting mysqld.bin daemon with databases from /opt/reviewboard-2.5.7-2/mysql/data
170113 14:30:40 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
170113 14:30:40 [Note] /opt/reviewboard-2.5.7-2/mysql/bin/mysqld.bin (mysqld 5.5.53) starting as process 25246 ...
170113 14:30:40 [Note] Plugin 'FEDERATED' is disabled.
170113 14:30:40 InnoDB: The InnoDB memory heap is disabled
170113 14:30:40 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170113 14:30:40 InnoDB: Compressed tables use zlib 1.2.3
170113 14:30:40 InnoDB: Using Linux native AIO
170113 14:30:40 InnoDB: Initializing buffer pool, size = 128.0M
170113 14:30:40 InnoDB: Completed initialization of buffer pool
170113 14:30:40 InnoDB: highest supported file format is Barracuda.
170113 14:30:41  InnoDB: Waiting for the background threads to start
170113 14:30:42 InnoDB: 5.5.53 started; log sequence number 149055746
170113 14:30:42 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
170113 14:30:42 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
170113 14:30:42 [Note] Server socket created on IP: '127.0.0.1'.
170113 14:30:42 [Note] Event Scheduler: Loaded 0 events
170113 14:30:42 [Note] /opt/reviewboard-2.5.7-2/mysql/bin/mysqld.bin: ready for connections.
Version: '5.5.53'  socket: '/opt/reviewboard-2.5.7-2/mysql/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)

I think I have found a clue, the table siteconfig_siteconfiguration contain the server config and the paths! so the Windows dump going to Linux, some paths are C:… which would prevent the server configuration. I guess I have to cherry pick the data I import here!

Is there an easy way to reset the site config table to original value? Else I will try to reinstall a clean reviewboard on Linux, dump the tables settings. Import from Windows, then restore the siteconfig form original linux. then reproduce the Windows config for non path related entry.

Not sure this is the only tables that could suffer from this or if this will make it work, but it could explain a lot.

Why those path are inside the database is beyond me, they should be into a different database or config file. If someone install the server into a different path, it will suffer from the same problems as migrating from Windows to Linux (if this is correct).

Jerome

Hi @jerome1,

What I would do, since this is the most likely source of issues, would be treating the sql dump file as text and automatically correct the wrong paths with correct ones, using grep to find the issues and sed to correct the file.

If you provide me the wrong, old path shown in the database (the windows installation root directory is enough) and the new installation root directory, I can give you a command to execute over the sql dump, so in theory using that dump instead of your current one would solve the issue.

We’ll be looking forward to receiving your reply.

Best regards,

David González

Hi,

The good: I made a dump from a clean Linux install and merge the tables with the proper entry. Now the path are the default Linux one, but the others settings are kept.

The bad: I still get an error 500.

Look like I got mysql acces error even if I did into the run (I used the same password from imported database as the Windows one, and modified the apps/reviewboard/htdocs/rb-sites/reviewboard/conf/settings_local.py on Linux to match the same password):

use_reviewboard
mysql -u root -p
mysql> grant all privileges on bitnami_reviewboard.* to 'bn_reviewboard'@'localhost' identified by 'DATABASES_PASSWORD_FROM_SETTINGS_LOCAL.PY'

If I check the privileges:

mysql> show grants for 'bn_reviewboard'@'localhost';
+-----------------------------------------------------------------------------------------------------------------------+
| Grants for bn_reviewboard@localhost                                                                                   |
+-----------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'bn_reviewboard'@'localhost' IDENTIFIED BY PASSWORD 'I_DID_NOT_COPY_REAL_VALUE_HERE' |
| GRANT ALL PRIVILEGES ON `bitnami_reviewboard`.* TO 'bn_reviewboard'@'localhost'                                       |
+-----------------------------------------------------------------------------------------------------------------------+

The apache log indicate it cannot access the database properly somehow???

[Mon Jan 16 15:08:25.968908 2017] [:error] [pid 33711] ERROR:root:Could not load siteconfig: (1045, "Access denied for user 'bn_reviewboard'@'localhost' (using password: YES)")
[Mon Jan 16 15:08:26.149179 2017] [:error] [pid 33711] CRITICAL:root:Unable to load SiteConfiguration: (1045, "Access denied for user 'bn_reviewboard'@'localhost' (using password: YES)")
[Mon Jan 16 15:08:26.149206 2017] [:error] [pid 33711] Traceback (most recent call last):
[Mon Jan 16 15:08:26.149210 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/reviewboard/admin/middleware.py", line 44, in process_request
[Mon Jan 16 15:08:26.149214 2017] [:error] [pid 33711]     siteconfig = SiteConfiguration.objects.get_current()
[Mon Jan 16 15:08:26.149217 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/djblets/siteconfig/managers.py", line 50, in get_current
[Mon Jan 16 15:08:26.149221 2017] [:error] [pid 33711]     site = Site.objects.get_current()
[Mon Jan 16 15:08:26.149224 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/contrib/sites/models.py", line 47, in get_current
[Mon Jan 16 15:08:26.149228 2017] [:error] [pid 33711]     current_site = self.get(pk=sid)
[Mon Jan 16 15:08:26.149231 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/manager.py", line 151, in get
[Mon Jan 16 15:08:26.149235 2017] [:error] [pid 33711]     return self.get_queryset().get(*args, **kwargs)
[Mon Jan 16 15:08:26.149238 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/query.py", line 304, in get
[Mon Jan 16 15:08:26.149241 2017] [:error] [pid 33711]     num = len(clone)
[Mon Jan 16 15:08:26.149244 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/query.py", line 77, in __len__
[Mon Jan 16 15:08:26.149248 2017] [:error] [pid 33711]     self._fetch_all()
[Mon Jan 16 15:08:26.149251 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
[Mon Jan 16 15:08:26.149254 2017] [:error] [pid 33711]     self._result_cache = list(self.iterator())
[Mon Jan 16 15:08:26.149265 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
[Mon Jan 16 15:08:26.149270 2017] [:error] [pid 33711]     for row in compiler.results_iter():
[Mon Jan 16 15:08:26.149273 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
[Mon Jan 16 15:08:26.149277 2017] [:error] [pid 33711]     for rows in self.execute_sql(MULTI):
[Mon Jan 16 15:08:26.149280 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 785, in execute_sql
[Mon Jan 16 15:08:26.149283 2017] [:error] [pid 33711]     cursor = self.connection.cursor()
[Mon Jan 16 15:08:26.149286 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 162, in cursor
[Mon Jan 16 15:08:26.149290 2017] [:error] [pid 33711]     cursor = util.CursorWrapper(self._cursor(), self)
[Mon Jan 16 15:08:26.149293 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 132, in _cursor
[Mon Jan 16 15:08:26.149297 2017] [:error] [pid 33711]     self.ensure_connection()
[Mon Jan 16 15:08:26.149300 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 127, in ensure_connection
[Mon Jan 16 15:08:26.149304 2017] [:error] [pid 33711]     self.connect()
[Mon Jan 16 15:08:26.149306 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
[Mon Jan 16 15:08:26.149310 2017] [:error] [pid 33711]     six.reraise(dj_exc_type, dj_exc_value, traceback)
[Mon Jan 16 15:08:26.149313 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 127, in ensure_connection
[Mon Jan 16 15:08:26.149317 2017] [:error] [pid 33711]     self.connect()
[Mon Jan 16 15:08:26.149320 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 115, in connect
[Mon Jan 16 15:08:26.149323 2017] [:error] [pid 33711]     self.connection = self.get_new_connection(conn_params)
[Mon Jan 16 15:08:26.149326 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 435, in get_new_connection
[Mon Jan 16 15:08:26.149330 2017] [:error] [pid 33711]     conn = Database.connect(**conn_params)
[Mon Jan 16 15:08:26.149333 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
[Mon Jan 16 15:08:26.149337 2017] [:error] [pid 33711]     return Connection(*args, **kwargs)
[Mon Jan 16 15:08:26.149340 2017] [:error] [pid 33711]   File "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/MySQLdb/connections.py", line 193, in __init__
[Mon Jan 16 15:08:26.149343 2017] [:error] [pid 33711]     super(Connection, self).__init__(*args, **kwargs2)
[Mon Jan 16 15:08:26.149346 2017] [:error] [pid 33711] OperationalError: (1045, "Access denied for user 'bn_reviewboard'@'localhost' (using password: YES)")

Ok I rerun the grant command and restart de server and everything seem to be fine, maybe some caching issue at work here!

Hi again @jerome1,

I am very happy you managed to solve it. The issue you found is weird indeed, and is very likely to be related to caching somewhere. Thanks for sharing your solution with us.

Is there anything else we can help you with?

Best regards,

David González