vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
868 stars 58 forks source link

[PT-PiT 24.4] Whitelabel error page - Hilla runner fails #2336

Open gtzluis opened 2 months ago

gtzluis commented 2 months ago

Describe the bug

Application fails to run > It seems the Hilla runner fails to find mvn in the project

Artur attempted to debug it, but we couldn't fix it

hilla project failed log.txt hilla project failed log & Artur debug attempt.txt

Please let me know if I'm doing something wrong :)

Expected-behavior

No response

Reproduction

I downloaded a project from start.vaadin.com containing a Hilla + React view > changed version to 24.4.0.alpha22 > tried to run the application using VS Code.

System Info

Windows 11, Vaadin 24.4.0.alpha22, Chrome Version 123.0.6312.123 (Official Build) (64-bit)

platosha commented 2 months ago

Thanks.

Do you have Maven installed in your system? You can try by typing mvn on the command line.

Also, could try if it reproduces with the latest stable Hilla 2.5?

ZheSun88 commented 2 months ago

i tried to download an app

open start.vaadin.com
click `start a project`
click `Add the first view to your application`
click `Hilla(React)` -> ‘Hello World’ -> 'Add view'
click `download Project`

unzip the folder
run `mvn`

the version here is alpha24, there is no issue. downgrade to alpha22, issue with could not navigate to ''

windows machine.

Artur- commented 2 months ago

The original project was in a folder named something with space and (parenthesis) like my-app (2), if it matters

ZheSun88 commented 2 months ago

my folder is my-app (13) , so i guess that is not the issue.

marcushellberg commented 2 months ago

I happened to run into the same while recording a video, so here are my steps to reproduce.

Not shown in the video: updating vaadin.version to 24.4.0.beta1 and adding pre-release repo to pom.xml.

I have mvn in my path, and the downloaded project includes mvnw.

https://github.com/vaadin/hilla/assets/883698/99f09247-0553-4278-a2c0-d9c27d6ba278

ZheSun88 commented 2 months ago

oh, you downloaded the app from start.spring.io, i guess that is probably the reason. i will try locally

mcollovati commented 2 months ago

@ZheSun88 probably not related, but I got an error with Hilla internal Maven calls with a reproducer project you attached to a GH issue; basically the mvnw had windows EOL, and it was unable to run, until I converted them.

ZheSun88 commented 2 months ago

aww, i downloaded the app locally and upgraded things based on the video. using ./mvnw i got error in the image.. (as there is no <defaultGoal>spring-boot:run</defaultGoal> in the pom.xml ) then i tried to mvn spring-boot:run , app is working.. image image

mcollovati commented 2 months ago

@marcushellberg can you please set logging.level.com.vaadin.hilla.engine.commandrunner=DEBUG in the application properties and check in the server logs if there is additional information printed by the Hilla command runners?

manolo commented 2 months ago

I tried the same steps and cannot reproduce in my mac, I'm using java 21 but didnt change the java.version in the pom file, and also used the JavaApplication.java play button for start the application in vscode. Seems some specific local setup

manolo commented 2 months ago

@marcushellberg does it happens always? I mean each time you stop and start the application, or only once at the beginning?

mcollovati commented 2 months ago

@marcushellberg did you add to the pom the Vaadin pre-releases both as <repository> and <pluginRepository>?

manolo commented 2 months ago

The only way I have managed to reproduce it is by removing the following block from the pom.xml file and removing the folder ~/.m2/repository/com/vaadin/vaadin-maven-plugin/24.4.0.beta1/

   <pluginRepositories>
       <pluginRepository>
           <id>vaadin-prereleases</id>
           <url>https://maven.vaadin.com/vaadin-prereleases</url>
       </pluginRepository>
   </pluginRepositories>

Then the app works, and at some point endpoint generator tries to run mvn -q com.vaadin:vaadin-maven-plugin:generate displaying the following error in console.

com.vaadin.flow.server.ExecutionFailedException: Failed to configure Hilla engine: no runner succeeded. Set log level to debug to see more details.
    at com.vaadin.hilla.internal.AbstractTaskEndpointGenerator.prepareEngineConfiguration(AbstractTaskEndpointGenerator.java:122) ~[hilla-engine-runtime-24.4.0.beta1.jar:na]

Code executing this action is here

So the problem is that hilla cannot run correctly the tasks for generating frontend stuff if the plugin cannot be downloaded.

Note that it only happens with pre-releases, because in the case of releases deployed in maven central, the plugin artifact would be downloaded.

Not sure if there is a way for fixing this, maybe a better message in console, or stoping the servlet container.

manolo commented 2 months ago

So in summary, in both cases the mvn vaadin:configure was not executed correctly @gtzluis logs happen in the same code line, perhaps some problem with mvn in local, and in the case of @marcushellberg perhaps he forgot to add the plugin repository.

platosha commented 1 month ago

It would probably help to have a more descriptive error message when mvn vaadin:configure fails. Let's address the error message in the scope of this ticket.