Bug 1353210 - Internal Server Error on ShowProfile page
Summary: Internal Server Error on ShowProfile page
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.5
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
Assignee: Gennadii Altukhov
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: 1395879 space27
TreeView+ depends on / blocked
 
Reported: 2016-07-06 14:22 UTC by unix
Modified: 2017-09-27 19:13 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
: 1395879 (view as bug list)
Environment:
Last Closed: 2017-09-27 19:13:58 UTC
Embargoed:


Attachments (Terms of Use)

Description unix 2016-07-06 14:22:34 UTC
Description of problem:
Spacewalk throws an error when you try and view a systems package profile
javax.servlet.ServletException: com.redhat.rhn.common.db.WrappedSQLException: ORA-00904: "SUBSTRING": invalid identifier. 


Version-Release number of selected component (if applicable):
2.5

How reproducible:
Always

Steps to Reproduce:
1. View a systems profile
System -> Software -> Packages -> Profile


Actual results:
ISE 

Expected results:
A list of installed packages

Additional info:
Running on CentOS 6 with Oracle 11g

Catalina logs show
2016-07-06 09:26:03,398 [TP-Processor12] ERROR com.redhat.rhn.common.db.datasource.CachedStatement - Error while processing cached statement sql: SELECT S.id, S.name
  FROM rhnServer S,
       rhnServer SBase
 WHERE S.org_id = SBase.org_id
   AND SBase.id = ?
   AND EXISTS (SELECT 1 FROM rhnUserServerPerms WHERE user_id = ? AND server_id = S.id)
   AND S.server_arch_id = SBase.server_arch_id
   AND SUBSTRING(S.release, '^[0-9]+') = SUBSTRING(SBase.release, '^[0-9]+')
   AND S.id != ?
   AND EXISTS(SELECT 1 FROM rhnServerFeaturesView SFV WHERE SFV.server_id = S.id AND SFV.label = 'ftr_profile_compare')
ORDER BY UPPER(S.name)
com.redhat.rhn.common.db.WrappedSQLException: ORA-00904: "SUBSTRING": invalid identifier

Here is the commit that introduced this change
https://github.com/spacewalkproject/spacewalk/commit/0420e50fa4fcd819b8c99ca28682a1a0f1fae621

Comment 1 Grant Gainey 2016-07-06 15:32:45 UTC
SUBSTRING(str, regex) is postgres-only and fails on Oracle - we need to find a different, cross-db, way to accomplish this

Comment 2 Gennadii Altukhov 2016-07-07 14:27:41 UTC
Taking...

Comment 3 Gennadii Altukhov 2016-07-07 15:37:38 UTC
spacewalk.git:
408042f83c59fec4ff4095d2ad0512898244a509

Comment 4 Pavel Studeník 2016-11-10 16:12:28 UTC
Problem only on Oracle.

Reproducer by #Description
spacewalk-java-oracle-2.5.98-1.el6.noarch
spacewalk-java-2.5.98-1.el6.noarch

Verified with 
spacewalk-java-oracle-2.6.47-1.el7.noarch
spacewalk-java-2.6.47-1.el7.noarch

Comment 5 Eric Herget 2017-09-27 19:13:58 UTC
Spacewalk 2.7 has been released.

https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes27


Note You need to log in before you can comment on or make changes to this bug.