Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9313

Content Package Installer: do not return an InstallTask if the TaskResource is of an unsupported type

    XMLWordPrintableJSON

    Details

      Description

      The org.apache.sling.installer.factory.packages.impl.PackageTransformer#createTask currently returns a ChangeStateTask for resources that it cannot handle [0]. According to the documentation of the org.apache.sling.installer.api.tasks.InstallTaskFactory, a factory should return null "if the factory does not support the resource".

      The following error is encountered in the HTL integration tests setup from https://github.com/apache/sling-org-apache-sling-scripting-sightly-testing:

      31.03.2020 16:15:14.833 *ERROR* [OsgiInstallerImpl] org.apache.sling.installer.factory.packages.impl.PackageTransformer Unupported type of TaskResource(url=jcrinstall:/apps/sightly/install/org.apache.sling.scripting.sightly.testing-content-crlf.jar, entity=bundle:org.apache.sling.scripting.sightly.testing-content-crlf, state=INSTALL, attributes=[org.apache.sling.installer.api.tasks.ResourceTransformer=:448:611:9:, Bundle-SymbolicName=org.apache.sling.scripting.sightly.testing-content-crlf, Bundle-Version=1.0.0], digest=1585265891708): bundle.
      

      Several tests are failing, since the above bundle doesn't get installed. The error cannot be reproduced all the time, suggesting that the order in which the org.apache.sling.installer.api.tasks.InstallTaskFactory services are started plays a role.

      [0] - https://github.com/apache/sling-org-apache-sling-installer-factory-packages/blob/org.apache.sling.installer.factory.packages-1.0.0/src/main/java/org/apache/sling/installer/factory/packages/impl/PackageTransformer.java#L241

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kwin Konrad Windszus
                Reporter:
                radu Radu Cotescu
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h