Build hangs on vaadin-maven-plugin execution

I’m trying to build a project using npm mode and the latest release candidate for Vaadin 14. Each time my build reaches the vaadin-maven-plugin, it halts for several minutes at this line:
[INFO]
— vaadin-maven-plugin:14.0.0.rc5:prepare-frontend (default) @ my-starter-project —

As you can see from the attached log, the build of the starter project therefore takes 15 minutes and 12 seconds on a really well equipped dev machine. The only thing i changed after downloading a fresh plain Java starter is to upgrade the version to RC5 from RC4. Any ideas on how to fix that?
17779817.log (12.2 KB)

Check if there were other differences between the poms of rc4 and rc5.

There are none. I just changed that one single char. The same happens with RC4 by the way.

Lukasz Kubik:
There are none. I just changed that one single char. The same happens with RC4 by the way.

I see. What I can say is that I also have a hobby project in which I used both rc4 and rc5, and they both work. My guess is that the problem is outside the pom or the code. Things that I would try:

-Download a brand new rc5 starter projects and see if they are slow as well

-if yes, then clean up maven home directory. eg. exit IDE and then in c:\user\youruser\.m2 check if there’s something unusual in settings.xml, delete the contents of repository folder (then you have to re-download dependencies of each project).

-try all these with a new installation of your IDE

-reinstall or install another instance of maven

–T.

Thomas Mx:

Lukasz Kubik:
There are none. I just changed that one single char. The same happens with RC4 by the way.

I see. What I can say is that I also have a hobby project in which I used both rc4 and rc5, and they both work. My guess is that the problem is outside the pom or the code. Things that I would try:

-Download a brand new rc5 starter projects and see if they are slow as well

-if yes, then clean up maven home directory. eg. exit IDE and then in c:\user\youruser\.m2 check if there’s something unusual in settings.xml, delete the contents of repository folder (then you have to re-download dependencies of each project).

-try all these with a new installation of your IDE

-reinstall or install another instance of maven

–T.

I should have mentioned what I already tried :slight_smile: I did try to build from console, so it is no IDE involvement that causes the build to stall. I also tried to clear my local Maven repo, also to no avail. Right now I tried RC6, which also does not build without stalling.
What I didn’t try was reinstalling Maven, thank you for the hint! Unfortunately, this didn’t help either. Since I don’t have other ideas, I will have to live with that behaviour.
Nevertheless, thank you for trying to help!

as a last guess, temporarily disable Antivirus live protection ? or move your project elsewhere, other partition even perhaps. if it is in a directory that is being synchronized like Dropbox or Google drive, or other virtual directory, it could impede the building process.

Unfortunately the domain policy of my company does not allow me to disable the AV or add exclude folders. Following you suggestion, I moved the source, the Maven installation and the local repo to another partition, but it still did not help. Well, guess I’ll have to live with that problem for now.

Nevertheless, thank you for your continued support, much appreciated!

I have exactly the same problem today. The project was last built a couple of hours ago. Now(!) it stopped building. If I keep killing node processes, the build continues to a working .war.

The killing process is:

prepare-frontend starts.
-> Kill node until the build process continues (three times).
npm install starts.
-> Kill node until a node process consumes cpu time.

It is ridiculous.

If you give me a pointer I’ll be glad to help debugging.

BTW, I use rc7 and disabled the antivirus.

I have exactly the same problem today. The project was last built a couple of hours ago. Now(!) it stopped building. If I keep killing node processes, the build continues to a working .war.

The killing process is:

prepare-frontend starts.
-> Kill node until the build process continues (three times).
npm install starts.
-> Kill node until a node process consumes cpu time.

It is ridiculous.

If you give me a pointer I’ll be glad to help debugging.

BTW, I use rc7 and disabled the antivirus.

The undesired behaviour occurs on Windows 10, building on a Debain-machine works.

I am having the same issue with vaadin-maven-plugin 14.0.1 and NodeJS 10.16.3 - I have to repeatedly (2-3 times) kill node.exe in TaskManager or via taskkill.exe to get maven to proceed beyond “prepare-frontend”. This is for the “hello world” example and building on the command line in Windows 7 or Windows 10. It also does not matter if I use cmd.exe or Powershell or if I have admin rights or not - build does not work in any case.

As I am currently evaluating the use of Vaadin for our next project, I hope there is a fix for this so I can continue my evaluation.

Kind regards,
Stefan

Hi Stefan!

Do you use a proxy server to connect to the internet?

OP here - yeah, I do. I kind of suspected that the Vaadin Maven Plugin somehow causes NPM to ignore its own config file and therefore also the proxy, but I can’t know for sure since the code isn’t open source.

Lukasz Kubik:
OP here - yeah, I do. I kind of suspected that the Vaadin Maven Plugin somehow causes NPM to ignore its own config file and therefore also the proxy, but I can’t know for sure since the code isn’t open source.

It is open source: https://github.com/vaadin/flow/tree/master/flow-maven-plugin

Note: https://github.com/vaadin/platform/tree/master/vaadin-maven-plugin has vaadin-maven-plugin, but it’s a direct copy of flow-maven-plugin

I made a ticket for this:
https://github.com/vaadin/flow/issues/6181

Sorry for not answering sooner, but I did some more tests: Windows10 / NodeJS 10.16.3 / Vaadin 14 does work fast without a proxy: ‘mvn jetty:run’ from the HelloWorld example takes about 15 seconds to startup which is pretty nice. Behind a proxy before it took around 6 minutes, now it also works fast (15-20 seconds). I don’t know what changed other than I restarted the machine.

Windows 7 I cannot test without a proxy unfortunately. I tried with NodeJS 10.16.3 and also with NodeJS 12.9.1 - no difference. The startup process eventually continues and finishes without having to kill node.exe but it takes around 9 - 10 minutes. That is for repeated starts without any downloads needed or so.

I strongly suspect a timeout issue or proxy settings being overwritten during the maven build process because the system is idle otherwise: no CPU load, no network load, no memory allocations above what I would call “background noise”.

I can continue my evaluation on Windows 10 but would still be interested in a quickfix for Windows 7 as we are required to continue using it in the company until 2021 due to some legal regulations.

Nevermind, I figured it out. :slight_smile:

To run behind a proxy, one has to set an environment variable that keeps npm from doing a version check every time, as it ignores proxy settings for that check.

SET NO_UPDATE_NOTIFIER=1

With this set, I can build a fresh starter project in ~7 seconds.

WOW!!! It took me about a months work and still couldn’t figure out HOW to make this !@)$!@$ work and was always hitting a wall…!!!
Thanks for the hint!! Now the built takes 10secs!!! :slight_smile:

So I guess this solves also this:
https://vaadin.com/forum/thread/17832404/vaadin-14-0-3-plain-starter-prepare-frontend-takes-9min-30sec

Thanks!!!

Stefan Apelt:
Nevermind, I figured it out. :slight_smile:

To run behind a proxy, one has to set an environment variable that keeps npm from doing a version check every time, as it ignores proxy settings for that check.

SET NO_UPDATE_NOTIFIER=1

With this set, I can build a fresh starter project in ~7 seconds.

You are a live saver!

Also doing an:
npm set update-notifier=false
is the same as this environment variable (it just saves the variable to the .npmrc)! :slight_smile: