problem starting bakery app vaadin 12 Flow in production mode

Hi,
i try to run the bakery app with vaadin flow in production mode. I added a proxy to the maven settings. And I added the flag

<configuration>
	<ignoreMavenProxies>false</ignoreMavenProxies>
</configuration>

for the vaadin-maven-plugin. But I return with the following problem:

[INFO]
 yarn install v1.6.0
[INFO]
 [1/4]
 Resolving packages...
[INFO]
 [2/4]
 Fetching packages...
[INFO]
 [3/4]
 Linking dependencies...
[ERROR]
 warning "polymer-build > polymer-project-config@3.13.0" has incorrect peer dependency "polymer-analyzer@^3.0.0-pre.17 || ^3.0.0".
[INFO]
 [4/4]
 Building fresh packages...
[ERROR]
 error D:\Users\***\VaadinWorkspace\start-vaadin-12\target\node_modules\iltorb: Command failed.
[INFO]
 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[ERROR]
 Exit code: 1
[ERROR]
 Command: node ./scripts/install.js || node-gyp rebuild
[ERROR]
 Arguments:
[ERROR]
 Directory: D:\Users\***\VaadinWorkspace\start-vaadin-12\target\node_modules\iltorb
[ERROR]
 Output:
[ERROR]
 info looking for cached prebuild @ D:\Users\****\AppData\Roaming\npm-cache\_prebuilds\f18eac-iltorb-v2.4.0-node-v57-win32-x64.tar.gz
[ERROR]
 http request GET https://github.com/MayhemYDG/iltorb/releases/download/v2.4.0/iltorb-v2.4.0-node-v57-win32-x64.tar.gz
[ERROR]
 WARN install connect ETIMEDOUT 192.30.253.112:443
[ERROR]
 Der Befehl "node-gyp" ist entweder falsch geschrieben oder
[ERROR]
 konnte nicht gefunden werden.
[INFO]
 ---------------------------------------




[ERROR]
 Failed to execute goal com.vaadin:vaadin-maven-plugin:12.0.0:package-for-production (default) on project start-vaadin-12: Execution default of goal com.vaadin:vaadin-maven-
plugin:12.0.0:package-for-production failed: Failed to install required frontend dependencies: 'yarn install --https-proxy=http://**.***.*.***:8080 --proxy=http://**.***.*.***:8080
' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.vaadin:vaadin-maven-plugin:12.0.0:package-for-production (default) on project start-vaadin-12: Ex
ecution default of goal com.vaadin:vaadin-maven-plugin:12.0.0:package-for-production failed: Failed to install required frontend dependencies

I tried to run the same starter-kit with version 11 and this worked fine. So I have no idea what is going wrong with version 12 when I start the app in production mode via

mvn spring-boot:run -Dvaadin.productionMode -X

It looks like the error comes from the gulp-brotli package which has the iltorb package as dependency. Have anybody an idea how to fix this?

Which version of Node are you using? Node version 11 is not LTS, and it might cause problems.

Since updating to V12, I’m having the same problem when I build on my linux box (Ubuntu 18.04).

Simple stuff from other threads:

  • I don’t have an active proxy (but have tried the proxy config option anyway)
  • I do have gcc installed
  • I’m configured for node v8.1.2 (to my un-trained eye there are no significant differences from the stock v12 starter app POM).

Error details:

[16:19:52]
 :	 [Step 1/2]
 [INFO]
 [1/4]
 Resolving packages...
[16:19:53]
 :	 [Step 1/2]
 [INFO]
 [2/4]
 Fetching packages...
[16:19:53]
 :	 [Step 1/2]
 [INFO]
 [3/4]
 Linking dependencies...
[16:19:53]
W:	 [Step 1/2]
 [ERROR]
 warning "polymer-build > polymer-project-config@3.13.0" has incorrect peer dependency "polymer-analyzer@^3.0.0-pre.17 || ^3.0.0".
[16:19:56]
 :	 [Step 1/2]
 [INFO]
 [4/4]
 Building fresh packages...
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 error /usr/share/teamcity/2017.2.1/buildAgent/work/5ad9c95163fc061a/target/node_modules/iltorb: Command failed.
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 Exit code: 127
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 Command: node ./scripts/install.js || node-gyp rebuild
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 Arguments: 
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 Directory: /usr/share/teamcity/2017.2.1/buildAgent/work/5ad9c95163fc061a/target/node_modules/iltorb
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 Output:
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 info looking for cached prebuild @ /var/lib/teamcity_home/.npm/_prebuilds/6f8fb1-iltorb-v2.4.0-node-v57-linux-ia32.tar.gz
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 http request GET https://github.com/MayhemYDG/iltorb/releases/download/v2.4.0/iltorb-v2.4.0-node-v57-linux-ia32.tar.gz
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 http 404 https://github.com/MayhemYDG/iltorb/releases/download/v2.4.0/iltorb-v2.4.0-node-v57-linux-ia32.tar.gz
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 WARN install No prebuilt binaries found (target=8.11.1 runtime=node arch=ia32 platform=linux)
[16:19:56]
W:	 [Step 1/2]
 [ERROR]
 /bin/sh: 1: node-gyp: not found
