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.
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 :-).
Spacewalk.git: e2cf6b7955a14d367a9639d2c843d32995afc5b3 Changes should get into nightly soon.
Moving bugs to ON_QA as we move to release Spacewalk 2.3
Spacewalk 2.3 has been released. See https://fedorahosted.org/spacewalk/wiki/ReleaseNotes23