utc_timestamp() does not exist when db os postgre.

Bug #1700873 reported by Miles Fu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DragonFlow
Fix Released
Medium
Omer Anson

Bug Description

SQLAlchemy-1.1.10

/devstack/local.conf:
disable_service mysql
enable_service postgresql

stack.log:
2017-06-28 02:49:47.166 | +++functions-common:oscwrap:2532 command openstack --os-cloud devstack-admin --os-region RegionOne network create --project 3dd08100e5ad4cac99ae52dbaa04a4f0 private
2017-06-28 02:49:47.170 | +++functions-common:oscwrap:2532 openstack --os-cloud devstack-admin --os-region RegionOne network create --project 3dd08100e5ad4cac99ae52dbaa04a4f0 private
2017-06-28 02:49:49.680 | WARNING: openstackclient.common.utils is deprecated and will be removed after Jun 2017. Please use osc_lib.utils. This warning is caused by an out-of-date import in /usr/lib/python2.7/site-packages/cueclient/osc/plugin.py
2017-06-28 02:49:51.432 | Error while executing command: Internal Server Error (HTTP 500) (Request-ID: req-5803adb1-ec55-4d39-a7b6-27549d624417)
2017-06-28 02:49:51.494 | ++functions-common:oscwrap:2532 out=
2017-06-28 02:49:51.498 | ++functions-common:oscwrap:2533 rc=1
2017-06-28 02:49:51.503 | +++functions-common:oscwrap:2534 date +%s%3N
2017-06-28 02:49:51.509 | ++functions-common:oscwrap:2534 end=1498618191504
2017-06-28 02:49:51.513 | ++functions-common:oscwrap:2535 echo 4347
2017-06-28 02:49:51.518 | ++functions-common:oscwrap:2537 echo ''
2017-06-28 02:49:51.522 | ++functions-common:oscwrap:2538 return 1
2017-06-28 02:49:51.527 | +lib/neutron_plugins/services/l3:create_neutron_initial_network:210 NET_ID=
2017-06-28 02:49:51.532 | +lib/neutron_plugins/services/l3:create_neutron_initial_network:211 die_if_not_set 211 NET_ID 'Failure creating NET_ID for private 3dd08100e5ad4cac99ae52dbaa04a4f0'
2017-06-28 02:49:51.536 | +functions-common:die_if_not_set:204 local exitcode=0
2017-06-28 02:49:51.556 | [Call Trace]
2017-06-28 02:49:51.556 | ./stack.sh:1351:create_neutron_initial_network
2017-06-28 02:49:51.556 | /home/stack/devstack/lib/neutron_plugins/services/l3:211:die_if_not_set
2017-06-28 02:49:51.556 | /home/stack/devstack/functions-common:211:die
2017-06-28 02:49:51.558 | [ERROR] /home/stack/devstack/functions-common:211 Failure creating NET_ID for private 3dd08100e5ad4cac99ae52dbaa04a4f0
2017-06-28 02:49:52.561 | exit_trap: cleaning up child processes
2017-06-28 02:49:52.561 | ./stack.sh: line 524: kill: (34134) - No such process

neutron-server log:
 ^[[00;33mfrom (pid=31531) _acquire_lock /opt/stack/dragonflow/dragonflow/db/neutron/lockedobjects_db.py:145^[[00m
2017-06-28 10:49:50.531 ^[[01;31mERROR oslo_db.sqlalchemy.exc_filters [^[[01;36mreq-5803adb1-ec55-4d39-a7b6-27549d624417 ^[[00;36madmin admin^[[01;31m] ^[[01;35m^[[01;31mDBAPIError exception wrapped from (psycopg2.ProgrammingError) function utc_timestamp() does not exist
LINE 1: ... SET lock=true, session_id=7509488878, created_at=utc_timest...
                                                             ^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
 [SQL: 'UPDATE dflockedobjects SET lock=%(lock)s, session_id=%(session_id)s, created_at=utc_timestamp() WHERE dflockedobjects.lock = false AND dflockedobjects.object_uuid = %(object_uuid_1)s'] [parameters: {'object_uuid_1': '377f09c6-ade8-4b87-b629-58801009082b', 'lock': True, 'session_id': 7509488878}]^[[00m: ProgrammingError: function utc_timestamp() does not exist
LINE 1: ... SET lock=true, session_id=7509488878, created_at=utc_timest...
                                                             ^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00mTraceback (most recent call last):
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00m File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00m context)
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00m File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00m cursor.execute(statement, parameters)
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00mProgrammingError: function utc_timestamp() does not exist
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00mLINE 1: ... SET lock=true, session_id=7509488878, created_at=utc_timest...
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00m ^
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00mHINT: No function matches the given name and argument types. You might need to add explicit type casts.
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00m
^[[01;31m2017-06-28 10:49:50.531 TRACE oslo_db.sqlalchemy.exc_filters ^[[01;35m^[[00m
2017-06-28 10:49:50.533 ^[[01;31mERROR neutron_lib.callbacks.manager [^[[01;36mreq-5803adb1-ec55-4d39-a7b6-27549d624417 ^[[00;36madmin admin^[[01;31m] ^[[01;35m^[[01;31mError during notification for dragonflow.neutron.ml2.mech_driver.DFMechDriver.update_security_group-634 security_group, after_create^[[00m: DBError: (psycopg2.ProgrammingError) function utc_timestamp() does not exist
LINE 1: ... SET lock=true, session_id=7509488878, created_at=utc_timest...
                                                             ^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
 [SQL: 'UPDATE dflockedobjects SET lock=%(lock)s, session_id=%(session_id)s, created_at=utc_timestamp() WHERE dflockedobjects.lock = false AND dflockedobjects.object_uuid = %(object_uuid_1)s'] [parameters: {'object_uuid_1': '377f09c6-ade8-4b87-b629-58801009082b', 'lock': True, 'session_id': 7509488878}]

if using mysql,don't have this bug.

Miles Fu (fumeng2005)
summary: - sqlalchemy can't create type utc_timestamp when db is postgre
+ utc_timestamp() does not exist
description: updated
summary: - utc_timestamp() does not exist
+ utc_timestamp() does not exist when db os posrgre.
summary: - utc_timestamp() does not exist when db os posrgre.
+ utc_timestamp() does not exist when db os postgre.
Miles Fu (fumeng2005)
Changed in dragonflow:
status: New → Invalid
status: Invalid → New
description: updated
Revision history for this message
Omer Anson (omer-anson) wrote :

Currently put in medium. If this is blocking you, please feel free to promote to High.

Changed in dragonflow:
assignee: nobody → Omer Anson (omer-anson)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to dragonflow (master)

Fix proposed to branch: master
Review: https://review.openstack.org/487833

Changed in dragonflow:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to dragonflow (master)

Reviewed: https://review.openstack.org/487833
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=66604e749349e37eb1e59168d00f52ed7da23029
Submitter: Jenkins
Branch: master

commit 66604e749349e37eb1e59168d00f52ed7da23029
Author: Omer Anson <email address hidden>
Date: Thu Jul 27 12:45:03 2017 +0300

    Implement utc_timeout for PGSQL and MSSQL

    UTC_TIMESTAMP is a MySQL specific function. Use SQLAlchemy to implement it
    also in MSSQL and PGSQL.

    Change-Id: If8673b543da2a89a2bad87daff2429cb09c735aa
    Closes-Bug: #1700873

Changed in dragonflow:
status: In Progress → Fix Released
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.