nova-objectstore ignores flags in /etc/nova/nova.conf

Bug #820360 reported by Andrew Glen-Young
This bug report is a duplicate of:  Bug #820968: nova-objectstore runs as root. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Incomplete
Undecided
Unassigned

Bug Description

When I start nova-objectstore the daemon listens on a different IP address and port from what I have specified in the nova config file. Starting the daemon with or without upstart yields the same result.

What I expect

- nova-objectstore to listen on the IP address as specified by --s3_host in /etc/nova/nova.conf
- nova-objectstore to listen on the port as specified by --s3_port in /etc/nova/nova.conf
- nova-objectstore should listen on the IP address as specified by --my_ip if --s3_host is not specified in /etc/nova/nova.conf

What happens

- nova-objectstore listens on port 3333 on my server's primary IP address

Testing

The relevant flags:

    root@host:~# grep -E '^--(s3_(host|port)|my_ip)' /etc/nova/nova.conf
    --my_ip=10.55.58.254
    --s3_host=10.55.58.254
    --s3_port=6666

Starting nova-objectstore as Upstart does:

    root@host:~# nova-objectstore --uid $(getent passwd nova | cut -f3 -d:) --gid $(getent passwd nova | cut -f4 -d:) --pidfile /var/run/nova/nova-objectstore.pid --flagfile=/etc/nova/nova.conf --nodaemon --logfile=/var/log/nova/nova-objectstore.log
    /usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py:8: UserWarning: Module paste was already imported from None, but /usr/lib/python2.7/dist-packages is being added to sys.path
      import pkg_resources
    2011-08-03 13:30:24,956 INFO nova.wsgi [-] Started S3 Objectstore on 10.55.59.2:3333

Port/IP address listing:

    root@host:~# ss -lntp | grep -E '3333|6666'
    0 128 10.55.59.2:3333 *:* users:(("nova-objectstor",17777,3))

Package version:

    root@host:~# dpkg-query --show nova-objectstore
    nova-objectstore 2011.3~d3-0ubuntu1

OS release:

    root@host:~# cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=11.10
    DISTRIB_CODENAME=oneiric
    DISTRIB_DESCRIPTION="Ubuntu oneiric (development branch)"

Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: [Bug 820360] [NEW] nova-objectstore ignores flags in /etc/nova/nova.conf
Download full text (4.8 KiB)

Hmm, this looks like a packaging bug. Can you try starting it the same way that the other services are started and see if it works?

exec su -c "nova-objectstore --flagfile=/etc/nova/nova.conf" nova

it looks like the objectstore upstart script was never converted

Vish

On Aug 3, 2011, at 6:04 AM, Andrew Glen-Young wrote:

> Public bug reported:
>
> When I start nova-objectstore the daemon listens on a different IP
> address and port from what I have specified in the nova config file.
> Starting the daemon with or without upstart yields the same result.
>
> What I expect
>
> - nova-objectstore to listen on the IP address as specified by --s3_host in /etc/nova/nova.conf
> - nova-objectstore to listen on the port as specified by --s3_port in /etc/nova/nova.conf
> - nova-objectstore should listen on the IP address as specified by --my_ip if --s3_host is not specified in /etc/nova/nova.conf
>
> What happens
>
> - nova-objectstore listens on port 3333 on my server's primary IP
> address
>
>
> Testing
>
> The relevant flags:
>
> root@host:~# grep -E '^--(s3_(host|port)|my_ip)' /etc/nova/nova.conf
> --my_ip=10.55.58.254
> --s3_host=10.55.58.254
> --s3_port=6666
>
> Starting nova-objectstore as Upstart does:
>
> root@host:~# nova-objectstore --uid $(getent passwd nova | cut -f3 -d:) --gid $(getent passwd nova | cut -f4 -d:) --pidfile /var/run/nova/nova-objectstore.pid --flagfile=/etc/nova/nova.conf --nodaemon --logfile=/var/log/nova/nova-objectstore.log
> /usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py:8: UserWarning: Module paste was already imported from None, but /usr/lib/python2.7/dist-packages is being added to sys.path
> import pkg_resources
> 2011-08-03 13:30:24,956 INFO nova.wsgi [-] Started S3 Objectstore on 10.55.59.2:3333
>
> Port/IP address listing:
>
> root@host:~# ss -lntp | grep -E '3333|6666'
> 0 128 10.55.59.2:3333 *:* users:(("nova-objectstor",17777,3))
>
> Package version:
>
> root@host:~# dpkg-query --show nova-objectstore
> nova-objectstore 2011.3~d3-0ubuntu1
>
> OS release:
>
> root@host:~# cat /etc/lsb-release
> DISTRIB_ID=Ubuntu
> DISTRIB_RELEASE=11.10
> DISTRIB_CODENAME=oneiric
> DISTRIB_DESCRIPTION="Ubuntu oneiric (development branch)"
>
> ** Affects: nova
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/820360
>
> Title:
> nova-objectstore ignores flags in /etc/nova/nova.conf
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> When I start nova-objectstore the daemon listens on a different IP
> address and port from what I have specified in the nova config file.
> Starting the daemon with or without upstart yields the same result.
>
> What I expect
>
> - nova-objectstore to listen on the IP address as specified by --s3_host in /etc/nova/nova.conf
> - nova-objectstore to listen on the port as specified by --s3_port in /etc/nova/nova.conf
> - nova-objectstore should listen on the IP ...

