由rb-site升级Bitnami Review Board时无法连接到MySQL

时间:2018-01-26 10:26:29

标签: django bitnami review-board

我正在尝试将Bitnami ReviewBoard从3.0.1升级到3.0.2。我完成了venv/bin/easy_install -U ReviewBoard。但是当我尝试venv/bin/rb-site upgrade installdir/rb-sites/reviewboard/时,我获得了django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/opt/reviewboard-3.0.1-0/mysql/tmp/mysql.sock' (2)")的错误。

以下是详细日志:

bash-4.2# venv/bin/rb-site upgrade ./rb-sites/reviewboard/
Traceback (most recent call last):
  File "venv/bin/rb-site", line 11, in <module>
    load_entry_point('ReviewBoard==3.0.2', 'console_scripts', 'rb-site')()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/ReviewBoard-3.0.2-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1965,                                                                                                              in main
    command.run()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/ReviewBoard-3.0.2-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1742,                                                                                                              in run
    static_media_upgrade_needed = site.get_static_media_upgrade_needed()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/ReviewBoard-3.0.2-py2.7.egg/reviewboard/cmdline/rbsite.py", line 503,                                                                                                              in get_static_media_upgrade_needed
    siteconfig = SiteConfiguration.objects.get_current()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/Djblets-1.0.2-py2.7.egg/djblets/siteconfig/managers.py", line 50, in g                                                                                                             et_current
    site = Site.objects.get_current()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/contrib/sites/models.py", line 47, in get_current
    current_site = self.get(pk=sid)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/models/manager.py", line 151, in get
    return self.get_queryset().get(*args, **kwargs)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/models/query.py", line 304, in get
    num = len(clone)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/models/query.py", line 77, in __len__
    self._fetch_all()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/models/query.py", line 857, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/models/query.py", line 220, in iterator
    for row in compiler.results_iter():
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/models/sql/compiler.py", line 713, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/models/sql/compiler.py", line 785, in execute_sql
    cursor = self.connection.cursor()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/backends/__init__.py", line 162, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/backends/__init__.py", line 132, in _cursor
    self.ensure_connection()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/backends/__init__.py", line 127, in ensure_connection
    self.connect()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/backends/__init__.py", line 127, in ensure_connection
    self.connect()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/backends/__init__.py", line 115, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/django/db/backends/mysql/base.py", line 435, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site                                                                                                             -packages/MySQLdb/connections.py", line 193, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server th                                                                                                             rough socket '/opt/reviewboard-3.0.1-0/mysql/tmp/mysql.sock' (2)")
bash-4.2# pwd
/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs
bash-4.2# /opt/reviewboard-3.0.1-0/ctlscript.sh status
apache not running
mysql not running
memcached not running
bash-4.2# sudo venv/bin/rb-site upgrade ./rb-sites/reviewboard/
Cannot locate wrapped file
bash-4.2# venv/bin/rb-site upgrade ./rb-sites/reviewboard/
Traceback (most recent call last):
  File "venv/bin/rb-site", line 11, in <module>
    load_entry_point('ReviewBoard==3.0.2', 'console_scripts', 'rb-site')()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/ReviewBoard-3.0.2-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1965, in main
    command.run()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/ReviewBoard-3.0.2-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1742, in run
    static_media_upgrade_needed = site.get_static_media_upgrade_needed()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/ReviewBoard-3.0.2-py2.7.egg/reviewboard/cmdline/rbsite.py", line 503, in get_static_media_upgrade_needed
    siteconfig = SiteConfiguration.objects.get_current()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/Djblets-1.0.2-py2.7.egg/djblets/siteconfig/managers.py", line 50, in get_current
    site = Site.objects.get_current()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/contrib/sites/models.py", line 47, in get_current
    current_site = self.get(pk=sid)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/manager.py", line 151, in get
    return self.get_queryset().get(*args, **kwargs)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/query.py", line 304, in get
    num = len(clone)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/query.py", line 77, in __len__
    self._fetch_all()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
    for row in compiler.results_iter():
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 785, in execute_sql
    cursor = self.connection.cursor()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 162, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 132, in _cursor
    self.ensure_connection()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 127, in ensure_connection
    self.connect()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 127, in ensure_connection
    self.connect()
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/__init__.py", line 115, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 435, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/MySQLdb/connections.py", line 193, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/opt/reviewboard-3.0.1-0/mysql/tmp/mysql.sock' (2)")

所有操作都在Bitnami控制台中执行。

Environemnts:

bash-4.2# /opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/bin/rb-site --version
rb-site 3.0.2
Python 2.7.14 (default, Dec 12 2017, 10:27:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
Installed to /opt/reviewboard-3.0.1-0/apps/reviewboard/htdocs/venv/lib/python2.7/site-packages/ReviewBoard-3.0.2-py2.7.egg/reviewboard

目前,如果我启动所有必需的服务并访问审核委员会,则会显示以下页面: enter image description here

提前谢谢!!

1 个答案:

答案 0 :(得分:0)

这是我的愚蠢错误!我认为升级应该停止MySQL服务。在我启动MySQL服务后它完美运行。