0

I am trying to install Openstack(Victoria) on my ubuntu 20.04 and getting below error.

  File "/usr/local/bin/cinder-manage", line 6, in <module>
    from cinder.cmd.manage import main
  File "/opt/stack/cinder/cinder/cmd/manage.py", line 75, in <module>
    from cinder.db import migration as db_migration
  File "/opt/stack/cinder/cinder/db/migration.py", line 26, in <module>
    from cinder.db.sqlalchemy import api as db_api
  File "/opt/stack/cinder/cinder/db/sqlalchemy/api.py", line 45, in <module>
    from sqlalchemy.orm import joinedload, joinedload_all, undefer_group, load_only
ImportError: cannot import name 'joinedload_all' from 'sqlalchemy.orm' (/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/__init__.py)
'```

I have tried installing using ```pip install sqlalchemy.orm ```
Sunil Sharma
  • 43
  • 2
  • 5

2 Answers2

0

joinedload_all was removed in 1.4 release notes

You can try capping the version to less than 1.4 like this:

pip install 'sqlalchemy<1.4'

I'm not sure if openstack uses a virtualenv but you probably will want to install its dependencies in something like.

Ian Wilson
  • 6,223
  • 1
  • 16
  • 24
  • tried this but didn't worked for me, still getting same error. – Sunil Sharma Sep 12 '21 at 02:39
  • Can you try `grep '__version__' /usr/local/lib/python3.8/dist-packages/sqlalchemy/__init__.py` to see if that version is `<1.4` ? I have `__version__ = "1.3.24"` and can do `from sqlalchemy.orm import joinedload_all`. – Ian Wilson Sep 12 '21 at 04:02
  • tried its showing ```Successfully installed sqlalchemy-1.3.24 WARNING: You are using pip version 20.2.4; however, version 21.2.4 is available. You should consider upgrading via the '/usr/bin/python3.8 -m pip install --upgrade pip' command. stack@linux-VirtualBox:/home/linux$ grep '__version__' /usr/local/lib/python3.8/dist-packages/sqlalchemy/__init__.py __version__ = "1.4.23" ``` – Sunil Sharma Sep 12 '21 at 04:07
  • It sounds like that version of sqlalchemy must be downgraded somehow, I'm not sure how it was installed, OR you will have to upgrade cinder as it seems that bug was not fixed until Wallaby (18.0.0) -- https://bugs.launchpad.net/cinder/+bug/1832164 – Ian Wilson Sep 12 '21 at 04:16
  • Based on that output you could try `/usr/bin/python3.8 -m pip install 'sqlalchemy<1.4'`. – Ian Wilson Sep 12 '21 at 04:17
  • Tried but bad luck – Sunil Sharma Sep 12 '21 at 04:31
0

You should always be installing requirements with constraints applied for the version you are deploying.

pip install -c https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/victoria sqlalchemy

This will ensure that you are installing the recommended version for the OpenStack release you are using.

You could also try to just re-install all the requirements for cinder with the correct versions.

cd /opt/stack/cinder pip install -c https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/victoria /opt/stack/cinder/requirements.txt

eandersson
  • 25,781
  • 8
  • 89
  • 110