db_sync doesn't work with sql_mode = 'TRADITIONAL'

Bug #1603121 reported by Alexandru
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Incomplete
Undecided
Alexandru Bogdan Pica

Bug Description

Hi

The keystone-manage db_sync command fails with the following error :

2016-07-14 16:13:17.670 19170 ERROR keystone DBError: (_mysql_exceptions.ProgrammingError) (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'"keystone"\' at line 1') [SQL: 'SHOW FULL TABLES FROM "keystone"']

OS: Debian 8.5
Keystone ver : 2:9.0.0-2~bpo8+1
Mysql: Server version: 5.5.44-MariaDB-log MariaDB Server

The problem seems to be related with :
cfg.StrOpt('mysql_sql_mode',
               default='TRADITIONAL',

from /usr/lib/python2.7/dist-packages/oslo_db/options.py
It seems that on MariaDB if you set:
 set session sql_mode = 'TRADITIONAL';
the query :
show full tables from "keystone"
fails

I've solve the problem by adding ANSI to default sql mode:
cfg.StrOpt('mysql_sql_mode',
               default='TRADITIONAL,ANSI',

Revision history for this message
Lance Bragstad (lbragstad) wrote :

Hi Alexandru,

I'm unable able to recreate this using Ubuntu 15.10, keystone's master branch (64fbbeda58050c8248540c0f33a6753a43a42845) and mysql 5.6.25-0ubuntu0.15.04.1. I was able to migrate successfully using mysql_sql_mode=TRADITIONAL.

Revision history for this message
Lance Bragstad (lbragstad) wrote :

I also checked out stable/mitaka to try and recreate this (keystone - 9.1.1.dev3) and was able successfully sync my keystone database with mysql_sql_mode=TRADITIONAL.

I wonder if this is only an issue with older versions of sql?

Changed in keystone:
status: New → Incomplete
Revision history for this message
Alexandru (aldavx) wrote :

Hi Lance

As I said in the description, the behaviour can be reproduced with MariaDB server (not with the mysql-server)

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 43
Server version: 10.0.25-MariaDB-0+deb8u1 (Debian)

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> set session sql_mode = 'TRADITIONAL';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> SHOW FULL TABLES FROM "keystone";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"keystone"' at line 1
MariaDB [(none)]>

Revision history for this message
Alexandru (aldavx) wrote :

I found my self a way out of this. It turns out that there is a mysql_sql_mode param in the keystone.conf.

Changed in keystone:
status: Incomplete → Invalid
Alexandru (aldavx)
Changed in keystone:
status: Invalid → Incomplete
Revision history for this message
Alexandru (aldavx) wrote :

setting mysql_sql_mode in kesytone.conf doesn't seems to have any effect

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Identity (keystone) because there has been no activity for 60 days.]

Changed in keystone:
status: Incomplete → Expired
Changed in keystone:
status: Expired → Fix Committed
status: Fix Committed → Confirmed
Changed in keystone:
status: Confirmed → Fix Committed
assignee: nobody → Alexandru Bogdan Pica (dtk.me)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 6.0.0.0b3

This issue was fixed in the openstack/kolla-ansible 6.0.0.0b3 development milestone.

Revision history for this message
Colleen Murphy (krinkle) wrote :

Alexandru, you marked this as "Fix Committed" for keystone, can you point to which commit fixed the issue?

Changed in keystone:
status: Fix Committed → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.