Bug 840650 - Upload of package content to repository fails due to .PackageDetailsValidationException: The version part of '[sha256=<sha256 hash>]' isn't an OSGi version string.
Summary: Upload of package content to repository fails due to .PackageDetailsValidatio...
Keywords:
Status: ON_QA
Alias: None
Product: RHQ Project
Classification: Other
Component: Content
Version: 4.4
Hardware: All
OS: All
medium
high
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 796381 840649 852145
TreeView+ depends on / blocked
 
Reported: 2012-07-16 19:50 UTC by Larry O'Leary
Modified: 2022-03-31 04:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 840649
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Larry O'Leary 2012-07-16 19:50:25 UTC
+++ 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?

Comment 1 Larry O'Leary 2012-11-27 20:20:10 UTC
*** Bug 794768 has been marked as a duplicate of this bug. ***

Comment 2 Jay Shaughnessy 2013-05-02 15:11:23 UTC
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

Comment 3 Lukas Krejci 2013-05-02 16:25:45 UTC
> 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.

Comment 4 Lukas Krejci 2013-06-28 14:25:01 UTC
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).


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