Bug 1395879 - Internal Server Error on ShowProfile page
Summary: Internal Server Error on ShowProfile page
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 580
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Patrik Segedy
URL:
Whiteboard:
Depends On: 1353210
Blocks: sat580-spw-retest
TreeView+ depends on / blocked
 
Reported: 2016-11-16 21:17 UTC by Jan Hutař
Modified: 2017-06-21 12:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1353210
Environment:
Last Closed: 2017-06-21 12:17:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2016-11-16 21:17:46 UTC
We have tested (or attempted to test) bug like this when Spacewalk 2.6 was to be released. This is a clone of that bug to get it re-tested on Satellite 5.8.0. In some cases bug can be completely irrelevant (in such cases I suggest to close the bug as NOTABUG), in some cases it might be wise to take the bug as a note that something changed in a given area and we might want to sanity-test that area (and mark the bug as VERIFIED with "SanityOnly" keyword) and in some cases bug might be totally relevant to Satellite.



+++ This bug was initially created as a clone of Bug #1353210 +++

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

--- Additional comment from Grant Gainey on 2016-07-06 11:32:45 EDT ---

SUBSTRING(str, regex) is postgres-only and fails on Oracle - we need to find a different, cross-db, way to accomplish this

--- Additional comment from Gennadii Altukhov on 2016-07-07 10:27:41 EDT ---

Taking...

--- Additional comment from Gennadii Altukhov on 2016-07-07 11:37:38 EDT ---

spacewalk.git:
408042f83c59fec4ff4095d2ad0512898244a509

--- Additional comment from Pavel Studeník on 2016-11-10 11:12:28 EST ---

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


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