[SRU] Issue in sahara-common.postinst.in: sahara-db-manage is executet on fresh install (even without a db-connection)

Bug #1452698 reported by Tino Schmeier on 2015-05-07
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
sahara (Ubuntu)
High
Denis Egorenko

Bug Description

Hi there,

i dont know if this is the right place for this bug-report!?

But the following script-lines will execute sahara-db-manage, even on an fresh install without any configured db-connection.

    if ! grep -qE "^(sql_)?connection( )?=.*" ${SAHARA_CONF} || \
         grep -qE "^(sql_)?connection.*sqlite.*" ${SAHARA_CONF}; then
                su -s /bin/sh -c 'sahara-db-manage --config-file /etc/sahara/sahara.conf upgrade head' sahara
    fi

Becuse the default is:

#connection=<None>

and this matches the negated grep .

# lsb_release -rd
Description: Ubuntu 14.04.2 LTS
Release: 14.04

# apt-cache policy sahara-common
sahara-common:
  Installed: 2015.1.0-0ubuntu1~cloud0
  Candidate: 2015.1.0-0ubuntu1~cloud0
  Version table:
 *** 2015.1.0-0ubuntu1~cloud0 0
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-proposed/kilo/main amd64 Packages
        100 /var/lib/dpkg/status
     2015.1~rc1-0ubuntu1~cloud0 0
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-updates/kilo/main amd64 Packages

Regards
Tino

[Impact]
sahara install fails with:

Traceback (most recent call last):
  File "/usr/bin/sahara-db-manage", line 10, in <module>
    sys.exit(main())
  ...
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 51, in create
    entrypoint = u._get_entrypoint()
AttributeError: 'NoneType' object has no attribute '_get_entrypoint'

[Test Case]
apt-get install sahara

[Regression Potential]
Minimal regression impact. The difference after this change is that the user (or installation tool) will need to run 'sahara-db-manage' after sahara is installed and configured to create the database schema.

Related branches

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sahara (Ubuntu):
status: New → Confirmed
Martin Mágr (mmagr) wrote :

This is very serious blocking bug, please fix as soon as possible

Martin Mágr (mmagr) wrote :
James Page (james-page) on 2015-06-08
Changed in sahara (Ubuntu):
importance: Undecided → High
summary: - Issue in sahara-common.postinst.in: sahara-db-manage is executet on
- fresh install (even without a db-connection)
+ [SRU] Issue in sahara-common.postinst.in: sahara-db-manage is executet
+ on fresh install (even without a db-connection)
description: updated
Denis Egorenko (degorenko) wrote :
Changed in sahara (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Denis Egorenko (degorenko)
Corey Bryant (corey.bryant) wrote :

This is fixed in Liberty as of sahara version 1:3.0.0~b2-0ubuntu2.

Changed in sahara (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers