XDG_SESSION_TYPE error on devstack installation

2.3k views Asked by At

can someone please help with the below issue?
Facing below issue while installing devstack on ubuntu 18.04.
python - 3.6.9
stack user with sudo access.
pip version - pip 20.2.4 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)

INFO keystone.cmd.bootstrap [None req-f46e9c41-1b14-4e5b-82b2-ada81e8b0dcd None None] Created region RegionOne
INFO keystone.cmd.bootstrap [None req-f46e9c41-1b14-4e5b-82b2-ada81e8b0dcd None None] Created public endpoint http://10.61.62.241/identity
INFO keystone.cmd.bootstrap [None req-f46e9c41-1b14-4e5b-82b2-ada81e8b0dcd None None] Created admin endpoint http://10.61.62.241/identity


+./stack.sh:main:1084                      create_keystone_accounts  
+lib/keystone:create_keystone_accounts:314  local admin_project  
++lib/keystone:create_keystone_accounts:315  oscwrap project show admin -f value -c id  
Traceback (most recent call last):  
  File "/usr/local/bin/openstack", line 5, in <module>  
    from openstackclient.shell import main  
  File "/usr/local/lib/python3.6/dist-packages/openstackclient/shell.py", line 24, in <module>  
    from osc_lib import shell  
  File "/usr/local/lib/python3.6/dist-packages/osc_lib/shell.py", line 24, in <module>  
    from cliff import app  
  File "/usr/local/lib/python3.6/dist-packages/cliff/app.py", line 24, in <module>  
    import cmd2  
  File "/usr/local/lib/python3.6/dist-packages/cmd2/__init__.py", line 30, in <module>  
    from .cmd2 import Cmd  
  File "/usr/local/lib/python3.6/dist-packages/cmd2/cmd2.py", line 48, in <module>  
    from .clipboard import can_clip, get_paste_buffer, write_to_paste_buffer  
  File "/usr/local/lib/python3.6/dist-packages/cmd2/clipboard.py", line 12, in <module>  
    _ = pyperclip.paste()  
  File "/usr/local/lib/python3.6/dist-packages/pyperclip/__init__.py", line 680, in lazy_load_stub_paste  
    copy, paste = determine_clipboard()  
  File "/usr/local/lib/python3.6/dist-packages/pyperclip/__init__.py", line 568, in determine_clipboard  
    os.environ["XDG_SESSION_TYPE"] == "wayland" and  
  File "/usr/lib/python3.6/os.py", line 669, in __getitem__  
    raise KeyError(key) from None  
KeyError: 'XDG_SESSION_TYPE'  

++functions-common:oscwrap:2346             return 1  
+lib/keystone:create_keystone_accounts:315  admin_project=  
+lib/keystone:create_keystone_accounts:1   exit_trap  
+./stack.sh:exit_trap:491                  local r=1  
++./stack.sh:exit_trap:492                  jobs -p  
+./stack.sh:exit_trap:492                  jobs=  
+./stack.sh:exit_trap:495                  [[ -n '' ]]  
+./stack.sh:exit_trap:501                  '[' -f /tmp/tmp.LRWsRkTTkV ']'  
+./stack.sh:exit_trap:502                  rm /tmp/tmp.LRWsRkTTkV  
+./stack.sh:exit_trap:506                  kill_spinner  
+./stack.sh:kill_spinner:401               '[' '!' -z '' ']'  
+./stack.sh:exit_trap:508                  [[ 1 -ne 0 ]]  
+./stack.sh:exit_trap:509                  echo 'Error on exit'  
Error on exit  
+./stack.sh:exit_trap:511                  type -p generate-subunit 
+./stack.sh:exit_trap:512                  generate-subunit 1606228299 592 fail  
+./stack.sh:exit_trap:514                  [[ -z /opt/stack/logs ]]  
+./stack.sh:exit_trap:517                  /usr/bin/python3.6 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs  
+./stack.sh:exit_trap:526                  exit 1  
2

There are 2 answers

1
faisal rafi On

Installation was working before with ubuntu18.4, but something seems broken, not sure if this is happening due to python or Ubuntu dist version (or something else). Till there is proper solution available for this, as a workaround you can export XDG_SESSION_TYPE=wayland and then run ./stack.sh, I have installed devstack in this way and dashboard, VM/network creation etc are working fine.

0
Andres spectre On

I have the same issue and searching around i found the solution for this problem in this video https://www.youtube.com/watch?v=SYd34yuyLYk&feature=youtu.be and the solution is this line export XDG_SESSION_TYPE=wayland hope this help.