Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24.6.x gradle build : PWA icons generation failed #20842

Open
dominik42 opened this issue Jan 14, 2025 · 10 comments
Open

24.6.x gradle build : PWA icons generation failed #20842

dominik42 opened this issue Jan 14, 2025 · 10 comments
Labels

Comments

@dominik42
Copy link

dominik42 commented Jan 14, 2025

Description of the bug

Hi,

if I update my gradle based app from 24.5.8 to 24.6.x, the gradle build failed with the error

com.vaadin.flow.server.ExecutionFailedException: PWA icons generation failed

As default, my main application class (the one annotated with @SpringBootAppplication and @PWA) does not define the iconPath as parameter for the @PWA annotation. Only if I

  • create an icon.png
  • put the file under src/main/resources/META-INF/resources/icons/icon.png
  • edit the PWA annotation into @PWA(name = "myApp" shortName = "myShortname" iconPath = "icons/icon.png")

the gradle build finished sucessfully.

Expected behavior

Also without declaring an iconPath explicetely, the build should finished successfully, as in prior vaadin flow versions as mentioned in https://vaadin.com/docs/latest/flow/configuration/pwa#icons

Minimal reproducible example

build.gradle:

plugins {
    id 'com.vaadin' version '24.6.0'
    id 'org.springframework.boot' version '3.4.1'
    id 'io.spring.dependency-management' version '1.1.6'
    id 'java'
}

group = 'war'
version = '0.0.7'
description = """IconTest"""

java {
    sourceCompatibility = 21
    targetCompatibility = 21
}

vaadin {
   productionMode = true
}

jar {
    enabled = false
    archiveClassifier = 'IconText'
}

repositories {
    //mavenLocal()
    mavenCentral()
    maven { url = "https://maven.vaadin.com/vaadin-addons" }
}

configurations {
    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
}

dependencies {
    implementation 'com.vaadin:vaadin-spring-boot-starter'
}

dependencyManagement {
    imports {
        mavenBom "com.vaadin:vaadin-bom:24.6.0"
    }
}

src/main/java/de/test/MyApp.java


package de.test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

import com.vaadin.flow.component.dependency.NpmPackage;
import com.vaadin.flow.component.page.AppShellConfigurator;
import com.vaadin.flow.component.page.Push;
import com.vaadin.flow.server.PWA;
import com.vaadin.flow.theme.Theme;


@SpringBootApplication
@PWA(name = "MyApp", shortName = "myApp")
public class MyApp extends SpringBootServletInitializer implements AppShellConfigurator {

    public static void main(String[] args) {
        SpringApplication.run(MyApp.class, args);
    }


}
  • copy .gradlew and gradle directory from an existing gradle project

build with gradle: ./gradlew -Pvaadin.productionMode=true bootJar

Versions

  • Vaadin / Flow version: 24.6.1
  • Java version: 21
  • OS version: MacOS 15.2 (Sequoia)
  • Browser version (if applicable):
  • Application Server (if applicable):
  • IDE (if applicable):
@mcollovati
Copy link
Collaborator

Thanks for reporting. Could you please provide the complete exception stack trace?

@dominik42
Copy link
Author

dominik42 commented Jan 14, 2025

> Task :vaadinBuildFrontend FAILED
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':vaadinBuildFrontend'.
> com.vaadin.flow.server.ExecutionFailedException: PWA icons generation failed

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.11.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 7s
5 actionable tasks: 4 executed, 1 up-to-date

@mcollovati
Copy link
Collaborator

mcollovati commented Jan 14, 2025

If you run with --stacktrace, --info or --debug you should also get the stack trace of the ExecutionFailedException

@dominik42
Copy link
Author

