Builds are failing in CCV2 because of changes in the builder logic

From yesterday(15.09.2022) our builds in CCv2 are failing because of recent changes from SAP in the builder logic. Error:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "charSequence" is null
at de.hybris.ccv2.image.hash.generator.HashGeneratorUtils.getHashForString(
at de.hybris.ccv2.image.hash.generator.DockerImageHashGenerator.getBaseImageHash(
at de.hybris.ccv2.image.hash.generator.JsAppsImagesHashGenerator.putImageSpecificHashData(
at de.hybris.ccv2.image.hash.generator.DockerImageHashGenerator.generateHash(
at de.hybris.ccv2.image.ProjectDockerImage.generateHashCode(
at de.hybris.ccv2.image.ProjectDockerImage.getHash(
at de.hybris.ccv2.image.ProjectDockerImage.isAvailableInTargetRegistry(
at de.hybris.ccv2.task.EvaluateServicesAndImagesTask.printImagesInfo(
at de.hybris.ccv2.task.EvaluateServicesAndImagesTask.process(
at de.hybris.ccv2.Builder.runTask(
at de.hybris.ccv2.Builder.lambda$runTasks$5(
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(
at java.base/$Head.forEach(
at de.hybris.ccv2.Builder.runTasks(
at de.hybris.ccv2.Builder.main(

One possible workaround for the Storefronts which are based on Spartacus from SAP is:

To enable SSR as described on:

Enabling SSR can affect the running system, so it’s not a quick change, it requires testing on lower environments, too.

As our storefront is based on React.js this workaround was not applicable for us. So, there is a second workaround:

Disabling hashing mechanism used by CCv2 to speed up build process.

Adding in js-storefront manifest.json:

{  "disableImageReuse": true,  "applications": [  {    "name": "app",    "path": "app"   }  ]}

Builds can take longer after this change, because the image is always generated, even if exactly the same image was generated formerly.

I hope this will help others who face the same build issues.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store