...
[16:19:57]
W:	 [Step 1/2]
 [ERROR]
 Failed to execute goal com.vaadin:vaadin-maven-plugin:12.0.3:package-for-production (default) on project db2: Execution default of goal com.vaadin:vaadin-maven-plugin:12.0.3:package-for-production failed: Failed to install required frontend dependencies: 'yarn install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

POM contents:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	
	<-- SNIPPED: name, group, etc. -->
	
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.1.1.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<failOnMissingWebXml>false</failOnMissingWebXml>
		<!-- Dependencies -->
		<vaadin.version>12.0.3</vaadin.version>

		<failOnMissingWebXml>false</failOnMissingWebXml>

		<!-- Plugins -->
		<frontend.maven.plugin.version>1.6</frontend.maven.plugin.version>
		<maven.war.plugin.version>3.1.0</maven.war.plugin.version>
		<maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
		<maven.clean.plugin.version>3.0.0</maven.clean.plugin.version>
		<maven.surefire.plugin.version>2.22.1</maven.surefire.plugin.version>

		<junit.jupiter.version>5.3.2</junit.jupiter.version>

		<!-- Frontend -->
		<node.version>v8.1.2</node.version>
		<yarn.version>v0.27.5</yarn.version>
		<buildtools.directory>build-tools</buildtools.directory>
	</properties>

	<repositories>
		<repository>
			<id>vaadin-addons</id>
			<url>http://maven.vaadin.com/vaadin-addons</url>
		</repository>
	</repositories>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.vaadin</groupId>
				<artifactId>vaadin-bom</artifactId>
				<version>${vaadin.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>com.vaadin</groupId>
				<artifactId>vaadin-tabs-flow</artifactId>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>1.1.1</version>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
		</dependency>

		<!-- Added by Rob -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>27.0.1-jre</version>
		</dependency>
		<dependency>
			<groupId>com.googlecode.libphonenumber</groupId>
			<artifactId>libphonenumber</artifactId>
			<version>8.9.9</version>
		</dependency>
		<!-- /Added by Rob -->

		<!-- Vaadin -->
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-spring</artifactId>
		</dependency>
		<dependency>
			<groupId>org.vaadin.artur</groupId>
			<artifactId>spring-data-provider</artifactId>
			<version>2.0.1</version>
		</dependency>
		<!-- End of Vaadin -->

		<!-- Other elements -->
		<dependency>
			<groupId>org.webjars.bowergithub.polymerelements</groupId>
			<artifactId>iron-form</artifactId>
			<version>2.1.3</version>
		</dependency>
		<dependency>  <!-- Needed by vaadin-tabs-flow -->
			<groupId>org.webjars.bowergithub.polymerelements</groupId>
			<artifactId>iron-pages</artifactId>
			<version>2.1.1</version>
		</dependency>

		<!-- Spring -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-autoconfigure</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.apache.tomcat</groupId>
					<artifactId>tomcat-juli</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.apache.tomcat</groupId>
					<artifactId>tomcat-jdbc</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-tomcat</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-config</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<!-- End Spring -->
		<!-- Add JAXB explicitly as the java.xml.bind module is not included
			 by default anymore in Java 9-->
		<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
		</dependency>
		<!-- Compile scope is needed to run on WildFly -->
		<dependency>
			<groupId>org.reactivestreams</groupId>
			<artifactId>reactive-streams</artifactId>
		</dependency>
		<!-- Testing -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>${junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<version>${junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>${junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>


	<build>
		<!-- The `pluginManagement` section allows listing plugin versions and their global
			 configuration in one place. -->
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${maven.resources.plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>${maven.war.plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>com.vaadin</groupId>
					<artifactId>vaadin-maven-plugin</artifactId>
					<version>${vaadin.version}</version>
				</plugin>
				<plugin>
					<groupId>com.github.eirslett</groupId>
					<artifactId>frontend-maven-plugin</artifactId>
					<version>${frontend.maven.plugin.version}</version>
					<configuration>
						<nodeVersion>${node.version}</nodeVersion>
						<yarnVersion>${yarn.version}</yarnVersion>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven.surefire.plugin.version}</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>production</id>
			<activation>
				<property>
					<name>vaadin.productionMode</name>
				</property>
			</activation>

			<!-- (1): Make the package run in production mode when deployed as .war,
					  without the need of setting extra properties on the server -->
			<dependencies>
				<dependency>
					<groupId>com.vaadin</groupId>
					<artifactId>flow-server-production-mode</artifactId>
				</dependency>
			</dependencies>

			<build>
				<plugins>
					<!-- (2): Run vaadin-maven-plugin to transpile and optimize frontend code -->
					<plugin>
						<groupId>com.vaadin</groupId>
						<artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin.version}</version>
						<executions>
							<execution>
								<goals>
									<goal>copy-production-files</goal>
									<goal>package-for-production</goal>
								</goals>
								<configuration>
									<ignoreMavenProxies>false</ignoreMavenProxies>
									<!-- Split app into fragments in order to make login-view smaller.
										 This way is still very manual, because flow does not merge
										 elements that are only used in one fragment into that fragment.
									 -->
									<bundle>true</bundle>
									<fragments>
										<fragment>
											<name>login-fragment</name>
											<files>
												<file>src/views/login/login-view.html</file>
											</files>
										</fragment>
										<fragment>
											<name>main-fragment</name>
											<files>
												<file>src/main-view.html</file>
												<file>src/views/errors/access-denied-view.html</file>
												<file>src/components/amount-field.html</file>
												<file>src/components/app-navigation.html</file>
												<file>src/components/document-control.html</file>
												<file>src/components/form-buttons-bar.html</file>
												<file>src/components/search-bar.html</file>
												<file>src/components/utils-mixin.html</file>

                        <file>src/views/employees/employee-form.html</file>
                        <file>src/views/employees/employees-view.html</file>
                        <file>src/views/sites/site-form.html</file>
                        <file>src/views/sites/sites-view.html</file>
											</files>
										</fragment>
										<fragment>
											<name>grid-fragment</name>
											<files>
												<file>gridConnector.js</file>
												<file>vaadin-grid-flow-selection-column.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid-column.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid-column-group.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid-tree-toggle.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid-sorter.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid-selection-column.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid-filter.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid-column.html</file>
												<file>bower_components/vaadin-grid/vaadin-grid-column-group.html</file>
												<file>ironListConnector.js</file>
												<file>bower_components/iron-list/iron-list.html</file>
												<file>bower_components/vaadin-grid/src/iron-list.html</file>
											</files>
										</fragment>
									</fragments>
									<transpileOutputDirectory>${project.build.directory}/classes/static</transpileOutputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- (3): Exclude the unprocessed frontend sources from the .war file -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-war-plugin</artifactId>
						<configuration>
							<warSourceExcludes>frontend/**</warSourceExcludes>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.springframework.boot</groupId>
						<artifactId>spring-boot-maven-plugin</artifactId>
						<configuration>
							<jvmArguments>-Dvaadin.productionMode</jvmArguments>
						</configuration>
					</plugin>
				</plugins>

				<!-- War file will be placed at the root -->
				<finalName>ROOT</finalName>
			</build>
		</profile>

		<profile>
			<id>lint</id>
			<activation>
				<property>
					<name>runLint</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.github.eirslett</groupId>
						<artifactId>frontend-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>install-node-and-yarn</id>
								<goals>
									<goal>install-node-and-yarn</goal>
									<goal>yarn</goal> <!-- runs 'install' by default -->
								</goals>
								<configuration>
									<workingDirectory>${buildtools.directory}</workingDirectory>
								</configuration>
							</execution>
							<execution>
								<id>yarn run lint</id>
								<phase>compile</phase>
								<goals>
									<goal>yarn</goal>
								</goals>
								<configuration>
									<arguments>run lint</arguments>
									<workingDirectory>${buildtools.directory}</workingDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>

Full error details for package-for-production step are attached.

Any help would be appreciated.
17449737.log (49.4 KB)

I solved the problem by download the iltorb manually, then I put it in

var/lib/teamcity_home/.npm/_prebuilds/6f8fb1-iltorb-v2.4.0-node-v57-linux-ia32.tar.gz/

where the script is looking for it.

I finally found the source of my problem. There was an old 32-bit Java 8 JVM which was being picked to run Maven on my build machine. It appears that something in the V12 stack now looks at the JVM architecture rather than the machine architecture to pick the iltorb library architecture. It then couldn’t find the “…linux-ia32…” build and would fail. Once found, it was simple to correctly point to a 64-bit JVM and it then correctly found the pre-built binary.

I did double-check that the same (32-bit) JVM was being used to run the build with Vaadin 10 and it worked. So, something in the stack changed. Bottom line: check your JVM to make sure you’re running 64-bit on a 64-bit machine.

How/where did you point to the jvm? in the pom? or in maven settings?

My build server is TeamCity, and the JDK specification was in the “Maven” build step:
![JDK parameter]
(https://vaadin.com/attachment/425c8e4b-98af-4583-9214-2a02e4c89410/Screen%20Shot%202018-12-29%20at%2012.57.10%20PM.png)

I found that my build agent was configured to point to a 32-bit JDK for the “JDK 1.8” option. So, it did this when running maven:

[Step 1/2]
 Starting: /usr/java/jdk1.8.0_102-i586/bin/java ...options snipped... 
  org.codehaus.plexus.classworlds.launcher.Launcher -f
  /usr/share/teamcity/2017.2.1/buildAgent/work/5ad9c95163fc061a/pom.xml 
  -B clean package -Dmaven.test.failure.ignore=false -Dvaadin.productionMode -X

17452059.png

I filed an issue here: https://github.com/vaadin/flow/issues/4907