openstack-dashboard does not accept non-default db2 ports

Bug #1445511 reported by Finbar
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack + Chef
Fix Released
Medium
Mark Vanderwiel

Bug Description

[openstack-dashboard] local_settings.py.erb templates dont give option to specify port

Installing Openstack with DB2 database using the port 5103 (default port is 50000)
sync database will fall over as it has no port number for contacting the database

as part of the install the following script is run

python /usr/share/openstack-dashboard/manage.py syncdb

with the following stack trace
conn_options {102: 1}
Traceback (most recent call last):
  File "/usr/share/openstack-dashboard/manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 415, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
    cursor = connection.cursor()
  File "/usr/lib/python2.6/site-packages/django/db/backends/__init__.py", line 161, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/usr/lib/python2.6/site-packages/django/db/backends/__init__.py", line 131, in _cursor
    self.ensure_connection()
  File "/usr/lib/python2.6/site-packages/django/db/backends/__init__.py", line 126, in ensure_connection
    self.connect()
  File "/usr/lib/python2.6/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/lib/python2.6/site-packages/django/db/backends/__init__.py", line 126, in ensure_connection
    self.connect()
  File "/usr/lib/python2.6/site-packages/django/db/backends/__init__.py", line 114, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/lib/python2.6/site-packages/ibm_db_django/base.py", line 214, in get_new_connection
    connection = self.databaseWrapper.get_new_connection(conn_params)
  File "/usr/lib/python2.6/site-packages/ibm_db_django/pybase.py", line 88, in get_new_connection
    connection = Database.connect( **kwargs )
  File "/usr/lib64/python2.6/site-packages/ibm_db_dbi.py", line 589, in connect
    raise _get_exception(inst)
django.db.utils.OperationalError

If the cookbook template is modified to hardcode in this port of 5103
then the issue does not happen

DATABASES = {
    'default': {
        'ENGINE': '<%= engine %>',
        'NAME': '<%= @db_info["db_name"] %>',
<% unless @db_info['service_type'] == 'sqlite' %>
        'USER': '<%= node["openstack"]["db"]["dashboard"]["username"] %>',
        'PASSWORD': '<%= @db_pass %>',
        'HOST': '<%= @db_info["host"] %>',
<% end %>
        'default-character-set': 'utf8',
        'PORT': '5103'
    },
}

Tags: dashboard
tags: added: dashboard
Changed in openstack-chef:
assignee: nobody → Mark Vanderwiel (vanderwl)
importance: Undecided → Medium
milestone: none → kilo-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cookbook-openstack-dashboard (master)

Fix proposed to branch: master
Review: https://review.openstack.org/175101

Changed in openstack-chef:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cookbook-openstack-dashboard (master)

Reviewed: https://review.openstack.org/175101
Committed: https://git.openstack.org/cgit/stackforge/cookbook-openstack-dashboard/commit/?id=3bbc28747e178ea2cc7cf4a0d1846f8f2d710b1e
Submitter: Jenkins
Branch: master

commit 3bbc28747e178ea2cc7cf4a0d1846f8f2d710b1e
Author: Mark Vanderwiel <email address hidden>
Date: Fri Apr 17 22:37:18 2015 -0500

    Allow non default db port for horizon

    Change-Id: I11bfc9a8f45e5c700b9c1d2b718623f096c3e403
    Closes-Bug: #1445511

Changed in openstack-chef:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cookbook-openstack-dashboard ocata-eol

This issue was fixed in the openstack/cookbook-openstack-dashboard ocata-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.