Bug 1129701

Summary: Glance image-list failed with -> shell-init: error retrieving current directory
Product: Red Hat OpenStack Reporter: Tzach Shefi <tshefi>
Component: openstack-glanceAssignee: Flavio Percoco <fpercoco>
Status: CLOSED NOTABUG QA Contact: nlevinki <nlevinki>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 5.0 (RHEL 6)CC: eglynn, fpercoco, scohen, yeylon
Target Milestone: ---   
Target Release: 5.0 (RHEL 7)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-21 09:16:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Glance api.log none

Description Tzach Shefi 2014-08-13 13:39:29 UTC
Created attachment 926443 [details]
Glance api.log

Description of problem: During recreation of another bug on my setup AIO Neutron network, during instance snapshot process before snapshot completed uploading I did #glance image-list 

root@orange-vdse tmptriyEJ(keystone_admin)]# glance image-list
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/glance", line 6, in <module>
    from glanceclient.shell import main
  File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 30, in <module>
    from keystoneclient.v2_0 import client as ksclient
  File "/usr/lib/python2.7/site-packages/keystoneclient/v2_0/__init__.py", line 2, in <module>
    from keystoneclient.v2_0.client import Client
  File "/usr/lib/python2.7/site-packages/keystoneclient/v2_0/client.py", line 20, in <module>
    from keystoneclient import httpclient
  File "/usr/lib/python2.7/site-packages/keystoneclient/httpclient.py", line 27, in <module>
    import keyring
  File "/usr/lib/python2.7/site-packages/keyring/__init__.py", line 12, in <module>
    from .core import (set_keyring, get_keyring, set_password, get_password,
  File "/usr/lib/python2.7/site-packages/keyring/core.py", line 180, in <module>
    init_backend()
  File "/usr/lib/python2.7/site-packages/keyring/core.py", line 59, in init_backend
    set_keyring(load_config() or _get_best_keyring())
  File "/usr/lib/python2.7/site-packages/keyring/core.py", line 105, in load_config
    local_path = os.path.join(os.getcwd(), filename)
OSError: [Errno 2] No such file or directory

Version-Release number of selected component (if applicable):
RHEL7
python-glanceclient-0.13.1-1.el7ost.noarch
openstack-glance-2014.1.1-1.el7ost.noarch
python-glance-2014.1.1-1.el7ost.noarch
openstack-nova-compute-2014.1.1-4.el7ost.noarch


How reproducible:
Not sure first time, looks like a fluke one off problem to me.

Steps to Reproduce:
1. Booted an instance 
2. Created a snapshot of that running instance
3. Before snapshot upload completed, ran glance image-list.

Actual results:
Glance image-list failed with above trace

Expected results:
Glance image-list should worked without errors.

Comment 1 Tzach Shefi 2014-08-13 13:40:33 UTC
BTW forgot to mention running glance image-list a moment later worked fine.

Comment 2 Tzach Shefi 2014-08-13 13:47:38 UTC
BTW2, just noticed something odd my pwd at the time of the command was
/var/lib/nova/instances/snapshots/tm..  temp folder of snapshot

I think the problem is related or was caused by sending the command from this temp folder as it failed again but once I moved up one folder back I didn't get this trace error again.

Comment 3 Flavio Percoco 2014-08-21 09:16:52 UTC
The bug was definitely related to that. There's no much we can do here other than providing a better error. However, this is not a common case and the error is raised by keystoneclient.