[Spacewalk-list] Assigning a base channel internal error (updatedto 1.4-rc) RE: WAS RHN Traceback - violates uniqueconstraint"rhn_sp_snep_uq"

Flaherty, Patrick pflaherty at wsi.com
Fri Apr 29 21:19:26 UTC 2011


> > > Sent: Tuesday, April 05, 2011 5:11 AM
> > > On Fri, Mar 25, 2011 at 05:46:01PM -0400, Flaherty, Patrick wrote:
> > > >  After switching over to the postgres backend, I'm occasionally
> > > getting
> > > > the following traceback when attempting to change a single
host's
> > > > channel assignment. The browser hangs and finally returns a 500.
> > The
> > > > system shows iowaits in the 40s to 90s before I get the 500, and
> > then
> > > > the iowaits return to normal when the 500 comes back.
> > > >
> > > > So, since it says:
> > > >  IntegrityError: duplicate key value violates unique constraint
> > > > "rhn_sp_snep_uq"
> > > >
> > > > Should I be investigating the iowaits, or the unique constraints
> > > error?
> > >
> > > Can you be more specific about the actions that you do? You say
> > > "attempting to change a single host's channel assignment" but the
> > > traceback is from the server handler of registration code which is
> > > no longer used by the latest RHN client tools / yum-rhn-plugin.
> > >
> > > Is the attempt to change channel some rhnreg_ks with activation
> key,
> > > or what exactly do you (knowingly) call? Is the list of the
> packages
> > > in /var/log/up2date? You might need to bump up the debug option in
> > > /etc/sysconfig/rhn/up2date to see the packages listed there.
> >
> > This install of spacewalk has been around for a couple years. We
> > started
> > with one of the early 0. releases (maybe 0.5?), and have been
> upgrading
> > in place whenever a new release comes out since then. Could there be
> > cruft and code / database entries that need to be purged?
> >
> > Steps to reproduce:
> > * Open browser, navigate to spacewalk web interface
> > * Login
> > * Click systems
> > * Click host
> > * Click "Alter Subscriptions"
> > * Receive 500 and a traceback.
> >
> > The traceback I received today when doing those step was *not* the
> one
> > with the uniq_key_restraint error. It could be that I had older
> > spacewalk clients checking in/registering around the same time as I
> got
> > the 500 last time and mixed up the tracebacks. I've included today's
> > traceback. There are also a few systems that cause rhn tracebacks
> when
> > they check in, I'll send in a separate email / thread for those.
> >
> > Patrick
> 
> I updated to 1.4-rc to see if my alter base subscription problem went
> away. I'm still getting the 500 error message. I also get the error if
> I
> use the SSM. Using the SSM used to work, but no longer does.
> 
> Postgres backend, 1.4rc, on centos 5.6 i386.
> 
> Steps to reproduce:
>  * Open browser, navigate to spacewalk web interface
>  * Login
>  * Click systems
>  * Click host (freshly registered)
>  * Click "Alter Subscriptions"
>  * Select Base Channel, click confirm
>  * Next page, click Modify Base Software Channel
>  * Internal server error.
> 
> Steps to reproduce(ssm):
>  * Open browser, navigate to spacewalk web interface
>  * Login
>  * Click systems
>  * Check host (freshly registered)
>  * Click manage
>  * Click manage channel memberships
>  * Select Base Channel, click confirm
>  * Next page, click "Base Channel"
>  * Highlight Appropriate channel and check Alter subscriptions
>  * Next Page, click Alter subscriptions
>  * Internal server error.
> 
> Patrick
> 
> The following exception occurred while executing this request:
> POST /rhn/systems/details/SystemChannels.do
> 
> Date:4/12/11 4:15:35 PM EDT
> Headers:
>   host: my-spacewalk.local
>   user-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13)
> Gecko/20101209 CentOS/3.6-2.el5.centos Firefox/3.6.13
>   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
>   accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>   Keep-Alive: 115
>   connection: keep-alive
>   referer:
> https://my-
> spacewalk.local/rhn/systems/details/SystemChannels.do?sid=100
> 0011747
>   cookie: JSESSIONID=E25C3C1A68D3D7B7D2FCB79576B9EB98;
> pxt-session-cookie=8307x035cb3b3dc53f894c0feb56921a74995
>   content-type: application/x-www-form-urlencoded
>   content-length: 76
> 
> Request:
> Local Name = my-spacewalk.local
> Server Name = my-spacewalk.local Requested Session Id came from Cookie
> Requested Session Valid = true Session =
>
org.apache.catalina.session.StandardSessionFacade at 18aa90a[session=Stand
> a
> rdSession[E25C3C1A68D3D7B7D2FCB79576B9EB98]]
> Protocol = https
> Request Locale = en_US
> Request Character Encoding = UTF-8
> Attribute Names = rhnActiveLang, javax.servlet.request.ssl_session,
> org.apache.struts.action.MESSAGE,
> javax.servlet.jsp.jstl.fmt.timeZone.request, systemChannelsForm,
> session, javax.servlet.request.key_size, __sitemesh__filterapplied,
> javax.servlet.request.cipher_suite, requestedUri,
> org.apache.struts.action.mapping.instance,
> org.apache.struts.action.MODULE,
> 
> Form Variables:
>   submitted: true
>   sid: 1000011747
>   new_base_channel_id: 442
>   dispatch: Modify Base Software Channel
> 
> 
> User Information:
> User spacewalk_admin (id 1, org_id 1)
> 
> Exception:
> javax.servlet.ServletException: Executing query
> Channel.availableFveEntitlements with params {org_id=1,
channel_id=442}
> failed
> 	at
>
org.apache.struts.action.RequestProcessor.processException(RequestProce
> s
> sor.java:535)
> 	at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestP
> r
> ocessor.java:433)
> 	at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java
> :
> 237)
> 	at
>
com.redhat.rhn.frontend.struts.RhnRequestProcessor.process(RhnRequestPr
> o
> cessor.java:82)
> 	at
>
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
> 	at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:269)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.AuthFilter.doFilter(AuthFilter.java:10
> 1
> )
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter
> .
> java:142)
> 	at
>
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.
> j
> ava:58)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(Lo
> c
> alizedEnvironmentFilter.java:67)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(Environment
> F
> ilter.java:108)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.j
> a
> va:55)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(Se
> t
> CharacterEncodingFilter.java:97)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
> v
> e.java:210)
> 	at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
> v
> e.java:172)
> 	at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
> a
> :127)
> 	at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
> a
> :117)
> 	at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
> .
> java:108)
> 	at
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> 1
> 51)
> 	at
> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
> 	at
> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
> 	at
> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
> 	at
>
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java
> :
> 704)
> 	at
>
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket
> .
> java:897)
> 	at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo
> l
> .java:685)
> 	at java.lang.Thread.run(Thread.java:636)
> Caused by: com.redhat.rhn.common.hibernate.HibernateRuntimeException:
> Executing query Channel.availableFveEntitlements with params
{org_id=1,
> channel_id=442} failed
> 	at
>
com.redhat.rhn.common.hibernate.HibernateFactory.lookupObjectByNamedQue
> r
> y(HibernateFactory.java:188)
> 	at
>
com.redhat.rhn.common.hibernate.HibernateFactory.lookupObjectByNamedQue
> r
> y(HibernateFactory.java:158)
> 	at
>
com.redhat.rhn.domain.channel.ChannelFactory.getAvailableFveEntitlement
> s
> (ChannelFactory.java:564)
> 	at
>
com.redhat.rhn.manager.channel.ChannelEntitlementCounter.getAvailableFv
> e
> Entitlements(ChannelEntitlementCounter.java:48)
> 	at
>
com.redhat.rhn.manager.channel.ChannelManager.getAvailableFveEntitlemen
> t
> s(ChannelManager.java:1160)
> 	at
>
com.redhat.rhn.manager.system.SystemManager.availableSystemChannelSubsc
> r
> iptions(SystemManager.java:2033)
> 	at
>
com.redhat.rhn.manager.system.SystemManager.canServerSubscribeToChannel
> (
> SystemManager.java:2005)
> 	at
>
com.redhat.rhn.manager.system.UpdateBaseChannelCommand.store(UpdateBase
> C
> hannelCommand.java:74)
> 	at
>
com.redhat.rhn.frontend.action.systems.sdc.SystemChannelsAction.updateB
> a
> seChannel(SystemChannelsAction.java:267)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
> v
> a:57)
> 	at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
> r
> Impl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:616)
> 	at
>
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.
> j
> ava:270)
> 	at
>
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:18
> 7
> )
> 	at
>
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAc
> t
> ion.java:150)
> 	at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestP
> r
> ocessor.java:431)
> 	... 40 more
> Caused by: org.hibernate.exception.SQLGrammarException: could not
> execute query
> 	at
>
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.jav
> a
> :67)
> 	at
>
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper
> .
> java:43)
> 	at org.hibernate.loader.Loader.doList(Loader.java:2223)
> 	at
> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
> 	at org.hibernate.loader.Loader.list(Loader.java:2099)
> 	at
> org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
> 	at
> org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
> 	at
>
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:14
> 2
> )
> 	at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
> 	at
>
org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.jav
> a
> :811)
> 	at
>
com.redhat.rhn.common.hibernate.HibernateFactory.lookupObjectByNamedQue
> r
> y(HibernateFactory.java:182)
> 	... 56 more
> Caused by: org.postgresql.util.PSQLException: ERROR: function
> rhn_channel.available_fve_chan_subs(bigint, bigint) does not exist
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExec
> u
> torImpl.java:1525)
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorIm
> p
> l.java:1309)
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java
> :
> 188)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statem
> e
> nt.java:452)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJd
> b
> c2Statement.java:354)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2S
> t
> atement.java:258)
> 	at
>
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProx
> y
> PreparedStatement.java:50)
> 	at
>
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:18
> 6
> )
> 	at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
> 	at org.hibernate.loader.Loader.doQuery(Loader.java:674)
> 	at
>
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Load
> e
> r.java:236)
> 	at org.hibernate.loader.Loader.doList(Loader.java:2220)
> 	... 64 more
> 
> 
> SSM Traceback:
> The following exception occurred while executing this request:
> POST /rhn/channel/ssm/BaseChannelSubscribe.do
> 
> Date:4/12/11 4:32:22 PM EDT
> Headers:
>   host: my-spacewalk.local
>   user-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13)
> Gecko/20101209 CentOS/3.6-2.el5.centos Firefox/3.6.13
>   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
>   accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>   Keep-Alive: 115
>   connection: keep-alive
>   referer:
> https://my-spacewalk.local/rhn/channel/ssm/BaseChannelSubscribe.do
>   cookie: JSESSIONID=E25C3C1A68D3D7B7D2FCB79576B9EB98;
> pxt-session-cookie=8307x035cb3b3dc53f894c0feb56921a74995
>   content-type: application/x-www-form-urlencoded
>   content-length: 88
> 
> Request:
> Local Name = my-spacewalk.local
> Server Name = my-spacewalk.local Requested Session Id came from Cookie
> Requested Session Valid = true Session =
>
org.apache.catalina.session.StandardSessionFacade at 18aa90a[session=Stand
> a
> rdSession[E25C3C1A68D3D7B7D2FCB79576B9EB98]]
> Protocol = https
> Request Locale = en_US
> Request Character Encoding = UTF-8
> Attribute Names = rhnActiveLang, javax.servlet.request.ssl_session,
> org.apache.struts.action.MESSAGE,
> javax.servlet.jsp.jstl.fmt.timeZone.request, session, submittedForm,
> javax.servlet.request.key_size, __sitemesh__filterapplied,
> javax.servlet.request.cipher_suite, parentUrl, requestedUri,
> org.apache.struts.action.mapping.instance,
> org.apache.struts.action.MODULE,
> 
> Form Variables:
>   submitted: true
>   base_channel_ids: -1
>   dispatch: Alter Subscriptions
>   new_base_channel_ids: 442
> 
> 
> User Information:
> User spacewalk_admin (id 1, org_id 1)
> 
> Exception:
> javax.servlet.ServletException: Executing query
> Channel.findByIdAndUserId with params {userId=1, cid=442} failed
> 	at
>
org.apache.struts.action.RequestProcessor.processException(RequestProce
> s
> sor.java:535)
> 	at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestP
> r
> ocessor.java:433)
> 	at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java
> :
> 237)
> 	at
>
com.redhat.rhn.frontend.struts.RhnRequestProcessor.process(RhnRequestPr
> o
> cessor.java:82)
> 	at
>
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
> 	at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:269)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.AuthFilter.doFilter(AuthFilter.java:10
> 1
> )
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter
> .
> java:142)
> 	at
>
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.
> j
> ava:58)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(Lo
> c
> alizedEnvironmentFilter.java:67)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(Environment
> F
> ilter.java:108)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.j
> a
> va:55)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(Se
> t
> CharacterEncodingFilter.java:97)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> a
> tionFilterChain.java:215)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> t
> erChain.java:188)
> 	at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
> v
> e.java:210)
> 	at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
> v
> e.java:172)
> 	at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
> a
> :127)
> 	at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
> a
> :117)
> 	at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
> .
> java:108)
> 	at
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> 1
> 51)
> 	at
> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
> 	at
> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
> 	at
> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
> 	at
>
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java
> :
> 704)
> 	at
>
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket
> .
> java:897)
> 	at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo
> l
> .java:685)
> 	at java.lang.Thread.run(Thread.java:636)
> Caused by: com.redhat.rhn.common.hibernate.HibernateRuntimeException:
> Executing query Channel.findByIdAndUserId with params {userId=1,
> cid=442} failed
> 	at
>
com.redhat.rhn.common.hibernate.HibernateFactory.lookupObjectByNamedQue
> r
> y(HibernateFactory.java:188)
> 	at
>
com.redhat.rhn.common.hibernate.HibernateFactory.lookupObjectByNamedQue
> r
> y(HibernateFactory.java:158)
> 	at
>
com.redhat.rhn.domain.channel.ChannelFactory.lookupByIdAndUser(ChannelF
> a
> ctory.java:92)
> 	at
>
com.redhat.rhn.manager.channel.ChannelManager.lookupByIdAndUser(Channel
> M
> anager.java:699)
> 	at
>
com.redhat.rhn.frontend.action.channel.ssm.BaseSubscribeAction.buildMes
> s
> ages(BaseSubscribeAction.java:568)
> 	at
>
com.redhat.rhn.frontend.action.channel.ssm.BaseSubscribeAction.changeCh
> a
> nnels(BaseSubscribeAction.java:337)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
> v
> a:57)
> 	at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
> r
> Impl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:616)
> 	at
>
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.
> j
> ava:270)
> 	at
>
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:18
> 7
> )
> 	at
>
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAc
> t
> ion.java:150)
> 	at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestP
> r
> ocessor.java:431)
> 	... 40 more
> Caused by: org.hibernate.exception.GenericJDBCException: could not
> execute query
> 	at
>
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(S
> Q
> LStateConverter.java:103)
> 	at
>
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.jav
> a
> :91)
> 	at
>
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper
> .
> java:43)
> 	at org.hibernate.loader.Loader.doList(Loader.java:2223)
> 	at
> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
> 	at org.hibernate.loader.Loader.list(Loader.java:2099)
> 	at
> org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
> 	at
> org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
> 	at
>
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:14
> 2
> )
> 	at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
> 	at
>
org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.jav
> a
> :811)
> 	at
>
com.redhat.rhn.common.hibernate.HibernateFactory.lookupObjectByNamedQue
> r
> y(HibernateFactory.java:182)
> 	... 53 more
> Caused by: org.postgresql.util.PSQLException: ERROR: current
> transaction
> is aborted, commands ignored until end of transaction block
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExec
> u
> torImpl.java:1525)
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorIm
> p
> l.java:1309)
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java
> :
> 188)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statem
> e
> nt.java:452)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJd
> b
> c2Statement.java:354)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2S
> t
> atement.java:258)
> 	at
>
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProx
> y
> PreparedStatement.java:50)
> 	at
>
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:18
> 6
> )
> 	at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
> 	at org.hibernate.loader.Loader.doQuery(Loader.java:674)
> 	at
>
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Load
> e
> r.java:236)
> 	at org.hibernate.loader.Loader.doList(Loader.java:2220)
> 	... 61 more

I finally got around to turning on debugging and found:

2011-04-29 16:59:11,282 [TP-Processor6] ERROR
org.hibernate.util.JDBCExceptionReporter - ERROR: function
rhn_channel.available_fve_chan_subs(bigint, bigint) does not exist

I then went around calling most of the functions that involved
entitlements and realized most returned zero. So I hacked this in

create function rhn_channel.available_fve_chan_subs(bigint, bigint)
returns integer as $$
select 0;
$$ LANGUAGE SQL;

Changing subscriptions and and updating hosts *appears* to work now. I
don't know if the function was missed when I swapped out backends to
postgres, or when updated to 1.4-rc (when the problem showed up). 

Since I'm not sure if this is a problem with the migration to postgres
backend, the upgrade to 1.4-rc, or the upgrade to 1.4, how do you want
me to file the bug?

Patrick





More information about the Spacewalk-list mailing list