Your date format may be wrong.  Is $date_time just "now"?  If so, try
"$date_time = $client->date_time(strftime("%Y%m%dT%H:%M:%S",
localtime(time())));".  The date has to be in ISO8601 format.

Check here <https://fedorahosted.org/spacewalk/wiki/SpacewalkApiPerlGuide> for
examples (pretty much at the end).

CC


On Wed, Nov 27, 2013 at 9:31 AM, Austin Lavinghouse <aelav...@go.olemiss.edu
> wrote:

> So this script is simply intended to get the info needed from two systems,
> and sync them. But no matter what I try, I get the same "Fault returned
> from XML RPC Server, fault code 1213: redstone.xmlrpc.XmlRpcFault: No
> packages to sync" error.
>
> The relevant part of the script:
> my $package_metadata = $client->call('system.compare_packages', $session,
> $group_sids[1], $group_sids[0]);
>
> #DEBUG
> print(Dumper($package_metadata));
>
> #Alrighty so we can in fact compare two systems. Let's see if we can sync
> them. First, grab dat package id
> my @package_ids;
>
> foreach my $package (@$package_metadata) {
>     push(@package_ids,$package->{'package_name_id'});
> }
>
> foreach (@package_ids) {
> print "Id: ".$_."\n";
> }
>
> #now schedule that sync
> # the group sids are client sids from a selected group.
> my $action_id = $client->call('system.schedule_sync_packages_with_system',
> $session, $group_sids[1], $group_sids[0], \@package_ids, $date_time);
>
> The output  ($VAR1 is from a dump of the comparison):
> $VAR1 = [
>           {
>             'comparison' => '1',
>             'package_name_id' => '3379',
>             'package_arch' => 'x86_64',
>             'package_name' => 'emacs',
>             'this_system' => '23.1-21.el6_2.3:1'
>           },
>           ... snipped, the other packages are listed below..
>         ];
> Id: 3379
> Id: 4341
> Id: 4342
> Id: 3789
> Id: 1901
> Id: 2808
> Id: 4277
> Id: 500
> Fault returned from XML RPC Server, fault code 1213:
> redstone.xmlrpc.XmlRpcFault: No packages to sync
>
> From the log:
> [2013-11-26 19:01:13,264] ERROR - REQUESTED FROM: 192.168.56.101 CALL:
> system.schedule_sync_packages_with_system(200x03ed0fcac2a5df0f098e48ad068ced79,
> 1000010001, 1000010000, [3379, 4341, 4342, 3789, 1901, 2808, 4277, 500],
> Tue Nov 26 19:02:10 CST 2013) CALLER: (george) TIME: 1.59 seconds
> redstone.xmlrpc.XmlRpcFault: No packages to sync
>         at
> com.redhat.rhn.frontend.xmlrpc.BaseHandler.invoke(BaseHandler.java:158)
>         at
> redstone.xmlrpc.XmlRpcDispatcher.dispatch(XmlRpcDispatcher.java:123)
>         ...snipped....
>
> At first I was getting the same error in spacecmd, but by installing new
> packages (originally nmap was the only difference) I was able to
> successfully schedule the sync event; I confirmed this through the web GUI.
> I have tried switching the target system with the profiled system both in
> the comparison and the sync, but no combination has yielded anything other
> than the error described above. Any help would be greatly appreciated, I've
> been banging my head against the keyboard for several hours now.
>
> Thanks so much!
> Austin Lavinghouse
>
> _______________________________________________
> Spacewalk-devel mailing list
> Spacewalk-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-devel
>



-- 
RHCE#805007969328369
_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to