Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1191418 - XmlRpcFault in configchannel_import via spacecmd where the channel contains a directory on 2.3/nightly
Summary: XmlRpcFault in configchannel_import via spacecmd where the channel contains a...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 2.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matej Kollar
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: 1194340 space23
TreeView+ depends on / blocked
 
Reported: 2015-02-11 10:01 UTC by Patrick Hurrelmann
Modified: 2015-07-26 22:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1194340 (view as bug list)
Environment:
Last Closed: 2015-04-14 19:03:24 UTC
Embargoed:


Attachments (Terms of Use)
Sample config channel export with a directory, that fails on import (22.13 KB, text/plain)
2015-02-11 10:01 UTC, Patrick Hurrelmann
no flags Details

Description Patrick Hurrelmann 2015-02-11 10:01:56 UTC
Created attachment 990404 [details]
Sample config channel export with a directory, that fails on import

Description of problem:

When migrating (export then import) config channels from an old 2.2 installation on RHEL6 to a new 2.3/nightly installation on RHEL7 config channels that contain a directory cannot be imported again.

Example use of spacecmd:

spacecmd {SSM:0}> configchannel_import db-postgresql-wal-el7.json
INFO: Importing config channel  Database PostgreSQL WAL EL7
INFO: Found file /var/lib/pgsql/data/postgresql.conf for cc Database PostgreSQL WAL EL7
INFO: Found directory /var/lib/pgsql/data/wal-archive for cc Database PostgreSQL WAL EL7
ERROR: redstone.xmlrpc.XmlRpcFault: Invalid argument(s): contents


Exception as logged in catalina.out:

2015-02-11 10:36:36,271 [ajp-apr-0:0:0:0:0:0:0:1-8009-exec-2] ERROR com.redhat.rhn.frontend.xmlrpc.BaseHandler - Caused by: 
com.redhat.rhn.frontend.xmlrpc.InvalidArgsException: Invalid argument(s): contents
        at com.redhat.rhn.frontend.xmlrpc.BaseHandler.validateMap(BaseHandler.java:462)
        at com.redhat.rhn.frontend.xmlrpc.configchannel.ConfigChannelHandler.createOrUpdatePath(ConfigChannelHandler.java:415)
        at sun.reflect.GeneratedMethodAccessor1315.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.redhat.rhn.frontend.xmlrpc.BaseHandler.invoke(BaseHandler.java:172)
        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:647)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        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:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(LocalizedEnvironmentFilter.java:67)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilter.java:100)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:57)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:197)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1810)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
2015-02-11 10:36:36,271 [ajp-apr-0:0:0:0:0:0:0:1-8009-exec-2] ERROR com.redhat.rhn.frontend.xmlrpc.BaseHandler - Rolling back transaction
Feb 11, 2015 10:36:36 AM redstone.xmlrpc.XmlRpcDispatcher writeError
WARNING: redstone.xmlrpc.XmlRpcFault: Invalid argument(s): contents


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

rhn-check.noarch                        2.3.8-1.el7   @spacewalk-client-nightly
rhn-client-tools.noarch                 2.3.8-1.el7   @spacewalk-client-nightly
rhn-setup.noarch                        2.3.8-1.el7   @spacewalk-client-nightly
rhncfg.noarch                           5.10.81-1.el7 @spacewalk-client-nightly
rhncfg-client.noarch                    5.10.81-1.el7 @spacewalk-client-nightly
rhnlib.noarch                           2.5.74-1.el7  @spacewalk-client-nightly
rhnpush.noarch                          5.5.84-1.el7  @spacewalk-nightly       
rhnsd.x86_64                            5.0.15-1.el7  @spacewalk-client-nightly
spacecmd.noarch                         2.3.14-1.el7  @spacewalk-nightly       
spacewalk-admin.noarch                  2.3.3-1.el7   @spacewalk-nightly       
spacewalk-backend.noarch                2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-app.noarch            2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-applet.noarch         2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-config-files.noarch   2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-config-files-common.noarch
                                        2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-config-files-tool.noarch
                                        2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-iss.noarch            2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-iss-export.noarch     2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-libs.noarch           2.3.38-1.el7  @spacewalk-client-nightly