2025-01-14T15:47:23.824+0100 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :vaadinBuildFrontend FAILED
2025-01-14T15:47:23.843+0100 [DEBUG] [com.vaadin.flow.server.frontend.TaskUpdatePackages] Added 9 dependencies to main package.json
2025-01-14T15:47:23.844+0100 [DEBUG] [com.vaadin.flow.server.frontend.VersionsJsonConverter] versions.json adds dependency @vaadin/bundles with version 24.6.0
2025-01-14T15:47:23.844+0100 [DEBUG] [com.vaadin.flow.server.frontend.VersionsJsonConverter] versions.json adds dependency @vaadin/polymer-legacy-adapter with version 24.6.0
2025-01-14T15:47:23.844+0100 [DEBUG] [com.vaadin.flow.server.frontend.VersionsJsonConverter] versions.json adds dependency @vaadin/vaadin-development-mode-detector with version 2.0.7
2025-01-14T15:47:23.844+0100 [DEBUG] [com.vaadin.flow.server.frontend.VersionsJsonConverter] versions.json adds dependency @vaadin/vaadin-usage-statistics with version 2.1.3
2025-01-14T15:47:23.844+0100 [DEBUG] [com.vaadin.flow.server.frontend.VersionsJsonConverter] versions.json adds dependency @vaadin/react-components with version 24.6.0 for mode react
2025-01-14T15:47:23.845+0100 [INFO] [com.vaadin.flow.server.frontend.TaskCopyFrontendFiles] Copying frontend resources from jar files ...
2025-01-14T15:47:23.904+0100 [INFO] [com.vaadin.flow.server.frontend.TaskCopyFrontendFiles] Visited 179 resources. Took 58 ms.
2025-01-14T15:47:23.904+0100 [DEBUG] [com.vaadin.flow.server.frontend.TaskCopyLocalFrontendFiles] Found no local frontend resources for the project
2025-01-14T15:47:23.905+0100 [DEBUG] [com.vaadin.flow.server.frontend.TaskGeneratePWAIcons] Generating PWA icons from 'icons/icon.png'
2025-01-14T15:47:24.283+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Execute vaadinBuildFrontend for :vaadinBuildFrontend' completed
2025-01-14T15:47:24.283+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Executing task ':vaadinBuildFrontend'' completed
2025-01-14T15:47:24.283+0100 [DEBUG] [org.gradle.internal.vfs.impl.AbstractVirtualFileSystem] Invalidating VFS paths: []
2025-01-14T15:47:24.283+0100 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for task ':vaadinBuildFrontend' from context.
2025-01-14T15:47:24.283+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Task :vaadinBuildFrontend'
2025-01-14T15:47:24.283+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Task :vaadinBuildFrontend' completed
2025-01-14T15:47:24.283+0100 [DEBUG] [org.gradle.execution.plan.DefaultFinalizedExecutionPlan] Node :vaadinBuildFrontend completed, executed: true
2025-01-14T15:47:24.283+0100 [DEBUG] [org.gradle.execution.plan.DefaultFinalizedExecutionPlan] Node :vaadinBuildFrontend failed
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.execution.plan.DefaultFinalizedExecutionPlan] Node Resolve mutations for :resolveMainClassName completed, executed: false
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.execution.plan.DefaultFinalizedExecutionPlan] Node :resolveMainClassName completed, executed: false
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.execution.plan.DefaultFinalizedExecutionPlan] Node :bootJar completed, executed: false
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.execution.plan.DefaultFinalizedExecutionPlan] Node Resolve mutations for :bootJar completed, executed: false
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on state of build :
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on task execution for build :
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 6: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 6: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] included builds: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Run tasks'
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Run tasks' completed
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] included builds: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 25: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Run main tasks'
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Run main tasks' completed
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 8: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 2: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 3: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 9: released lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: acquired lock on worker lease
2025-01-14T15:47:24.284+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 4: released lock on worker lease
2025-01-14T15:47:24.285+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: acquired lock on worker lease
2025-01-14T15:47:24.285+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 5: released lock on worker lease
2025-01-14T15:47:24.285+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: acquired lock on worker lease
2025-01-14T15:47:24.285+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 7: released lock on worker lease
2025-01-14T15:47:24.285+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 6: acquired lock on worker lease
2025-01-14T15:47:24.285+0100 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker Thread 6: released lock on worker lease
2025-01-14T15:47:24.285+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Finish root build tree' started
2025-01-14T15:47:24.286+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Finish root build tree'
2025-01-14T15:47:24.286+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Finish root build tree' completed
2025-01-14T15:47:24.286+0100 [WARN] [org.gradle.problems.internal.impl.DefaultProblemsReportCreator] [Incubating] Problems report is available at: file:///Users/Dominik/temp/iconTest/build/reports/problems/problems-report.html
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':vaadinBuildFrontend'.
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > com.vaadin.flow.server.ExecutionFailedException: PWA icons generation failed
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --stacktrace option to get the stack trace.
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --scan to get full insights.
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Get more help at https://help.gradle.org.
2025-01-14T15:47:24.287+0100 [WARN] [org.gradle.internal.featurelifecycle.LoggingDeprecatedFeatureHandler]
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.11.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
2025-01-14T15:47:24.287+0100 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 6s

@mcollovati
Copy link
Collaborator

Unfortunately, it does not help that much.
I tested with the base Spring Gradle starter but I could not reproduce the issue.

@mcollovati
Copy link
Collaborator

I tried also with the provided example code, but still cannot reproduce

@mcollovati
Copy link
Collaborator

I was able to reproduce the failure but only after deletion of gradle caches (rm -r ~/.gradle/caches).
The root cause is an OutOfMemoryError while generating the PWA icons (used --stack-trace gradle flag)

