Charm does not create database entries due to use of deprecated syncdb command

Bug #1777358 reported by KingJ
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Akihiro Motoki
OpenStack Dashboard Charm
Fix Released
High
Frode Nordahl

Bug Description

I'm trying to deploy the openstack-dashboard charm in a bionic LXD container. As I want to be able to use Keystone v3, I have related the charm to the percona-cluster charm through the use of the shared-db interface.

However, during the charm's installation I see the following error in the logs;

unit-openstack-dashboard-4: 20:39:39 DEBUG unit.openstack-dashboard/4.shared-db-relation-changed Unknown command: 'syncdb'
unit-openstack-dashboard-4: 20:39:39 DEBUG unit.openstack-dashboard/4.shared-db-relation-changed Type 'manage.py help' for usage.

Despite this, the charm completes installation and can be reached via the browser. However, upon login an error is thrown in the Apache logs - attached as openstack-dashboard-charm-traceback.txt - and the login fails.

Due to the syncdb error during the installation, the database is never created on the shared-db - hence the traceback on login.

The syncdb command was deprecated in Django 1.7 and removed in 1.9. The version of Django in this charm/bionic is 1.11.11, hence the error. Instead, the syncdb command has been replaced with makemigrations and migrate, see https://docs.djangoproject.com/en/dev/topics/migrations/ .

As this was a fresh installation, I manually ran manage.py migrate. After this, no tracebacks were observed in the Apache logs.

Charm version: 259

Revision history for this message
KingJ (kj-kingj) wrote :
Frode Nordahl (fnordahl)
Changed in charm-openstack-dashboard:
importance: Undecided → High
milestone: none → 18.08
status: New → Triaged
tags: added: stable-backport
Revision history for this message
Frode Nordahl (fnordahl) wrote :

As a temporary workaround it is possible to get a functional dashboard by deploying the openstack-dashboard without the shared-db relation (it does also work with Keystone v3). Having said that, we do of course want to fix this as soon as possible.

Revision history for this message
Frode Nordahl (fnordahl) wrote :

Adding a task for upstream horizon project as its documentation still references the now non-functional `syncdb` command.

Revision history for this message
Frode Nordahl (fnordahl) wrote :
Changed in charm-openstack-dashboard:
status: Triaged → In Progress
assignee: nobody → Frode Nordahl (fnordahl)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-openstack-dashboard (master)

Reviewed: https://review.openstack.org/576411
Committed: https://git.openstack.org/cgit/openstack/charm-openstack-dashboard/commit/?id=db9fac5f4b5558c17dc08ea6a8619a5a54f12bf5
Submitter: Zuul
Branch: master

commit db9fac5f4b5558c17dc08ea6a8619a5a54f12bf5
Author: Frode Nordahl <email address hidden>
Date: Tue Jun 19 10:03:54 2018 +0200

    Use `manage.py migrate` for django versions >= 1.9

    `syncdb` subcommand was deprecated in django 1.7
    and subsequently removed in 1.9.

    Use `subprocess.check_call()` so we catch errors.

    Add `shared-db` relation and enable debug logging in deployment
    used in functional test. Add functional test that authenticates
    through the dashboard.

    Update unit tests.

    Change-Id: I567461e57ec431fc470d7a2a31d3f16e9dc50e8b
    Closes-Bug: #1777358

Changed in charm-openstack-dashboard:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/18.05)

Fix proposed to branch: stable/18.05
Review: https://review.openstack.org/577723

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-openstack-dashboard (stable/18.05)

Reviewed: https://review.openstack.org/577723
Committed: https://git.openstack.org/cgit/openstack/charm-openstack-dashboard/commit/?id=529ba5d9b50b43dc1dd2b6aac600632dbc274de7
Submitter: Zuul
Branch: stable/18.05

commit 529ba5d9b50b43dc1dd2b6aac600632dbc274de7
Author: Frode Nordahl <email address hidden>
Date: Tue Jun 19 10:03:54 2018 +0200

    Use `manage.py migrate` for django versions >= 1.9

    `syncdb` subcommand was deprecated in django 1.7
    and subsequently removed in 1.9.

    Use `subprocess.check_call()` so we catch errors.

    Add `shared-db` relation and enable debug logging in deployment
    used in functional test. Add functional test that authenticates
    through the dashboard.

    Update unit tests.

    Change-Id: I567461e57ec431fc470d7a2a31d3f16e9dc50e8b
    Closes-Bug: #1777358
    (cherry picked from commit db9fac5f4b5558c17dc08ea6a8619a5a54f12bf5)

Frode Nordahl (fnordahl)
Changed in charm-openstack-dashboard:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
status: New → In Progress
Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/628988
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=8cc055157dde9e885bae29f4bad4518da427ce97
Submitter: Zuul
Branch: master

commit 8cc055157dde9e885bae29f4bad4518da427ce97
Author: Akihiro Motoki <email address hidden>
Date: Mon Jan 7 23:48:27 2019 +0900

    doc: Use `manage.py migrate`

    `syncdb` subcommand was deprecated in django 1.7 and subsequently
    removed in 1.9. We need to use 'manage.py migrate'.

    This commit also drops a sample output of 'manage.py migrate'.
    I don't think we need to maintain this kind of output and
    it can change per Django release.

    Closes-Bug: #1777358

    Reference: https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-database-backed-sessions

    Change-Id: Ib3a7e50584a8deb9bee409335464163b7b1258d1

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 15.0.0.0b2

This issue was fixed in the openstack/horizon 15.0.0.0b2 development milestone.

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.