[Python] cinder-manage db sync failes with column does not exist error

Discussão em 'Python' iniciado por Stack, Fevereiro 3, 2025.

  1. Stack

    Stack Membro Participativo

    I'm in the process of exploring openstack on debian bookworm and setup keystone, glance and horizon so far. But now i got stuck with the setup of the openstack cinder service. Everytime i try to install the db schema with cinder-manage db sync (v25.0.0), i get an DBAPIError. It seems like several upgrades are executing fine at first. This tells me that i configured the db credentials correctly. This seems like there is something wrong with the migration that the tool tries to run, though the sql shown looks ok to me, unlike the error as it calls out the value of the update as the column. Before im bothering the devs with an issue, maybe someone can point out an error on my part.

    sudo su -s /bin/sh -c "cinder-manage --debug db sync" cinder
    2025-02-03 20:34:12.730 3123036 INFO cinder.db.migration [-] Applying migration(s)
    2025-02-03 20:34:12.734 3123036 INFO alembic.runtime.migration [-] Context impl PostgresqlImpl.
    2025-02-03 20:34:12.734 3123036 INFO alembic.runtime.migration [-] Will assume transactional DDL.
    2025-02-03 20:34:12.764 3123036 INFO alembic.runtime.migration [-] Running upgrade -> 921e1a36b076, Initial migration.
    2025-02-03 20:34:13.207 3123036 DEBUG alembic.runtime.migration [-] new branch insert 921e1a36b076 update_to_step /usr/lib/python3/dist-packages/alembic/runtime/migration.py:818
    2025-02-03 20:34:13.210 3123036 INFO alembic.runtime.migration [-] Running upgrade 921e1a36b076 -> c92a3e68beed, Make shared_targets nullable
    2025-02-03 20:34:13.355 3123036 DEBUG alembic.runtime.migration [-] update 921e1a36b076 to c92a3e68beed update_to_step /usr/lib/python3/dist-packages/alembic/runtime/migration.py:853
    2025-02-03 20:34:13.358 3123036 INFO alembic.runtime.migration [-] Running upgrade c92a3e68beed -> daa98075b90d, Add resource indexes
    2025-02-03 20:34:13.378 3123036 DEBUG alembic.runtime.migration [-] update c92a3e68beed to daa98075b90d update_to_step /usr/lib/python3/dist-packages/alembic/runtime/migration.py:853
    2025-02-03 20:34:13.380 3123036 INFO alembic.runtime.migration [-] Running upgrade daa98075b90d -> 89aa6f9639f9, Drop legacy migrate_version table
    2025-02-03 20:34:13.384 3123036 DEBUG alembic.runtime.migration [-] update daa98075b90d to 89aa6f9639f9 update_to_step /usr/lib/python3/dist-packages/alembic/runtime/migration.py:853
    2025-02-03 20:34:13.385 3123036 INFO alembic.runtime.migration [-] Running upgrade 89aa6f9639f9 -> b8660621f1b9, Update reservations resource
    2025-02-03 20:34:13.479 3123036 DEBUG alembic.runtime.migration [-] update 89aa6f9639f9 to b8660621f1b9 update_to_step /usr/lib/python3/dist-packages/alembic/runtime/migration.py:853
    2025-02-03 20:34:13.480 3123036 INFO alembic.runtime.migration [-] Running upgrade b8660621f1b9 -> 9ab1b092a404, Make use_quota non nullable
    2025-02-03 20:34:13.489 3123036 WARNING oslo_db.sqlalchemy.exc_filters [-] DBAPIError exception wrapped.: psycopg2.errors.UndefinedColumn: column "1" does not exist
    LINE 1: UPDATE volumes SET use_quota="1" WHERE use_quota IS NULL


    Here is my process for installing and configuring cinder:

    sudo su - postgres
    psql
    CREATE DATABASE cinder;
    CREATE USER cinder WITH ENCRYPTED PASSWORD 'cinder';
    GRANT ALL PRIVILEGES ON DATABASE cinder TO cinder;
    \c cinder postgres
    # You are now connected to database "cinder" as user "postgres".
    GRANT ALL PRIVILEGES ON SCHEMA public TO cinder;


    openstack user create --domain default --password-prompt cinder
    openstack role add --project service --user cinder admin
    openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
    openstack endpoint create --region eu-west-1 volumev3 public http://192.168.2.136:8776/v3/%\(project_id\)s
    openstack endpoint create --region eu-west-1 volumev3 internal http://192.168.2.136:8776/v3/%\(project_id\)s
    openstack endpoint create --region eu-west-1 volumev3 admin http://192.168.2.136:8776/v3/%\(project_id\)s
    sudo apt install cinder-api cinder-scheduler cinder-volume cinder-backup
    Set up a database for this package? [yes/no] no
    Configure RabbitMQ access with debconf? [yes/no] yes
    IP address of your RabbitMQ host: 192.168.2.136
    Username for connection to the RabbitMQ server: openstack
    Password for connection to the RabbitMQ server: openstack
    Manage keystone_authtoken with debconf? [yes/no] no
    Value for glance_api_servers: http://192.168.2.136:9292
    Cinder volume group: cinder-volumes
    Value for my_ip: 192.168.2.136
    Register this service in the Keystone endpoint catalog? [yes/no] no


    /etc/cinder/cinder.conf:

    [database]
    connection = postgresql+psycopg2://cinder:cinder@192.168.2.136/cinder

    [default]
    my_ip = 192.168.2.136
    enabled_backends = lvm
    transport_url = transport_url = rabbit://openstack:eek:penstack@192.168.2.136

    [keystone_authtoken]
    www_authenticate_uri = http://192.168.2.136:5000
    auth_url = http://192.168.2.136:5000
    memcached_servers = 192.168.2.136:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    user_domain_name = default
    project_name = service
    username = cinder
    password = cinder

    Continue reading...

Compartilhe esta Página