5 Replies Latest reply on Mar 5, 2013 10:45 AM by Clement BARRET

    Import of exported job gives "group not found" error

      Hi All,

       

      I have two Blade Logic servers of version 8.1.02.233.

      One is used for R&D and the other is a Production server.

       

      I'm trying to copy all the objects from the R&D server to the Production.

       

      I'm running a loop with the command:

      blcli_execute ImportExport, exportObject, $jobType, $jobDBKey, $targetExportPath

       

      This produces directories that I can import on the production server.

       

      When I import a folder manually through the Console, everything works fine.

       

      When I try using the command:

      blcli_execute ImportExport importObject $targetExportPath

       

      I get the following error:

       

      Command execution failed. com.bladelogic.om.infra.mfw.util.BlAppServerException: Imported object is not valid. 2 errors found.

      Error[1]: Could not find containing group for an object defined in the imported object.  Object name was : Create Service Stub Version 2.0.0.45453.
      Object DBKey was : DBKey:SJobKeyImpl:2588-1. Cause: group 2000541 not found

      Error[2]: Could not find containing group for an object defined in the imported object.  Object name was : Create Service Stub Version 2.0.0.45453.
      Object DBKey was : DBKey:SDepotObjectKeyImpl:835-1. Cause: group 2000540 not found

       

      The Job "Create Service Stub Version 2.0.0.45453" contains a Deploy Job with its BLPackage.

      The parent Job and Depot groups of these objects already exists.

      anyone has an idea what I'm doing wrong?

      Thanks,

      Eyal

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

        • 1. Import of exported job gives "group not found" error
          Joshua Skirde

          Hi Eyal,

           

          If you look in your exported directory you should see a mapping file. There is a blcli import command that uses this to resolve dependencies (such as your missing job group).

          Try:

          blcli_execute ImportExport importObject $targetExportPath ${targetExportPath}/mapping.xml

           

          Good luck,

          Joshua

          1 of 1 people found this helpful
          • 2. Re: Import of exported job gives "group not found" error

            Hi Joshua

            Thanks for the lightening fast reply!

             

            I looked at the mapping.xml file and found this structure:

             

             

            <grouped_object_mapping>
             <source_object>
              <object_type>BLPACKAGE</object_type>
              <object_name>Create Service Stub Version 2.0.0.45453</object_name>
              <group_id>2000540</group_id>
             </source_object>
             <!--This is the path to the group into which the object will be imported-->
             <containing_group>/RND/Prizma/BSS/Clean_Install/Ver 2.0.0.45453</containing_group>
            </grouped_object_mapping>
            
            

             

            The "containing_group" tag is pointing to the right direction.
            The "group_id" tag, however, holds a key of the Depot folder.
            I think this key is relevant to the source server but not to the target server.
            (The ID of the folders is different between the servers)

            I think the import command uses the "group_id" key to find the folder (instead of the "containing_group").

             

            If this is true, I think I'll have to write a script to parse and edit the mapping.xml file.

            Thanks,
            Eyal

            • 3. Re: Import of exported job gives "group not found" error
              Clement BARRET

              Hi,

               

              I have the same problem...

               

              I created an empty BlPackage on my SOURCE BL infrastrucure (7.6), then I exported it :

               

              blcli_execute ImportExport exportObject_api $OTYPE "$ODBKEY" "$DATA_DIR/$ONAMESPACE/${OPATH#/}/$ONAME" "${EXPOPTS[@]}"

               

              (with EXPOPTS being either some true true true...  false false true true true...) or the oppopsite (flags))

              NB : The same occurs without the flags (using the default flags then)

               

              I moved the created directory to the TARGET BL infrastructure (same 7.6 version).

               

              When I try to import :

               

              blcli_execute ImportExport importObject_api $object_path

              Command execution failed. com.bladelogic.mfw.util.BlAppServerException: Imported object is not valid. 1 errors found.

              Error[1]: Could not find containing group for an object defined in the imported object.  Object name was : youpi.properties. Object DBKey was : DBKey:SDepotObjectKey:2034534-1. Cause: group 2772060 not found

               

              Then I do the magical :

               

              blcli_execute DepotGroup groupNameToDBKey /youpi;

               

              blcli_execute DepotGroup getGroupId

               

              blcli_storeenv GROUP_ID;

               

              I modified the "group_id" line of the mapping.xml file from the exported directory :

               


              <grouped_object_mapping>
                  <source_object>
                      <object_type>BLPACKAGE</object_type>
                      <object_name>youpi</object_name>
                      <group_id>2772060</group_id>
                  </source_object>
                  <!--This is the path to the group into which the object will be imported-->
                  <containing_group>/youpi</containing_group>

              </grouped_object_mapping>

               

              using the given GROUP_ID (of the target directory of the TARGET BL infrastructure)

               

              and now I got this error :

               

              blcli_execute ImportExport importObject_api $object_path $mapping_file

              Command execution failed. com.bladelogic.mfw.util.BlException: com.bladelogic.mfw.util.NotFoundException: no child of name 4 found

               

              ...

               

              Obviously, without any modification I can import the object manually but I'd rather use the full "importObject" syntax to be able to set the "create directory" flag to true after passing the mapping file...

               

              The fact is I NEED to be able to import the exported object using blcli... because I have like 200 application packages to re-import which all includes several objects... Doing this manually would just be insane...

               

              Please help...

              • 4. Re: Import of exported job gives "group not found" error
                Bill Robinson

                i think you've solved your problem already though - you need to write a script to process the mapping file for the target group, get the new group id in the new environment and then update the mapping file and run the blcli command. this should be fairly straightforward.

                • 5. Re: Import of exported job gives "group not found" error
                  Clement BARRET

                  Hi Bill,

                   

                  Well, that would be a "solution" if only that was working, and as I already told, I got another error once I've updated the group Id with the "new" one (manually created group...).

                   

                  My goal is to be able to re-import "objects" without having to recreate their groups (whatever namespace they're imported in, like Depot, Jobs etc.).

                   

                  So, this is not a solution at all (plus I found it really weird the guys who designed this method used a groupid to "locate" the folder they're supposed to re-import the object into knowing that it never will be the same on another bladelogic platform...). I duno if this is fixed in newer versions (I'm using 7.6, we'll be using 8.2 after that later in the year) but this behaviour is quite unusable as is...

                   

                  Do you know any way to make this work ?

                   

                  Regards.