Ask Your Question
1

glance-manage db_sync running problem

asked 2013-02-27 16:26:31 -0500

mehdi-alisoltani gravatar image

Hi all Dears i am installing openstack following the instruction which prepared by http://Openstack.org on the controller node I installed glance and config the /etc/glance/glance-api.conf and /etc/glance/glance-registry.conf files and modified them. but when i wanted to run glance-manage db_sync it showed me Traceback (most recent call last): File "/usr/bin/glance-manage", line 126, in main() File "/usr/bin/glance-manage", line 114, in main config.setup_logging() File "/usr/lib/python2.7/dist-packages/glance/common/config.py", line 118, in setup_logging handler = logging.handlers.WatchedFileHandler(logfile) File "/usr/lib/python2.7/logging/handlers.py", line 386, in __init__ logging.FileHandler.__init__(self, filename, mode, encoding, delay) File "/usr/lib/python2.7/logging/__init__.py", line 897, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib/python2.7/logging/__init__.py", line 916, in _open stream = open(self.baseFilename, self.mode) IOError: [Errno 13] Permission denied: '/var/log/glance/registry.log'

when i run glance-manage db_sync by sudo there is no error message but when i checked mysql database glance that was empty, it means no table has been created .

i should mention i change the owner of registry.log to glance by the command chown, , but still i get this error

please somebody help me.

edit retag flag offensive close merge delete

7 answers

Sort by ยป oldest newest most voted
1

answered 2013-02-28 04:21:21 -0500

mehdi-alisoltani gravatar image

updated 2014-08-21 11:02:48 -0500

mpetason gravatar image

sudo glance-manage db_sync worked and gives no error , but it does not create tables in the glance database. my this is my glance-registry.conf

