Windows to Linux migration

59 views
Skip to first unread message

jer...@bodycad.com

unread,
Jan 13, 2017, 1:48:26 PM1/13/17
to reviewboard
Hi,

I'm having some trouble migrating my reviewboard from Windows to Linux. I was running Bitnami stack to have a self contain reviewboard. 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

David Trowbridge

unread,
Jan 13, 2017, 1:58:18 PM1/13/17
to reviewboard
You should definitely find something in the apache error log. I'd start by double-checking the apache logging configuration to make sure logs are ending up where you'd expect.

-David

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jer...@bodycad.com

unread,
Jan 13, 2017, 2:21:13 PM1/13/17
to reviewboard
I cleared the apache log and here's what I when fetching the page:

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.


Nothing to much there, page cache and modules not perfectly configured but should not be too much of a problems, cause before importing the database data was working just fine and the backup when imported into Windows reviewboard with the same steps works just fine. I'm a biut in the dark here.

jer...@bodycad.com

unread,
Jan 13, 2017, 2:32:58 PM1/13/17
to reviewboard
The mysqld.log

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)

Not much there either. I'm a bit puzzled what is wrong here... maybe some encoding error into the SQL backup???

David Trowbridge

unread,
Jan 13, 2017, 2:52:01 PM1/13/17
to reviewboard
Can you send the contents of the apache VirtualHost config (which probably lives in the review board site's conf/ directory)?

-David

jer...@bodycad.com

unread,
Jan 13, 2017, 3:00:44 PM1/13/17
to reviewboard
From inside /opt/reviewboard-2.5.7-2/ folder:

bash-4.2# cat apps/reviewboard/conf/httpd-vhosts.conf
<VirtualHost *:80>
    ServerName reviewboard.example.com
    ServerAlias www.reviewboard.example.com
    DocumentRoot "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs"

    Include "/opt/reviewboard-2.5.7-2/apps/reviewboard/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
    ServerName reviewboard.example.com
    ServerAlias www.reviewboard.example.com
    DocumentRoot "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs"
    SSLEngine on
    SSLCertificateFile "/opt/reviewboard-2.5.7-2/apps/reviewboard/conf/certs/server.crt"
    SSLCertificateKeyFile "/opt/reviewboard-2.5.7-2/apps/reviewboard/conf/certs/server.key"

    Include "/opt/reviewboard-2.5.7-2/apps/reviewboard/conf/httpd-app.conf"
</VirtualHost>

Here's the included config file:
bash-4.2# cat apps/reviewboard/conf/httpd-app.conf
<IfDefine !IS_REVIEWBOARD_LOADED>
Define IS_REVIEWBOARD_LOADED
WSGIDaemonProcess wsgi-reviewboard user=daemon group=daemon processes=2 threads=15 home=/opt/reviewboard-2.5.7-2/apps/reviewboard python-path=/opt/reviewboard-2.5.7-2/apps/reviewboard:/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages  display-name=%{GROUP}
</IfDefine>

<Directory "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs">
    Options -Indexes +FollowSymLinks
    AllowOverride All
    <IfVersion < 2.3 >
        Order allow,deny
        Allow from all
    </IfVersion>
    <IfVersion >= 2.3>
        Require all granted
    </IfVersion>

    WSGIProcessGroup wsgi-reviewboard

    Include "/opt/reviewboard-2.5.7-2/apps/reviewboard/conf/banner.conf"
</Directory>

<IfModule pagespeed_module>
  ModPagespeedDisallow "*"
</IfModule>

WSGIPassAuthorization On
WSGIScriptAlias "/reviewboard" "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs/reviewboard.wsgi/reviewboard"

<Directory "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs/media/uploaded">
  SetHandler None
  Options None

  AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp
  AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb

  <IfModule mod_php5.c>
    php_flag engine off
  </IfModule>
</Directory>

# Alias static media requests to filesystem
Alias /reviewboard/media "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs/media"
Alias /reviewboard/static "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs/static"
Alias /reviewboard/errordocs "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs/errordocs"
Alias /reviewboard/favicon.ico "/opt/reviewboard-2.5.7-2/apps/reviewboard/htdocs/rb-sites/reviewboard/htdocs/media/rbcommons/images/favicon.png"


The server was working just fine before importing MySQL data, so I doubt the Apache config is at fault here, my guess is that you wanted to see if I changed the logging system into the vhost.

Jerome

jer...@bodycad.com

unread,
Jan 13, 2017, 4:11:12 PM1/13/17
to reviewboard
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.

Jerome

jer...@bodycad.com

unread,
Jan 16, 2017, 10:39:41 AM1/16/17
to reviewboard

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)")


Something is wrong for some reason...



jer...@bodycad.com

unread,
Jan 16, 2017, 10:45:46 AM1/16/17
to reviewboard
Ok I rerun the grant command and restart de server and everything seem to be fine, maybe some caching issue at work here!

Christian Hammond

unread,
Jan 17, 2017, 7:06:44 PM1/17/17
to revie...@googlegroups.com
Glad it's working!

If your settings_local.py was updated with a new password, the web server would have needed a restart. Otherwise, there shouldn't have been any kind of caching at play. Either way, works now :)

Christian


On Mon, Jan 16, 2017 at 07:45 <jer...@bodycad.com> wrote:
Ok I rerun the grant command and restart de server and everything seem to be fine, maybe some caching issue at work here!








Reply all
Reply to author
Forward
0 new messages