Read more...

Revision history for this message
Thierry Carrez (ttx) wrote :

Hmm, I can't reproduce that. If I set --s3_port=3334 in my /etc/nova/nova.conf, nova-objectstore starts on port 3334 alright:

Started S3 Objectstore on 192.168.0.111:3334

That said, it starts up as root, while it should start up as nova -> created bug 820968 to track that

Andrew, any funky permissions on /etc/nova/nova.conf that would prevent root from reading it on your setup ? Does running as nova solve it ?

Changed in nova:
status: New → Incomplete
Revision history for this message
Andrew Glen-Young (aglenyoung) wrote :

@Vish, @Thierry:

The current upstart script does seem to run as root and creates /var/log/nova/nova-objectstore.log owned as root.
Once I chowned the log file to be owned by the nova user and changed the upstart script to run as Vish has suggested, the daemon starts correctly.

Manual tests:

I expect the daemon to start listening on 10.55.58.254:6666 as is configured in /etc/nova/nova.conf

1) Run the start command as root [FAIL]

    root@host:~# nova-objectstore --uid $(getent passwd nova | cut -f3 -d:) --gid $(getent passwd nova | cut -f4 -d:) \
                                   --pidfile /var/run/nova/nova-objectstore.pid --flagfile=/etc/nova/nova.conf --nodaemon \
                                   --logfile=/var/log/nova/nova-objectstore.log
    2011-08-04 16:21:25,005 INFO nova.wsgi [-] Started S3 Objectstore on 10.55.59.2:3333

2) Run the start command as nova [FAIL]

    nova@host:~$ nova-objectstore --uid $(getent passwd nova | cut -f3 -d:) --gid $(getent passwd nova | cut -f4 -d:) \
                               --pidfile /var/run/nova/nova-objectstore.pid --flagfile=/etc/nova/nova.conf --nodaemon \
                               --logfile=/var/log/nova/nova-objectstore.log
    Traceback (most recent call last):
      File "/usr/bin/nova-objectstore", line 51, in <module>
        logging.setup()
    [...]
    IOError: [Errno 13] Permission denied: '/var/log/nova/nova-objectstore.log'

3) Run the start command as nova (after chowning the log file) [FAIL]

    nova@host:~$ nova-objectstore --uid $(getent passwd nova | cut -f3 -d:) --gid $(getent passwd nova | cut -f4 -d:) \
                               --pidfile /var/run/nova/nova-objectstore.pid --flagfile=/etc/nova/nova.conf --nodaemon \
                               --logfile=/var/log/nova/nova-objectstore.log
    2011-08-04 16:20:37,766 INFO nova.wsgi [-] Started S3 Objectstore on 10.55.59.2:3333

4) Run the suggested start command [PASS]

    nova@host:~$ nova-objectstore --flagfile=/etc/nova/nova.conf
    2011-08-04 16:22:04,582 INFO nova.wsgi [-] Started S3 Objectstore on 10.55.58.254:6666
    2011-08-04 16:22:04,582 INFO eventlet.wsgi.server [-] (22755) wsgi starting up on http://10.55.58.254:6666/

Revision history for this message
Thierry Carrez (ttx) wrote :

So this is an artifact/duplicate of bug 820968 -- should be fixed when that other one is.

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.