Description of problem: When executing below statement, stmt = "insert into rhnservergroup (id, name, description, org_id) values (rhn_server_group_id_seq.nextval, '%s', '%s', 2)" % (name, description) we have ORA error saying that, cx_Oracle.DatabaseError: ORA-20297: Call get_log_id need to follow set_log_auth. ORA-06512: at "SPACEWALK.LOGGING", line 29 ORA-06512: at "SPACEWALK.RHNSERVERGROUP_LOG_TRIG", line 5 ORA-04088: error during execution of trigger 'SPACEWALK.RHNSERVERGROUP_LOG_TRIG' As workaround we had to disabled RHNSERVERGROUP_LOG_TRIG trigger and the statement will work without any errors. Version-Release number of selected component (if applicable): oracle-xe-11.2.0-1.0.x86_64 spacewalk-oracle-2.2.2-1.el6.noarch How reproducible: Execute insert/update sql statement into rhnservergroup table. Steps to Reproduce: 1. 2. 3. Actual results: Insert/Update should not give any errors. Expected results: Additional info:
This is not a bug. You need to call clear_log_id() and set_log_auth(:user_id) prior to running the insert. Otherwise, the trigger won't fire correctly. This is handled automatically by Spacewalk's Hibernate Factory and the Logging mechanisms associated with creating new objects via Java (and the API). Pseudo-code would look something like this (in PL/SQL): begin logging.clear_log_id(); logging.set_log_auth(1); insert into rhnservergroup (id, name, description, org_id) values (rhn_server_group_id_seq.nextval, :name, :description, :org_id); end; / This assumes you're inserting with the user_id of 1, which is the initial super-admin account.
subversion-1.8.14-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-be2c11d456
Hi Avi, Thank you for looking at this. I concur the same after reading schema docs. Hence this is enhancement to the database-application structure. Regards
subversion-1.8.15-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-6efa349a85
subversion-1.8.15-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update subversion' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-6efa349a85
Great, looks like no code change was required here. I have tested on both SWnightly@OracleXE10@RHEL6 and SWnightly@PostgreSQL@RHEL7 (spacewalk-schema-2.6.14-1.el?.noarch) by creating new organization what creates new records in the table and yay, new records were created: @Oracle before new organization creation: # echo "SELECT * FROM rhnservergroup;" | spacewalk-sql --select-mode-direct - ID NAME DESCRIPTION CURRENT_MEMBERS GROUP_TYPE ORG_ID CREATED MODIFIED ---------- ---------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------- ---------- ---------- --------------------------------------------------------------------------- --------------------------------------------------------------------------- 1 Spacewalk Management Entitled Servers Spacewalk Management Entitled Servers 0 1 1 10-NOV-16 10.37.05.418097 AM 10-NOV-16 10.37.05.418369 AM 2 Virtualization Host Entitled Servers Virtualization Host Entitled Servers 0 2 1 10-NOV-16 10.37.05.430974 AM 10-NOV-16 10.37.05.431062 AM @Oracle after new organization created: # echo "SELECT * FROM rhnservergroup;" | spacewalk-sql --select-mode-direct - ID NAME DESCRIPTION CURRENT_MEMBERS GROUP_TYPE ORG_ID CREATED MODIFIED ---------- ---------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------- ---------- ---------- --------------------------------------------------------------------------- --------------------------------------------------------------------------- 3 Spacewalk Management Entitled Servers Spacewalk Management Entitled Servers 0 1 2 10-NOV-16 09.16.42.534602 PM 10-NOV-16 09.16.42.534674 PM 4 Virtualization Host Entitled Servers Virtualization Host Entitled Servers 0 2 2 10-NOV-16 09.16.42.562595 PM 10-NOV-16 09.16.42.562668 PM 1 Spacewalk Management Entitled Servers Spacewalk Management Entitled Servers 0 1 1 10-NOV-16 10.37.05.418097 AM 10-NOV-16 10.37.05.418369 AM 2 Virtualization Host Entitled Servers Virtualization Host Entitled Servers 0 2 1 10-NOV-16 10.37.05.430974 AM 10-NOV-16 10.37.05.431062 AM @PostgreSQL before: # echo "SELECT * FROM rhnservergroup;" | spacewalk-sql --select-mode-direct - id | name | description | current_members | group_type | org_id | created | modified ----+---------------------------------------+---------------------------------------+-----------------+------------+--------+-------------------------------+------------------------------- 1 | Spacewalk Management Entitled Servers | Spacewalk Management Entitled Servers | 0 | 1 | 1 | 2016-11-10 10:24:26.639337+01 | 2016-11-10 10:24:26.639337+01 2 | Virtualization Host Entitled Servers | Virtualization Host Entitled Servers | 0 | 2 | 1 | 2016-11-10 10:24:26.639337+01 | 2016-11-10 10:24:26.639337+01 (2 rows) @PostgreSQL after: # echo "SELECT * FROM rhnservergroup;" | spacewalk-sql --select-mode-direct - id | name | description | current_members | group_type | org_id | created | modified ----+---------------------------------------+---------------------------------------+-----------------+------------+--------+-------------------------------+------------------------------- 1 | Spacewalk Management Entitled Servers | Spacewalk Management Entitled Servers | 0 | 1 | 1 | 2016-11-10 10:24:26.639337+01 | 2016-11-10 10:24:26.639337+01 2 | Virtualization Host Entitled Servers | Virtualization Host Entitled Servers | 0 | 2 | 1 | 2016-11-10 10:24:26.639337+01 | 2016-11-10 10:24:26.639337+01 3 | Spacewalk Management Entitled Servers | Spacewalk Management Entitled Servers | 0 | 1 | 2 | 2016-11-10 21:17:20.981545+01 | 2016-11-10 21:17:20.981545+01 4 | Virtualization Host Entitled Servers | Virtualization Host Entitled Servers | 0 | 2 | 2 | 2016-11-10 21:17:20.981545+01 | 2016-11-10 21:17:20.981545+01 (4 rows)
This BZ closed some time during 2.5, 2.6 or 2.7. Adding to 2.7 tracking bug.