nova-manage command when executed by non-root user, should give "authorization error" instead of low level database error

Bug #1368030 reported by vishal yadav
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Expired
Undecided
Unassigned
nova (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Version of nova-compute and distribution/package (1:2014.1.2-0ubuntu1.1)

1) Execute below command using "non-root" user.
ubuntu@mc1:~$ nova-manage flavor list

It gives below error:

Command failed, please check log for more info
2014-09-11 13:43:17.501 12857 CRITICAL nova [req-07bc6065-3ece-4fd5-b478-48d37c63a2c6 None None] OperationalError: (OperationalError) unable to open database file None None

2) Execute above command using "root" user:
ubuntu@mc1:~$ sudo su -
root@mc1:~# nova-manage flavor list
m1.medium: Memory: 4096MB, VCPUS: 2, Root: 40GB, Ephemeral: 0Gb, FlavorID: 3, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.tiny: Memory: 512MB, VCPUS: 1, Root: 1GB, Ephemeral: 0Gb, FlavorID: 1, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.large: Memory: 8192MB, VCPUS: 4, Root: 80GB, Ephemeral: 0Gb, FlavorID: 4, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.xlarge: Memory: 16384MB, VCPUS: 8, Root: 160GB, Ephemeral: 0Gb, FlavorID: 5, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.small: Memory: 2048MB, VCPUS: 1, Root: 20GB, Ephemeral: 0Gb, FlavorID: 2, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}

So instead of low level database error, it should give kind of "authorization error" to operator or end-user of "nova-manage" CLI.

Tags: nova-manage
summary: - nova-manage command when executed by non-root user should give
+ nova-manage command when executed by non-root user, should give
"authorization error" instead of low level database error
Revision history for this message
vishal yadav (vishalcdac07) wrote :

Severity for this issue is "low" as it does not impact the functionality but for operator or end user the error message is not informative.

Changed in nova:
importance: Undecided → Low
status: New → Confirmed
affects: ubuntu → nova (Ubuntu)
Changed in nova (Ubuntu):
assignee: nobody → Kanchan Gupta (kanchan-gupta1)
status: New → In Progress
Revision history for this message
Kanchan Gupta (kanchan-gupta1) wrote :

Version information:
nova-2.18.2 and ubuntu-12.04

When I run the command I am not getting any error and the command returns the desired output from both root as well as non-root users.
Following is the output when run as non-root user:

lenovo@ThinkCentre-M58p:~$ source openrc admin admin
lenovo@ThinkCentre-M58p:~$ nova-manage flavor list
2014-09-17 17:23:55.962 DEBUG oslo.db.sqlalchemy.session [req-f7e0d6b2-1ca5-4bce-aa4b-e87c78dd032c None None] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _mysql_check_effective_sql_mode /usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/session.py:401
m1.medium: Memory: 4096MB, VCPUS: 2, Root: 40GB, Ephemeral: 0Gb, FlavorID: 3, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.tiny: Memory: 512MB, VCPUS: 1, Root: 1GB, Ephemeral: 0Gb, FlavorID: 1, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.large: Memory: 8192MB, VCPUS: 4, Root: 80GB, Ephemeral: 0Gb, FlavorID: 4, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.xlarge: Memory: 16384MB, VCPUS: 8, Root: 160GB, Ephemeral: 0Gb, FlavorID: 5, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.small: Memory: 2048MB, VCPUS: 1, Root: 20GB, Ephemeral: 0Gb, FlavorID: 2, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.nano: Memory: 64MB, VCPUS: 1, Root: 0GB, Ephemeral: 0Gb, FlavorID: 42, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.micro: Memory: 128MB, VCPUS: 1, Root: 0GB, Ephemeral: 0Gb, FlavorID: 84, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.heat: Memory: 512MB, VCPUS: 1, Root: 0GB, Ephemeral: 0Gb, FlavorID: 451, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
abcdef: Memory: 1MB, VCPUS: 1, Root: 1GB, Ephemeral: 0Gb, FlavorID: 537f7c70-3fd1-4d0a-9784-007760264b37, Swap: 0MB, RXTX Factor: 1.0, private, ExtraSpecs {}

Changed in nova (Ubuntu):
status: In Progress → Confirmed
assignee: Kanchan Gupta (kanchan-gupta1) → nobody
Chuck Short (zulcss)
Changed in nova (Ubuntu):
importance: Undecided → Low
Changed in nova:
assignee: nobody → vishal yadav (vishalcdac07)
Revision history for this message
Neetu Jain (nutshi) wrote :

not seeing the error

Changed in nova:
assignee: vishal yadav (vishalcdac07) → nobody
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote : Cleanup EOL bug report

This is an automated cleanup. This bug report has been closed because it
is older than 18 months and there is no open code change to fix this.
After this time it is unlikely that the circumstances which lead to
the observed issue can be reproduced.

If you can reproduce the bug, please:
* reopen the bug report (set to status "New")
* AND add the detailed steps to reproduce the issue (if applicable)
* AND leave a comment "CONFIRMED FOR: <RELEASE_NAME>"
  Only still supported release names are valid (LIBERTY, MITAKA, OCATA, NEWTON).
  Valid example: CONFIRMED FOR: LIBERTY

Changed in nova:
importance: Low → Undecided
status: Confirmed → Expired
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.