+++ This bug was initially created as a clone of Bug #840649 +++ Created attachment 598519 [details] An example repository package with a sha256 hash of 4e6fac41c12242f199a9aa82eab29e40b827e688da1f2210838545783137a5da Description of problem: Unable to upload content to a repository. Version-Release number of selected component (if applicable): 3.1.0 How reproducible: Always Steps to Reproduce: 1. Start JON system 2. Create a new **Repository** 1. Navigate to the **Administration** page 2. From the left navigation-tree, expand and select **Content / Repositories** 3. Select the **Create New** button 4. Set **Name** to `Test Repo` 5. Click **Save** 3. Upload whispirDeploy.js to new repository (**order is very important**): 1. Navigate to the **Administration** page 2. From the left navigation-tree, expand and select **Content / Repositories** 3. Click **Test Repo** 4. In the **Upload New Package** section, click the **Upload File...** button 5. Click the **Add...** button 6. Browse to and select the whispirDeploy.js file 7. Click the **Upload** button 8. In the **Upload New Package** section, set the following: * **Type** **Server-side CLI Script** 9. Click the **Create Package** button Actual results: Failed to create package [mypackage.js] in repository. Cause: javax.ejb.EJBException:org.rhq.enterprise.server.plugin.pc.content.PackageDetailsValidationException: The version part of '[sha256=4e6fac41c12242f199a9aa82eab29e40b827e688da1f2210838545783137a5da]' isn't an OSGi version string. Expected results: Package content should be uploaded and appear in the **Packages** section of the page. Additional info: The order of the steps is very important. The issue only occurs if you upload the file first. On the other hand, if you set the **Name** and **Type** fields prior to uploading the new package, the error does not occur. The issue appears to deal with how default values are derived from the actual uploading of the package file. Perhaps version can't be determined from the package file and therefore, it is set to a default value that does not reflect the value entered or displayed in the UI?
*** Bug 794768 has been marked as a duplicate of this bug. ***
From #RHQ (10:45:09 AM) krumer: There is a workaround, I can upload CLI scripts as "Alpha Content 0" and I can still include them, but they don't show up as CLI scripts
> From #RHQ > > (10:45:09 AM) krumer: There is a workaround, I can upload CLI scripts as > "Alpha Content 0" and I can still include them, but they don't show up as > CLI scripts Note that the script uploaded as such cannot be directly used as a CLI script, because the UI won't list it.(In reply to comment #2) The only way to upload a CLI Script usable as an alert notification is to use the CLI Script alert notification dialog to perform the upload. What krumer offers as a workaround really isn't. Files uploaded as other file types can be used by other techniques such as the require function available in other scripts. Thus, if you already have a cli script, you can include another script into it using "require('rhq://repositories/blah/other-script.js')" and you can upload the "other-script.js" into the "blah" repository as "Alpha Content 0" and it will still be usable in your script. But your CLI script still has to be uploaded from the "CLI Script" alert notification creation page. It is not possible to upload a file of type "Server-side CLI Script" from the Administration->Repositories page.
in master (RHQ 4.9.0-SNAPSHOT) commit 3502050af25d2a11f4fc2c7aaf1ea8b64436e266 Author: Lukas Krejci <lkrejci> Date: Fri Jun 28 15:39:51 2013 +0200 [BZ 840649] Accomodate for package type plugins when determining pkg version This is mostly a hack to get us going again on the JSF repository detail page. I don't want to invest into some more elaborate and complete solution because content subsystem is a minefield we're hopefully replacing soon(ish).