[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = True

# Show debugging output in logs (sets DEBUG log level output)
debug = true

# Address to bind the registry server
bind_host = 0.0.0.0

# Port the bind the registry server to
bind_port = 9191

# Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = /var/log/glance/registry.log

# Backlog requests when creating socket
backlog = 4096

# TCP_KEEPIDLE value in seconds when creating socket.
# Not supported on OS X.
#tcp_keepidle = 600

# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
#sql_connection = sqlite:////var/lib/glance/glance.sqlite
sql_connection = mysql://glance:mehdi@localhost/glance

# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
#
# MySQL uses a default `wait_timeout` of 8 hours, after which it will drop
# idle connections. This can result in 'MySQL Gone Away' exceptions. If you
# notice this, you can lower this value to ensure that SQLAlchemy reconnects
# before MySQL can drop the connection.
sql_idle_timeout = 3600

# Limit the api to return `param_limit_max` items in a call to a container. If
# a larger `limit` query param is provided, it will be reduced to this value.
api_limit_max = 1000

# If a `limit` query param is not provided in an api request, it will
# default to `limit_param_default`
limit_param_default = 25

# Role used to identify an authenticated user as administrator
#admin_role = admin

# ================= Syslog Options ============================

# Send logs to syslog (/dev/log) instead of to file specified
# by `log_file`
use_syslog = False

# Facility to use. If unset defaults to LOG_USER.
#syslog_log_facility = LOG_LOCAL1

# ================= SSL Options ===============================

# Certificate file to use when starting registry server securely
#cert_file = /path/to/certfile

# Private key file to use when starting registry server securely
#key_file = /path/to/keyfile

# CA certificate file to use to verify connecting clients
#ca_file = /path/to/cafile

[keystone_authtoken]
auth_host = localhost
auth_port = 35357
auth_protocol = http
admin_tenant_name =mehdi
admin_user = glance
admin_password =mehdi

[paste_deploy]
# Name of the paste configuration file that defines the available pipelines
#config_file = glance-registry-paste.ini

# Partial name of a pipeline in your paste configuration file with the
# service name removed. For example, if your paste section name is
# [pipeline:glance-registry-keystone], you would configure the flavor below
# as 'keystone'.
flavor = keystone

###################################################################
###################################################################
###################################################################
###################################################################


And this is glance-api.conf
[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = True

# Show debugging output in logs (sets DEBUG log level output)
debug = True

# Which backend scheme should Glance use by default is not specified
# in a request to add a new image to Glance? Known schemes are determined
# by the known_stores option below.
# Default: 'file'
default_store = file

# List of which store classes and store class locations are
# currently known to glance at startup.
#known_stores = glance.store.filesystem.Store,
#               glance.store.http.Store,
#               glance.store ...
(more)
edit flag offensive delete link more
1

answered 2013-02-27 16:32:19 -0500

jaypipes gravatar image

sudo glance-manage db_sync

edit flag offensive delete link more
1

answered 2013-03-01 02:18:15 -0500

s-rain gravatar image

Can you check the permissions on "/var/log/glance/", and make sure it exists?

edit flag offensive delete link more
1

answered 2013-02-27 16:43:20 -0500

jaypipes gravatar image

What does your glance-registry.conf look like?

edit flag offensive delete link more
1

answered 2014-08-21 23:17:30 -0500

leethaoqn gravatar image

updated 2014-08-21 23:18:05 -0500

On ice house, your sql connection must be :

connection = mysql://glance:mehdi@localhost/glance
edit flag offensive delete link more
1

answered 2013-02-28 04:17:41 -0500

mehdi-alisoltani gravatar image

updated 2014-08-21 11:02:09 -0500

mpetason gravatar image

sudo glance-manage db_sync worked and gives no error , but it does not create tables in the glance database. my this is my glance-registry.conf

[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = True

# Show debugging output in logs (sets DEBUG log level output)
debug = true

# Address to bind the registry server
bind_host = 0.0.0.0

# Port the bind the registry server to
bind_port = 9191

# Log to this file. Make sure you do not set the same log
# file for both the API and registry servers!
log_file = /var/log/glance/registry.log

# Backlog requests when creating socket
backlog = 4096

# TCP_KEEPIDLE value in seconds when creating socket.
# Not supported on OS X.
#tcp_keepidle = 600

# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
#sql_connection = sqlite:////var/lib/glance/glance.sqlite
sql_connection = mysql://glance:mehdi@localhost/glance

# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
#
# MySQL uses a default `wait_timeout` of 8 hours, after which it will drop
# idle connections. This can result in 'MySQL Gone Away' exceptions. If you
# notice this, you can lower this value to ensure that SQLAlchemy reconnects
# before MySQL can drop the connection.
sql_idle_timeout = 3600

# Limit the api to return `param_limit_max` items in a call to a container. If
# a larger `limit` query param is provided, it will be reduced to this value.
api_limit_max = 1000

# If a `limit` query param is not provided in an api request, it will
# default to `limit_param_default`
limit_param_default = 25

# Role used to identify an authenticated user as administrator
#admin_role = admin

# ================= Syslog Options ============================

# Send logs to syslog (/dev/log) instead of to file specified
# by `log_file`
use_syslog = False

# Facility to use. If unset defaults to LOG_USER.
#syslog_log_facility = LOG_LOCAL1

# ================= SSL Options ===============================

# Certificate file to use when starting registry server securely
#cert_file = /path/to/certfile

# Private key file to use when starting registry server securely
#key_file = /path/to/keyfile

# CA certificate file to use to verify connecting clients
#ca_file = /path/to/cafile

[keystone_authtoken]
auth_host = localhost
auth_port = 35357
auth_protocol = http
admin_tenant_name =mehdi
admin_user = glance
admin_password =mehdi

[paste_deploy]
# Name of the paste configuration file that defines the available pipelines
#config_file = glance-registry-paste.ini

# Partial name of a pipeline in your paste configuration file with the
# service name removed. For example, if your paste section name is
# [pipeline:glance-registry-keystone], you would configure the flavor below
# as 'keystone'.
flavor = keystone




And this is glance-api.conf
[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = True

# Show debugging output in logs (sets DEBUG log level output)
debug = True

# Which backend scheme should Glance use by default is not specified
# in a request to add a new image to Glance? Known schemes are determined
# by the known_stores option below.
# Default: 'file'
default_store = file

# List of which store classes and store class locations are
# currently known to glance at startup.
#known_stores = glance.store.filesystem.Store,
#               glance.store.http.Store,
#               glance.store ...
(more)
edit flag offensive delete link more
0

answered 2014-07-16 01:23:49 -0500

In glance-registry.conf you have to replace

sql_connection = sqlite:////var/lib/glance/glance.sqlite

with

sql_connection = mysql://glance:yourpassword@127.0.0.1/glance

after that again run

sudo glance-manage db_sync

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-02-27 16:26:31 -0500

Seen: 1,743 times

Last updated: Aug 21 '14