Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 809897

Summary: viewing package profiles causes internal server error on PostgreSQL
Product: [Community] Spacewalk Reporter: Paul Robert Marino <prmarino1>
Component: WebUIAssignee: Jan Pazdziora (Red Hat) <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.7CC: jpazdziora, vogt
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: spacewalk-java-1.8.35-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-01 16:20:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 871344    
Attachments:
Description Flags
back port of the patch to spacewalk 1.7 none

Description Paul Robert Marino 2012-04-04 15:41:33 UTC
Description of problem:

viewing package profiles causes internal server error on PostgreSQL

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

Confirmed on Version 1.8

How reproducible:

go into

Systems -> Stored Profiles -> <profile name> -> Packages
 
Actual results:

Internal Server Error

Expected results:

I should see a list of the packages in the profile

Additional info:


Query in PostgreSQL that fails from the log

"
ERROR:  cross-database references are not implemented: pe.evr.as_vre_simple
STATEMENT:  SELECT PN.name || '-' || PE.evr.as_vre_simple() AS NVRE,
               PA.label as arch
          FROM rhnServerProfilePackage SPP
                        LEFT JOIN rhnPackageArch PA ON SPP.package_arch_id = PA.id
                        INNER JOIN rhnPackageName PN ON SPP.name_id = PN.id
                        INNER JOIN rhnPackageEVR PE ON SPP.evr_id = PE.id
         WHERE SPP.server_profile_id = $1
        ORDER BY UPPER(PN.name), PE.evr
ERROR:  current transaction is aborted, commands ignored until end of transaction block
STATEMENT:  SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME,  CASE n.nspname ~ '^pg_' OR n.nspname = 'information_schema'  WHEN true THEN CASE  WHEN n.nspname = 'pg_catalog' OR n.nspname = 'information_schema' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TABLE'   WHEN 'v' THEN 'SYSTEM VIEW'   WHEN 'i' THEN 'SYSTEM INDEX'   ELSE NULL   END  WHEN n.nspname = 'pg_toast' THEN CASE c.relkind   WHEN 'r' THEN 'SYSTEM TOAST TABLE'   WHEN 'i' THEN 'SYSTEM TOAST INDEX'   ELSE NULL   END  ELSE CASE c.relkind   WHEN 'r' THEN 'TEMPORARY TABLE'   WHEN 'i' THEN 'TEMPORARY INDEX'   ELSE NULL   END  END  WHEN false THEN CASE c.relkind  WHEN 'r' THEN 'TABLE'  WHEN 'i' THEN 'INDEX'  WHEN 'S' THEN 'SEQUENCE'  WHEN 'v' THEN 'VIEW'  ELSE NULL  END  ELSE NULL  END  AS TABLE_TYPE, d.description AS REMARKS  FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c  LEFT JOIN pg_catalog.pg_description d ON (c.oid = d.objoid AND d.objsubid = 0)  LEFT JOIN pg_catalog.pg_class dc ON (d.classoid=dc.oid AND dc.relname='pg_class')  LEFT JOIN pg_catalog.pg_namespace dn ON (dn.oid=dc.relnamespace AND dn.nspname='pg_catalog')  WHERE c.relnamespace = n.oid  AND c.relname LIKE 'PROBABLYNOT'  AND (false  OR ( c.relkind = 'r' AND n.nspname !~ '^pg_' AND n.nspname <> 'information_schema' ) )  ORDER BY TABLE_TYPE,TABLE_SCHEM,TABLE_NAME

"

Traceback

"
The following exception occurred while executing this request:
GET /rhn/profiles/PackageList.do

Date:4/4/12 11:22:56 AM EDT
Headers:
  host: Servernamehere
  user-agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0
  accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  accept-language: en-us,en;q=0.5
  accept-encoding: gzip, deflate
  connection: keep-alive
  referer: https://170.20.93.168/rhn/profiles/Details.do?prid=1
  cookie: JSESSIONID=7C20FA6D461C55CD1616A24B48E31424; pxt-session-cookie=30752x95d6d4464049bc029a59c0473d27a645

Request:
Local Name = Servernamehere
Server Name = Servernamehere
Requested Session Id came from Cookie
Requested Session Valid = true
Session = org.apache.catalina.session.StandardSessionFacade@36e894f3[session=StandardSession[7C20FA6D461C55CD1616A24B48E31424]]
Protocol = https
Request Locale = en_US
Request Character Encoding = UTF-8
Attribute Names = rhnActiveLang, javax.servlet.jsp.jstl.fmt.timeZone.request, javax.servlet.error.status_code, javax.servlet.error.servlet_name, javax.servlet.request.key_size, requestedUri, javax.servlet.request.ssl_session, org.apache.struts.action.MESSAGE, javax.servlet.error.message, session, javax.servlet.error.exception, javax.servlet.request.cipher_suite, org.apache.struts.action.mapping.instance, javax.servlet.error.request_uri, org.apache.struts.action.MODULE, profile, 


User Information:
User pmarino (id 1, org_id 1)