spacewalk-backend-package-push-server.noarch
                                        2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-server.noarch         2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-sql.noarch            2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-sql-postgresql.noarch 2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-tools.noarch          2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-xml-export-libs.noarch
                                        2.3.38-1.el7  @spacewalk-nightly       
spacewalk-backend-xmlrpc.noarch         2.3.38-1.el7  @spacewalk-nightly       
spacewalk-base.noarch                   2.3.33-1.el7  @spacewalk-nightly       
spacewalk-base-minimal.noarch           2.3.33-1.el7  @spacewalk-nightly       
spacewalk-base-minimal-config.noarch    2.3.33-1.el7  @spacewalk-nightly       
spacewalk-branding.noarch               2.3.19-1.el7  @spacewalk-nightly       
spacewalk-certs-tools.noarch            2.3.1-1.el7   @spacewalk-client-nightly
spacewalk-common.noarch                 2.3.1-1.el7   @spacewalk-nightly       
spacewalk-config.noarch                 2.3.3-1.el7   @spacewalk-nightly       
spacewalk-doc-indexes.noarch            2.3.2-1.el7   @spacewalk-nightly       
spacewalk-grail.noarch                  2.3.33-1.el7  @spacewalk-nightly       
spacewalk-html.noarch                   2.3.33-1.el7  @spacewalk-nightly       
spacewalk-java.noarch                   2.3.139-1.el7 @spacewalk-nightly       
spacewalk-java-config.noarch            2.3.139-1.el7 @spacewalk-nightly       
spacewalk-java-lib.noarch               2.3.139-1.el7 @spacewalk-nightly       
spacewalk-java-postgresql.noarch        2.3.139-1.el7 @spacewalk-nightly       
spacewalk-jpp-workaround.noarch         2.3.2-1.el7   @spacewalk-nightly       
spacewalk-monitoring.noarch             2.2.1-1.el7   @spacewalk-nightly       
spacewalk-monitoring-selinux.noarch     2.2.1-1.el7   @spacewalk-nightly       
spacewalk-postgresql.noarch             2.3.1-1.el7   @spacewalk-nightly       
spacewalk-pxt.noarch                    2.3.33-1.el7  @spacewalk-nightly       
spacewalk-schema.noarch                 2.3.34-1.el7  @spacewalk-nightly       
spacewalk-search.noarch                 2.3.5-1.el7   @spacewalk-nightly       
spacewalk-selinux.noarch                2.3.1-1.el7   @spacewalk-nightly       
spacewalk-setup.noarch                  2.3.8-1.el7   @spacewalk-nightly       
spacewalk-setup-jabberd.noarch          2.3.1-1.el7   @spacewalk-nightly       
spacewalk-setup-postgresql.noarch       2.3.1-1.el7   @spacewalk-nightly       
spacewalk-sniglets.noarch               2.3.33-1.el7  @spacewalk-nightly       
spacewalk-taskomatic.noarch             2.3.139-1.el7 @spacewalk-nightly 

How reproducible:

Always

Steps to Reproduce:
1. Export config channel that includes a directory on SW 2.2 using spacecmd
2. Import the same config channel again in SW 2.3 using spacecmd 

Actual results:

Config channel is only imported in parts, directory import fails and spacecmd aborts import. 

Expected results:

Config channel is successfully imported

Additional info:

Sample config-channel export is attached.

Comment 1 Matej Kollar 2015-02-19 14:11:27 UTC
Thank you  Patrick for the report. I really managed to reproduce the
problem and have prepared fix. In the meantime (as a workaround) you
can remove

  "content": ""

from directories in exports you plan to import. Either manually or
programmatically. Here is simple example:

import json
import sys

items = json.load(sys.stdin)
for item in items:
    for file in item.get('files', []):
        if file.get('type') == 'directory' and 'contents' in file:
            del file['contents']
json.dump(items, sys.stdout, indent=4)

Once again, thank you :-).

Comment 2 Matej Kollar 2015-02-19 15:32:03 UTC
Spacewalk.git: e2cf6b7955a14d367a9639d2c843d32995afc5b3

Changes should get into nightly soon.

Comment 3 Grant Gainey 2015-03-23 16:59:13 UTC
Moving bugs to ON_QA as we move to release Spacewalk 2.3

Comment 4 Grant Gainey 2015-04-14 19:03:24 UTC
Spacewalk 2.3 has been released. See

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes23


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