Description of problem: A user with the _Create Bundle In Group_ permission is unable to create a bundle and associate it with a bundle group when the bundle archive file is larger then 30 MB. ERROR [org.jboss.as.ejb3.invocation] (http-/0.0.0.0:7080-6) JBAS014134: EJB Invocation failed on component BundleManagerBean for method public abstract org.rhq.core.domain.bundle.BundleVersion org.rhq.enterprise.server.bundle.BundleManagerLocal.createInitialBundleVersionViaToken(org.rhq.core.domain.auth.Subject,int[],java.lang.String) throws java.lang.Exception: javax.ejb.EJBException: java.lang.IllegalArgumentException: Token did not result in valid file [/tmp/upload__2700a40a_14e0df9cb34__8000_00000014.tmp] at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInNoTx(CMTTxInterceptor.java:215) [jboss-as-ejb3-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19] at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:261) [jboss-as-ejb3-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19] ... at org.rhq.enterprise.server.bundle.BundleManagerLocal$$$view80.createInitialBundleVersionViaToken(Unknown Source) [rhq-server.jar:4.12.0.JON330GA] at org.rhq.coregui.server.gwt.BundleGWTServiceImpl.createInitialBundleVersionViaToken(BundleGWTServiceImpl.java:117) ... Caused by: java.lang.IllegalArgumentException: Token did not result in valid file [/tmp/upload__2700a40a_14e0df9cb34__8000_00000014.tmp] at org.rhq.enterprise.server.bundle.BundleManagerBean.createInitialBundleVersionViaToken(BundleManagerBean.java:2671) [rhq-server.jar:4.12.0.JON330GA] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_75] ... Version-Release number of selected component (if applicable): 3.3.1 How reproducible: Always Steps to Reproduce: 1. Install, configure and start JBoss ON 3.3 system. 2. Build a bundle archive that is at least 80 MB in size. ~~~ tmpDir="`mktemp -d`" cat >"${tmpDir}"/deploy.xml <<EOF <?xml version="1.0"?> <project name="largeFile" default="main" xmlns:rhq="antlib:org.rhq.bundle"> <target name="main" /> <rhq:bundle name="Large File Test Bundle" version="1.0" description="A sample bundle consisting of a single large file"> <rhq:deployment-unit name="files" compliance="filesAndDirectories"> EOF mkdir "${tmpDir}"/files for file in {001..001}; do echo "This is File #${file}." > "${tmpDir}/files/file-${file}.txt" dd if=/dev/urandom of="${tmpDir}/files/file-${file}.bin" bs=8M count=10 echo ' <rhq:file name="files/file-'"${file}"'.txt" destinationFile="files/file-'"${file}"'.txt" replace="true" />' >> "${tmpDir}"/deploy.xml echo ' <rhq:file name="files/file-'"${file}"'.bin" destinationFile="files/file-'"${file}"'.bin" replace="true" />' >> "${tmpDir}"/deploy.xml done cat >>"${tmpDir}"/deploy.xml <<EOF </rhq:deployment-unit> </rhq:bundle> </project> EOF (cd "${tmpDir}" && zip -r /tmp/large-bundle.zip .) rm -rf "${tmpDir}" ls -al /tmp/large-bundle.zip ~~~ 3. Create a bundle group: * *Name:* `Test01 - Bundle Group` 4. Create a new user role: * *Permissions:* * *Name:* `Test01 - Bundle Deployer Role` * *Resource Permissions:* * *Inventory:* _Write_ * *Control:* _Write_ * *Create Child Resources:* _Write_ * *Bundle Permissions:* * *Create Bundle In Group:* _Yes_ * *Delete Bundle From Group:* _Yes_ * *Deploy Bundle To Group:* _Yes_ * *Resource Groups:* * *Assigned Resource Groups:* _DynaGroup - Groups by platform ( Linux )_ * *Bundle Groups:* * *Assigned Resource Groups:* _Test01 - Bundle Deployer Role_ 5. Create a new user: * *Username:* `TestUser01` * *Password:* `TestUser01` * *First Name:* `Test` * *Last Name:* `User01` * *Email Address:* `testuser01` * *Assigned Roles:* _Test01 - Bundle Deployer Role_ 6. Sign-in as _TestUser01_. 7. Create new bundle using _/tmp/large-bundle.zip_ and assign it to the _Test01 - Bundle Group_ bundle group. Actual results: Clicking _Next_ after adding _Test01 - Bundle Group_ to the assigned bundle group list results in a failure message being written at the bottom of the bundle creation dialog: [1434759019246] javax.ejb.EJBException:java.lang.IllegalArgumentException: Token did not result in valid file [/tmp/upload__2700a40a_14e0df9cb34__8000_00000014.tmp] -> java.lang.IllegalArgumentException:Token did not result in valid file [/tmp/upload__2700a40a_14e0df9cb34__8000_00000014.tmp] server.log also includes the error with a very long stack trace: INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/coregui]] (http-/0.0.0.0:7080-6) org.rhq.coregui.CoreGUI BundleDistributionFileUploadServlet: file was uploaded: large-bundle.zip ERROR [org.jboss.as.ejb3.invocation] (http-/0.0.0.0:7080-6) JBAS014134: EJB Invocation failed on component BundleManagerBean for method public abstract org.rhq.core.domain.bundle.BundleVersion org.rhq.enterprise.server.bundle.BundleManagerLocal.createInitialBundleVersionViaToken(org.rhq.core.domain.auth.Subject,int[],java.lang.String) throws java.lang.Exception: javax.ejb.EJBException: java.lang.IllegalArgumentException: Token did not result in valid file [/tmp/upload__2700a40a_14e0df9cb34__8000_00000014.tmp] at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInNoTx(CMTTxInterceptor.java:215) [jboss-as-ejb3-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19] at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:261) [jboss-as-ejb3-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19] ... at org.rhq.enterprise.server.bundle.BundleManagerLocal$$$view80.createInitialBundleVersionViaToken(Unknown Source) [rhq-server.jar:4.12.0.JON330GA] at org.rhq.coregui.server.gwt.BundleGWTServiceImpl.createInitialBundleVersionViaToken(BundleGWTServiceImpl.java:117) ... Caused by: java.lang.IllegalArgumentException: Token did not result in valid file [/tmp/upload__2700a40a_14e0df9cb34__8000_00000014.tmp] at org.rhq.enterprise.server.bundle.BundleManagerBean.createInitialBundleVersionViaToken(BundleManagerBean.java:2671) [rhq-server.jar:4.12.0.JON330GA] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_75] ... Expected results: The bundle should be successfully created and no error/warning is displayed or logged in server.log. Additional info: If the file is smaller, this error does not occur. This would lead me to believe that the issue has something to do with streaming the file/contents or some type of time interval that results in the temporary file being deleted. Also, this seems to be permission related. For example, rhqadmin is able to perform the exact same steps without any error. TestUser01 is also able to successfully create the bundle if the bundle is created using the recipe file instead of uploading the archive. In other words, instead of using the "upload" option on the first page of the bundle wizard you select "Recipe" and upload the deploy.xml, all works fine.
Actually, this does not seem to have anything to do with file size. Even a 15K bundle archive fails in the same manner.
It works as rhqadmin because the same method is not called - it would cause the same error in this case.
Right, the issue is in createBundle(BundleManagerBean:256), where we check for the user rights and check if they have the right to create a bundle or create a bundle for the group. However, selecting the group happens after the bundle has been uploaded.. so an empty list is sent to the method and it fails. I'll need to ask around a bit what has been the intention of this - I doubt this has ever worked.
Fixed in the master: commit d7d9c5b6f971b7d495a94ba9fbf1b2905a3c60ac Author: Michael Burman <miburman> Date: Tue Jul 14 11:44:00 2015 +0300 [BZ 1233991] Fix the viaToken method by fetching the file from correct temp-directory
Available for test with following build: https://brewweb.devel.redhat.com/buildinfo?buildID=448923 *Note: jon-server-patch-3.3.0.GA.zip maps to CR01 build of jon-server-3.3.0.GA-update-03.zip.
Verified on Version :3.3.0.GA Update 03 Build Number : edc324f:119e8f4 Followed the steps and verified that the bundle is created successfully by user 'TestUser01' without any error in UI or server.log. Please refer the attached screenshots.
Created attachment 1056659 [details] CreateBundle_SuccessMsg
Created attachment 1056660 [details] CreateBundle_Summary
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-1525.html