Exception:
javax.servlet.ServletException: com.redhat.rhn.common.db.WrappedSQLException: ERROR: cross-database references are not implemented: pe.evr.as_vre_simple
	at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
	at com.redhat.rhn.frontend.struts.RhnRequestProcessor.process(RhnRequestProcessor.java:99)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.AuthFilter.doFilter(AuthFilter.java:91)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(LocalizedEnvironmentFilter.java:67)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilter.java:108)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:55)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
	at java.lang.Thread.run(Thread.java:679)
Caused by: com.redhat.rhn.common.db.WrappedSQLException: ERROR: cross-database references are not implemented: pe.evr.as_vre_simple
	at com.redhat.rhn.common.translation.SqlExceptionTranslator.postgreSqlException(SqlExceptionTranslator.java:54)
	at com.redhat.rhn.common.translation.SqlExceptionTranslator.sqlException(SqlExceptionTranslator.java:44)
	at com.redhat.rhn.common.db.NamedPreparedStatement.execute(NamedPreparedStatement.java:141)
	at com.redhat.rhn.common.db.datasource.CachedStatement.execute(CachedStatement.java:453)
	at com.redhat.rhn.common.db.datasource.CachedStatement.execute(CachedStatement.java:430)
	at com.redhat.rhn.common.db.datasource.CachedStatement.execute(CachedStatement.java:336)
	at com.redhat.rhn.common.db.datasource.CachedStatement.execute(CachedStatement.java:341)
	at com.redhat.rhn.common.db.datasource.CachedStatement.execute(CachedStatement.java:281)
	at com.redhat.rhn.common.db.datasource.SelectMode.execute(SelectMode.java:109)
	at com.redhat.rhn.manager.BaseManager.makeDataResult(BaseManager.java:57)
	at com.redhat.rhn.manager.profile.ProfileManager.listProfilePackages(ProfileManager.java:1282)
	at com.redhat.rhn.frontend.action.rhnpackage.profile.PackageListAction.getResult(PackageListAction.java:81)
	at com.redhat.rhn.frontend.taglibs.list.helper.ListHelper.setupDataSet(ListHelper.java:107)
	at com.redhat.rhn.frontend.taglibs.list.helper.ListHelper.execute(ListHelper.java:100)
	at com.redhat.rhn.frontend.action.rhnpackage.profile.PackageListAction.execute(PackageListAction.java:68)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
	... 40 more
Caused by: org.postgresql.util.PSQLException: ERROR: cross-database references are not implemented: pe.evr.as_vre_simple
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:360)
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:362)
	at com.redhat.rhn.common.db.NamedPreparedStatement.execute(NamedPreparedStatement.java:138)
	... 53 more
"

Comment 1 Jan Pazdziora (Red Hat) 2012-04-05 13:36:41 UTC
Fixed in Spacewalk master, a041d5642d12a6b89d0c1e8fe6a34bf65081051f.

Comment 3 Paul Robert Marino 2012-08-23 23:10:44 UTC
Created attachment 606718 [details]
back port of the patch to spacewalk 1.7

Comment 4 Paul Robert Marino 2012-08-23 23:11:40 UTC
also this effects spacewalk-base

 rpm -qf /usr/share/perl5/vendor_perl/RHN/DB/DataSource/xml/profile_queries.xml
spacewalk-base-1.7.28-1.el6.noarch

Comment 5 Paul Robert Marino 2012-08-23 23:14:32 UTC
note the diff I attached was generated of the 1.7 branch so please update that branch in the git repo as well so we can have this fixed in the stable release. Thank You

Comment 6 Paul Robert Marino 2012-08-28 20:54:43 UTC
Hey I know you are all busy with the new satellite release but I've tested the fix and even tested applying it to 1.7 and confirmed it works there too, and included a git diff against the SPACEWALK-1.7 branch. can we please put it in since we know there wont be a production ready release of 1.8 for quite some time due partly to the cobbler 2.2 updates. it would be really nice to be able to see this ticket get closed and the functionality provided to the 1.7 users in general until the 1.8 release is ready for production deployments.
this should be a relatively quick task to execute especially since the bug is so easy to reproduce.


Thank You

Comment 7 Jan Pazdziora (Red Hat) 2012-08-29 06:37:46 UTC
(In reply to comment #6)
> Hey I know you are all busy with the new satellite release but I've tested
> the fix and even tested applying it to 1.7 and confirmed it works there too,
> and included a git diff against the SPACEWALK-1.7 branch. can we please put
> it in since we know there wont be a production ready release of 1.8 for
> quite some time due partly to the cobbler 2.2 updates. it would be really
> nice to be able to see this ticket get closed and the functionality provided
> to the 1.7 users in general until the 1.8 release is ready for production
> deployments.
> this should be a relatively quick task to execute especially since the bug
> is so easy to reproduce.

We won't be releasing updated packages for Spacewalk 1.7 for this bugzilla. It's not a regression, people can rebuild the packages from .src.rpm with the fix if they want, but first and foremost, I'd love to see the community start to push loudly for the cobbler issues to get resolved, so that we could move forward with 1.8.

Comment 8 Jan Pazdziora (Red Hat) 2012-10-30 19:25:20 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 9 Jan Pazdziora (Red Hat) 2012-11-01 16:20:57 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18