Build failure
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':vaadinBuildFrontend'.
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:130)
     at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:128)
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:116)
     at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
     at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
     at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
     at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
     at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
     at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
     at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
     at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
     at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
     at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
     at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
     at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
     at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
     at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
     at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
     at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: org.gradle.internal.UncheckedException: com.vaadin.flow.server.ExecutionFailedException: PWA icons generation failed
     at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:68)
     at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
     at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:128)
     at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
     at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
     at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
     at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:244)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
     at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
     at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:229)
     at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:212)
     at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:195)
     at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:162)
     at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
     at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
     at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
     at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
     at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
     at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56)
     at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
     at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
     at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
     at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
     at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:50)
     at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:28)
     at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
     at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
     at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:61)
     at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:26)
     at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:67)
     at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:45)
     at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
     at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
     at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:189)
     at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:75)
     at org.gradle.internal.Either$Right.fold(Either.java:175)
     at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:62)
     at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73)
     at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48)
     at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:46)
     at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:35)
     at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:76)
     at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:54)
     at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
     at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
     at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
     at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
     at org.gradle.internal.execution.steps.ResolveIncrementalCachingStateStep.executeDelegate(ResolveIncrementalCachingStateStep.java:49)
     at org.gradle.internal.execution.steps.ResolveIncrementalCachingStateStep.executeDelegate(ResolveIncrementalCachingStateStep.java:27)
     at org.gradle.internal.execution.steps.AbstractResolveCachingStateStep.execute(AbstractResolveCachingStateStep.java:71)
     at org.gradle.internal.execution.steps.AbstractResolveCachingStateStep.execute(AbstractResolveCachingStateStep.java:39)
     at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
     at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
     at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106)
     at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:55)
     at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:64)
     at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:43)
     at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.executeWithNonEmptySources(AbstractSkipEmptyWorkStep.java:125)
     at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:56)
     at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:36)
     at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
     at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
     at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
     at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:75)
     at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:41)
     at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.lambda$execute$0(AssignMutableWorkspaceStep.java:35)
     at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:289)
     at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:31)
     at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:22)
     at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:40)
     at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:23)
     at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:67)
     at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:67)
     at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:39)
     at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:46)
     at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:34)
     at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:48)
     at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:35)
     at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:61)
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:127)
     at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:116)
     at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
     at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
     at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
     at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
     at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
     at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
     at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
     at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
     at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
     at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
     at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
     at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
     at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
     at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
     at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
     at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
     at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
     at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
     at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: com.vaadin.flow.server.ExecutionFailedException: PWA icons generation failed
     at com.vaadin.flow.server.frontend.TaskGeneratePWAIcons.execute(TaskGeneratePWAIcons.java:109)
     at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:347)
     at com.vaadin.flow.plugin.base.BuildFrontendUtil.runNodeUpdater(BuildFrontendUtil.java:364)
     at com.vaadin.gradle.VaadinBuildFrontendTask.vaadinBuildFrontend(VaadinBuildFrontendTask.kt:78)
     at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
     at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
     ... 119 more
Caused by: java.lang.OutOfMemoryError: Java heap space
     at com.vaadin.flow.server.PwaIcon.drawIconImage(PwaIcon.java:301)
     at com.vaadin.flow.server.PwaIcon.write(PwaIcon.java:279)
     at com.vaadin.flow.server.frontend.TaskGeneratePWAIcons.lambda$generateIcon$2(TaskGeneratePWAIcons.java:178)
     at com.vaadin.flow.server.frontend.TaskGeneratePWAIcons$$Lambda/0x00007e3740d90fe8.run(Unknown Source)

I could make it work by adding org.gradle.jvmargs=-Xmx512M to gradle.properties.
However, this is a bit weird because Gradle documentation states that this is the default value.
Also, if I re-run the build after a failure, it completes and generates all the icons.

@mcollovati
Copy link
Collaborator

Icon generation is done in parallel, using common ForkJoin pool.
I did a quick test using a fixed thread pool of 4 threads and it seems the OOM does not occur anymore.

@mcollovati
Copy link
Collaborator

@dominik42 can you drop gradle caches and run /gradlew clean build -Pvaadin.productionMode --no-build-cache --no-daemon --stacktrace to confirm your also get the OOM?

@dominik42
Copy link
Author

I can confirm the OOM Exception if run with --stacktrace
After drop the gradle cache by rm -r ~/.gradle/caches the command

./gradlew clean build -Pvaadin.productionMode --no-build-cache --no-daemon --stacktrace

runs successfully. After omit the --no-build-cache --no-daemon --stacktrace and runs only the

./gradlew clean build -Pvaadin.productionMode

the error occured again.

My versions:


❯ ./gradlew --version

------------------------------------------------------------
Gradle 8.11.1
------------------------------------------------------------

Build time:    2024-11-20 16:56:46 UTC
Revision:      481cb05a490e0ef9f8620f7873b83bd8a72e7c39

Kotlin:        2.0.20
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM:  21 (Oracle Corporation 21+35-2513)
Daemon JVM:    /Users/Dominik/.sdkman/candidates/java/21-open (no JDK specified, using current Java home)
OS:            Mac OS X 15.2 aarch64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants