Failed to connect to glance.

asked 2019-10-27 21:45:28 -0600

mjstudio gravatar image

updated 2019-10-28 02:19:06 -0600

Hi, I'm try to setup glance in my openstack controller node. I have two nodes: controller (192.168.253.10, hostname=controller) and computer (192.168.253.15, hostname=computer). I add the following to glance_api.conf:

[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = GLANCE_PASS


[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

And the following is added to glance-registry.conf

[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = GLANCE_PASS

[paste_deploy]
flavor = keystone

Then I set the following evn:

export OS_USERNAME=admin
export OS_PASSWORD='mypasswd'
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_DOMAIN_NAME=default
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2

The glance service is restarted:

/root>service glance-api status     
● glance-api.service - OpenStack Glance Service API
   Loaded: loaded (/lib/systemd/system/glance-api.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-10-27 22:40:17 EDT; 2min 14s ago
 Main PID: 3241 (uwsgi_python37)
    Tasks: 5 (limit: 4673)
   Memory: 315.8M
   CGroup: /system.slice/glance-api.service
           ├─3241 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
           ├─3245 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
           ├─3246 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
           ├─3247 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini
           └─3248 /usr/bin/uwsgi_python37 --http-socket [::]:9292 --ini /etc/glance/glance-api-uwsgi.ini

Oct 27 22:40:17 controller systemd[1]: Started OpenStack Glance Service API.
Oct 27 22:40:17 controller glance-api[3241]: [uwsgi] implicit plugin requested python37
Oct 27 22:40:17 controller glance-api[3241]: [uWSGI] getting INI configuration from /etc/glance/glance-api-uwsgi.ini

/root>ss -ntlp | grep 9292
LISTEN    0         100                       *:9292                   *:*       users:(("uwsgi_python37",pid=3248,fd=3),("uwsgi_python37",pid=3247,fd=3),("uwsgi_python37",pid=3246,fd=3),("uwsgi_python37",pid=3245,fd=3),("uwsgi_python37",pid=3241,fd=3))

However, when I run openstack image list, I got an error:

/root>openstack image list
Unable to establish connection to http://controller:9292/v2/images: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Coul dyou let me know how to fix the error?


How can I "not to run Glance behind WGSI"?

I re-paste the code below:

/root>openstack --debug image list
START with options: ['--debug', 'image', 'list']
options: Namespace(access_key='', access_secret='***', access_token='***', access_token_endpoint='', access_token_type='', application_credential_id='', application_credential_name='', application_credential_secret='***', auth_type='', auth_url='http://controller:35357/v3', cacert=None, cert='', client_id='', client_secret='***', cloud='', code='', consumer_key='', consumer_secret='***', debug=True, default_domain='default', default_domain_id='', default_domain_name='', deferred_help=False, discovery_endpoint='', domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, interface='', key='', log_file=None, openid_scope='', os_beta_command=False, os_compute_api_version='', os_identity_api_version='3', os_image_api_version='2', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_project_id=None, os_project_name=None, os_volume_api_version='', passcode='', password='***', profile='', project_domain_id='', project_domain_name='default', project_id='', project_name='admin', protocol='', redirect_uri='', region_name='', remote_project_domain_id='', remote_project_domain_name='', remote_project_id='', remote_project_name='', service_provider='', service_provider_endpoint='', service_provider_entity_id='', system_scope='', timing ...
(more)
edit retag flag offensive close merge delete

Comments

Please check the Glance API log and the web server logs for more information. Perhaps your WGSI setup causes the problem.

Generally, it is recommended not to run Glance behind WGSI since not all features are supported.

Bernd Bausch gravatar imageBernd Bausch ( 2019-10-28 00:06:34 -0600 )edit

And please try to format the code you post here so that it becomes readable. The button labeled "101010" does the trick.

Bernd Bausch gravatar imageBernd Bausch ( 2019-10-28 00:07:31 -0600 )edit

The Glance API log shows that Glance can't access Keystone's admin endpoint. Is auth_url = http://controller:35357 correct?

Bernd Bausch gravatar imageBernd Bausch ( 2019-10-28 10:03:27 -0600 )edit

/root>hostname controller

/root>ss -ntlp | grep 35357
LISTEN    0         128                       *:35357                  *:*       users:(("apache2",pid=1026,fd=8),("apache2",pid=1025,fd=8),("apache2",pid=1012,fd=8))
mjstudio gravatar imagemjstudio ( 2019-10-28 20:23:36 -0600 )edit

The exception EndpointNotFound is raised by the Keystone authentication module when the endpoint is not in the service catalog. openstack catalog list or endpoint list should confirm this.

Bernd Bausch gravatar imageBernd Bausch ( 2019-10-29 03:10:30 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2019-10-28 05:36:06 -0600

mjstudio gravatar image

updated 2019-10-28 20:22:07 -0600

This is the glance-api.log

2019-10-28 06:34:48.696 25559 CRITICAL glance [-] Unhandled error: keystoneauth1.exceptions.catalog.EndpointNotFound: admin endpoint for identity service in regionOne region not found
2019-10-28 06:34:48.696 25559 ERROR glance Traceback (most recent call last):
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/dec.py", line 129, in __call__
2019-10-28 06:34:48.696 25559 ERROR glance     resp = self.call_func(req, *args, **kw)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/dec.py", line 193, in call_func
2019-10-28 06:34:48.696 25559 ERROR glance     return self.func(req, *args, **kwargs)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/oslo_middleware/base.py", line 131, in __call__
2019-10-28 06:34:48.696 25559 ERROR glance     response = req.get_response(self.application)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/request.py", line 1314, in send
2019-10-28 06:34:48.696 25559 ERROR glance     application, catch_exc_info=False)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/request.py", line 1278, in call_application
2019-10-28 06:34:48.696 25559 ERROR glance     app_iter = application(self.environ, start_response)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/dec.py", line 129, in __call__
2019-10-28 06:34:48.696 25559 ERROR glance     resp = self.call_func(req, *args, **kw)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/dec.py", line 193, in call_func
2019-10-28 06:34:48.696 25559 ERROR glance     return self.func(req, *args, **kwargs)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/oslo_middleware/base.py", line 131, in __call__
2019-10-28 06:34:48.696 25559 ERROR glance     response = req.get_response(self.application)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/request.py", line 1314, in send
2019-10-28 06:34:48.696 25559 ERROR glance     application, catch_exc_info=False)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/request.py", line 1278, in call_application
2019-10-28 06:34:48.696 25559 ERROR glance     app_iter = application(self.environ, start_response)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/dec.py", line 129, in __call__
2019-10-28 06:34:48.696 25559 ERROR glance     resp = self.call_func(req, *args, **kw)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/dec.py", line 193, in call_func
2019-10-28 06:34:48.696 25559 ERROR glance     return self.func(req, *args, **kwargs)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/oslo_middleware/base.py", line 131, in __call__
2019-10-28 06:34:48.696 25559 ERROR glance     response = req.get_response(self.application)
2019-10-28 06:34:48.696 25559 ERROR glance   File "/usr/lib/python3/dist-packages/webob/request.py", line 1314, in send
2019-10-28 06:34:48.696 25559 ERROR ...
(more)
edit flag offensive delete link more

Comments

Can you set OS_REGION_NAME by adding the variable export $OS_REGION_NAME=regionOne Also can you double check on installation procedure, what was the region name set during installation. Upper/lower case mismatch can case issues

Mohit gravatar imageMohit ( 2019-10-29 00:49:24 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-10-27 21:45:28 -0600

Seen: 231 times

Last updated: Oct 28 '19