[Spacewalk-list] API call system.scheduleScriptRun Error

Jeremy Davis jdavis4102 at gmail.com
Wed May 30 15:44:31 UTC 2012


Hello Milan,

I used the systemgroup.listActiveSystemsInGroup and assigned the output to
an array. Based on the documentation of the
systemgroup.listActiveSystemsInGroup that it provides you an array of
integers of system ids. Is this correct or do I need to change a couple of
thing. I am using perl for this script.

On Wed, May 30, 2012 at 12:39 AM, Milan Zazrivec <mzazrivec at redhat.com>wrote:

> > Hello List,
> >
> > I am trying to use the system.scheduleScriptRun API call that takes an
> > array of Spacewalk system IDs (obtained by the api call
> > systemgroup.listActiveSystemsInGroup) to run a script on some servers. I
> > get the following error when I call the API to run.
> >
> > CALL: system.scheduleScriptRun(78649xba40408a720cb82ea3d3de7ab3a8398e,
> > [[1000010065], [1000010285]], root, root, 60, #!/bin/sh
> > <removed for security, Tue May 29 15:02:34 MST 2012) CALLER: (removed for
> > security) TIME: 0.006 seconds
> > redstone.xmlrpc.XmlRpcFault: unhandled internal exception:
> > redstone.xmlrpc.XmlRpcArray cannot be cast to java.lang.Integer
>
> Shouldn't the second function argument (array of System IDs of the servers
> to
> run the script on) be an array of integers?
>
> What you're showing above would lead me to believe you're passing the
> function
> an array of arrays.
>
> -Milan Zázrivec
>
> > at
> com.redhat.rhn.frontend.xmlrpc.BaseHandler.invoke(BaseHandler.java:131)
> > at redstone.xmlrpc.XmlRpcDispatcher.dispatch(XmlRpcDispatcher.java:123)
> > at
> >
> com.redhat.rhn.frontend.xmlrpc.RhnXmlRpcServer.execute(RhnXmlRpcServer.java
> > :54) at
> >
> com.redhat.rhn.frontend.xmlrpc.XmlRpcServlet.doPost(XmlRpcServlet.java:162)
> > 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(Applicatio
> > nFilterChain.java:269) at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
> > hain.java:188) at
> >
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.jav
> > a:142) at
> >
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java
> > :58) at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
> > nFilterChain.java:215) at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
> > hain.java:188) at
> >
> com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(Locali
> > zedEnvironmentFilter.java:67) at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
> > nFilterChain.java:215) at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
> > hain.java:188) at
> >
> com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilt
> > er.java:108) at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
> > nFilterChain.java:215) at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
> > hain.java:188) at
> >
> com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:
> > 55) at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
> > nFilterChain.java:215) at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
> > hain.java:188) at
> >
> com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCha
> > racterEncodingFilter.java:97) at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
> > nFilterChain.java:215) at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
> > hain.java:188) at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
> > ava:210) at
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j
> > ava:172) at
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12
> > 7) at
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:11
> > 7) at
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav
> > a:108) at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> > 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.jav
> > a:897) at
> >
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja
> > va:685) at java.lang.Thread.run(Thread.java:679)
> >
> > Based on the API docs provided with Spacewalk there are two API calls for
> > system.scheduleScriptRun. One takes an array of system ids. The other
> just
> > takes a system id. What could I be doing wrong? Below you will find the
> > code that calls the system.scheduleScriptRun API.
> >
> > my $OSAD_ID = $SPACEWALK_API_CLIENT->call('system.scheduleScriptRun',
> > $SPACEWALK_API_SESSION, \@PROXY_SERVERS, 'root', 'root', 60, $SCRIPT,
> > $SPACEWALK_TIME);
> >
> > Thank you for your time and have a great day!
> >
> > Regards,
> > Jeremy
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20120530/31e9a8ca/attachment.htm>


More information about the Spacewalk-list mailing list