Issue launching Vaadin Flow (14.1.17) application on prod server

The developed Vaadin Flow app needs to be launched on a linux box. The jar is being deployed via XLD. Since I cannot set the PATH globally on that box, I set the PATH to look at rh-nodejs-12 installation in the XLD configuration before launching the application jar.

ANd I get this error :

npm ERR! code EPROTO

npm ERR! errno EPROTO

npm ERR! request to https://registry.npmjs.org/@polymer%2fpolymer failed, reason: write EPROTO 140524156115072:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:794:

npm ERR!

Any suggestions to get past this?

Hi,

If you build the jar with production profile, the frontend resources are bundled.
For production server you don’t need npm.

Are you using the production profile (to build and run it) ?

You can also update your project to, at least 14.1.28 or (probably better) in the latest 14.4.2.

EDIT: The error looks like a SSL error. Perhaps an old openssl, but I don’t know exactly

Tried some updates over the weekend. Following the below 2 links:
https://github.com/vaadin/vaadin-gradle-plugin

https://github.com/vaadin/base-starter-spring-gradle

Updated vaadin to 14.3.7 and modified build.gradle as follows:

plugins {
	id 'org.springframework.boot' version '2.2.4.RELEASE'
	id 'io.spring.dependency-management' version '1.0.9.RELEASE'
	id 'java'
	id 'com.vaadin' version '0.14.3.7'
}

group = 'com.companyname'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
	developmentOnly
	runtimeClasspath {
		extendsFrom developmentOnly
	}
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	maven { url 'http://repository.companyname.com:8081/artifactory/public' }
}

ext {
	set('vaadinVersion', "14.3.7")
}

dependencies {
	implementation 'com.vaadin:vaadin-spring-boot-starter'
	implementation 'com.vaadin:vaadin-server:8.5.0'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	
	implementation 'org.springframework:spring-jdbc'
	compileOnly 'org.projectlombok:lombok'
	developmentOnly 'org.springframework.boot:spring-boot-devtools'
	annotationProcessor 'org.projectlombok:lombok'
	
	compile("com.oracle.ojdbc:ojdbc8:19.3.0.0")
    compile(group: 'au.com.bytecode', name: 'opencsv', version: '2.4')
    compile(group: 'com.sun.mail', name: 'javax.mail', version: '1.6.2')
    compile(group: 'org.apache.poi', name: 'poi', version: '3.15')
    compile(group: 'org.apache.poi', name: 'poi-ooxml', version: '3.15')
    compile(group: 'org.apache.commons', name: 'commons-lang3', version: '3.1')
    compile(group: 'org.jasypt', name: 'jasypt', version: '1.9.0')
    compile(group: 'org.quartz-scheduler', name: 'quartz', version: '2.2.1')
   	compile 'org.apache.commons:commons-math3:3.6.1'
   	compile 'com.google.guava:guava:18.0'
  
   	
	testImplementation('org.springframework.boot:spring-boot-starter-test') {
		exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
	}
}

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

test {
	useJUnitPlatform()
}

vaadin {
 	pnpmEnable = true 
}

Updated the CI to run the task : clean build -PproductionMode

CI fails that :
Execution failed for task ‘:vaadinPrepareFrontend’.

Failed to install Nodejs

I’m not an active user of gradle, perhaps you have more information like some stacktrace?

Error in Jenkins build (clean build -Pvaadin.productionMode) :

08:43:52 08:43:52.894 [INFO]
 [org.gradle.execution.plan.DefaultPlanExecutor]
 :vaadinPrepareFrontend (Thread[Daemon worker,5,main]
) started.
08:43:53 08:43:52.894 [LIFECYCLE]
 [class org.gradle.internal.buildevents.TaskExecutionLogger]
 
08:43:53 08:43:52.894 [LIFECYCLE]
 [class org.gradle.internal.buildevents.TaskExecutionLogger]
 > Task :vaadinPrepareFrontend FAILED
08:43:53 08:43:52.894 [DEBUG]
 [org.gradle.internal.operations.DefaultBuildOperationExecutor]
 Build operation 'Task :vaadinPrepareFrontend' started
08:43:53 08:43:52.894 [DEBUG]
 [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter]
 Putting task artifact state for task ':vaadinPrepareFrontend' into context took 0.0 secs.
08:43:53 08:43:52.897 [INFO]
 [org.gradle.internal.execution.steps.ResolveCachingStateStep]
 Caching disabled for task ':vaadinPrepareFrontend' because:
08:43:53   Build cache is disabled
08:43:53 08:43:52.897 [DEBUG]
 [org.gradle.internal.execution.steps.SkipUpToDateStep]
 Determining if task ':vaadinPrepareFrontend' is up-to-date
08:43:53 08:43:52.897 [INFO]
 [org.gradle.internal.execution.steps.SkipUpToDateStep]
 Task ':vaadinPrepareFrontend' is not up-to-date because:
08:43:53   Task has not declared any outputs despite executing actions.
08:43:53 08:43:52.898 [DEBUG]
 [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter]
 Executing actions for task ':vaadinPrepareFrontend'.
08:43:53 08:43:52.898 [DEBUG]
 [org.gradle.internal.operations.DefaultBuildOperationExecutor]
 Build operation 'Execute vaadinPrepareFrontend for :vaadinPrepareFrontend' started
08:43:53 08:43:52.899 [INFO]
 [org.gradle.api.Task]
 Running the vaadinPrepareFrontend task with effective configuration VaadinFlowPluginExtension(productionMode=true, buildOutputDirectory=N:\Jenkins\workspace\appln\build\vaadin-generated, webpackOutputDirectory=N:\Jenkins\workspace\appln\build\resources\main\META-INF\VAADIN, npmFolder=N:\Jenkins\workspace\appln, webpackTemplate='webpack.config.js', webpackGeneratedTemplate='webpack.generated.js', generatedFolder=N:\Jenkins\workspace\appln\target\frontend, frontendDirectory=N:\Jenkins\workspace\appln\frontend, generateBundle=true, runNpmInstall=true, generateEmbeddableWebComponents=true, frontendResourcesDirectory=N:\Jenkins\workspace\appln\src\main\resources\META-INF\resources\frontend, optimizeBundle=true, pnpmEnable=true, requireHomeNodeExec=false)
08:43:53 08:43:52.929 [INFO]
 [org.gradle.api.Task]
 Wrote token file N:\Jenkins\workspace\appln\build\vaadin-generated\META-INF\VAADIN\config\flow-build-info.json: {"compatibilityMode":false,"productionMode":true,"npmFolder":"N:\\Jenkins\\workspace\\appln","generatedFolder":"N:\\Jenkins\\workspace\\appln\\target\\frontend","frontendFolder":"N:\\Jenkins\\workspace\\appln\\frontend","pnpm.enable":true,"require.home.node":false}
08:43:53 08:43:52.938 [INFO]
 [org.gradle.api.Task]
 validating node and npm version
08:43:53 08:43:53.529 [DEBUG]
 [com.vaadin.flow.server.frontend.FrontendToolsLocator]
 Command '[where, node.exe]
' failed with exit code '1'
08:43:53 08:43:53.530 [INFO]
 [com.vaadin.flow.server.frontend.FrontendTools]
 Couldn't find node.exe. Installing Node and NPM to C:\Users\_HUDSON_RC_PROD\.vaadin.
08:43:53 08:43:53.547 [INFO]
 [NodeInstaller]
 Installing node version v12.18.3
08:43:53 08:43:53.548 [INFO]
 [NodeInstaller]
 Downloading https://nodejs.org/dist/v12.18.3/node-v12.18.3-win-x64.zip to C:\Users\_HUDSON_RC_PROD\.vaadin\node-v12.18.3-win-x64.zip
08:43:53 08:43:53.549 [INFO]
 [ProxyConfig]
 No proxies configured
08:43:53 08:43:53.549 [INFO]
 [FileDownloader]
 No proxy was configured, downloading directly
08:43:53 08:43:53.764 [DEBUG]
 [org.apache.http.client.protocol.RequestAddCookies]
 CookieSpec selected: default
08:43:53 08:43:53.775 [DEBUG]
 [org.apache.http.client.protocol.RequestAuthCache]
 Auth cache not set in the context
08:43:53 08:43:53.776 [DEBUG]
 [org.apache.http.impl.conn.PoolingHttpClientConnectionManager]
 Connection request: [route: {s}->https://nodejs.org:443]
[total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 10]

08:43:53 08:43:53.792 [DEBUG]
 [org.apache.http.impl.conn.PoolingHttpClientConnectionManager]
 Connection leased: [id: 0]
[route: {s}->https://nodejs.org:443]
[total kept alive: 0; route allocated: 1 of 5; total allocated: 1 of 10]

08:43:53 08:43:53.794 [DEBUG]
 [org.apache.http.impl.execchain.MainClientExec]
 Opening connection {s}->https://nodejs.org:443
08:43:53 08:43:53.804 [DEBUG]
 [org.apache.http.impl.conn.DefaultManagedHttpClientConnection]
 http-outgoing-0: Shutdown connection
08:43:53 08:43:53.804 [DEBUG]
 [org.apache.http.impl.execchain.MainClientExec]
 Connection discarded
08:43:53 08:43:53.805 [DEBUG]
 [org.apache.http.impl.conn.PoolingHttpClientConnectionManager]
 Connection released: [id: 0]
[route: {s}->https://nodejs.org:443]
[total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 10]

08:43:53 08:43:53.805 [DEBUG]
 [org.gradle.internal.operations.DefaultBuildOperationExecutor]
 Completing Build operation 'Execute vaadinPrepareFrontend for :vaadinPrepareFrontend'
08:43:53 08:43:53.805 [DEBUG]
 [org.gradle.internal.operations.DefaultBuildOperationExecutor]
 Build operation 'Execute vaadinPrepareFrontend for :vaadinPrepareFrontend' completed
08:43:53 08:43:53.807 [DEBUG]
 [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter]
 Removed task artifact state for {} from context.
08:43:53 08:43:53.807 [DEBUG]
 [org.gradle.internal.operations.DefaultBuildOperationExecutor]
 Completing Build operation 'Task :vaadinPrepareFrontend'
08:43:53 08:43:53.807 [DEBUG]
 [org.gradle.internal.operations.DefaultBuildOperationExecutor]
 Build operation 'Task :vaadinPrepareFrontend' completed
08:43:53 08:43:53.807 [INFO]
 [org.gradle.execution.plan.DefaultPlanExecutor]
 :vaadinPrepareFrontend (Thread[Daemon worker,5,main]
) completed. Took 0.913 secs.
08:43:53 08:43:53.808 [DEBUG]
 [org.gradle.internal.resources.AbstractTrackedResourceLock]
 Daemon worker: released lock on :
08:43:53 08:43:53.808 [DEBUG]
 [org.gradle.internal.work.DefaultWorkerLeaseService]
 Worker lease root.1.9 completed (1 worker(s) in use)
08:43:53 08:43:53.808 [DEBUG]
 [org.gradle.internal.resources.AbstractTrackedResourceLock]
 Daemon worker: released lock on root.1.9
08:43:53 08:43:53.808 [DEBUG]
 [org.gradle.execution.plan.DefaultPlanExecutor]
 Execution worker [Thread[Daemon worker,5,main]
] finished, busy: 11.083 secs, idle: 0.026 secs
08:43:53 08:43:53.808 [DEBUG]
 [org.gradle.execution.plan.DefaultPlanExecutor]
 Execution worker [Thread[Execution worker for ':' Thread 3,5,main]
] finished, busy: 0.0 secs, idle: 11.096 secs
08:43:53 08:43:53.808 [DEBUG]
 [org.gradle.execution.plan.DefaultPlanExecutor]
 Execution worker [Thread[Execution worker for ':',5,main]
] finished, busy: 0.0 secs, idle: 11.09 secs
08:43:53 08:43:53.808 [DEBUG]
 [org.gradle.execution.plan.DefaultPlanExecutor]
 Execution worker [Thread[Execution worker for ':' Thread 2,5,main]
] finished, busy: 0.0 secs, idle: 11.097 secs
08:43:53 08:43:53.809 [DEBUG]
 [org.gradle.execution.taskgraph.DefaultTaskExecutionGraph]
 Timing: Executing the DAG took 11.115 secs
08:43:53 08:43:53.813 [DEBUG]
 [org.gradle.internal.operations.DefaultBuildOperationExecutor]
 Completing Build operation 'Run tasks'
08:43:53 08:43:53.813 [DEBUG]
 [org.gradle.internal.operations.DefaultBuildOperationExecutor]
 Build operation 'Run tasks' completed
08:43:53 08:43:53.821 [DEBUG]
 [org.gradle.internal.work.DefaultWorkerLeaseService]
 Worker lease root.1 completed (0 worker(s) in use)
08:43:53 08:43:53.821 [DEBUG]
 [org.gradle.internal.resources.AbstractTrackedResourceLock]
 Daemon worker: released lock on root.1
08:43:53 08:43:53.829 [ERROR]
 [org.gradle.internal.buildevents.BuildExceptionReporter]
 
08:43:53 08:43:53.829 [ERROR]
 [org.gradle.internal.buildevents.BuildExceptionReporter]
 FAILURE: Build failed with an exception.
08:43:53 08:43:53.829 [ERROR]
 [org.gradle.internal.buildevents.BuildExceptionReporter]
 
08:43:53 08:43:53.829 [ERROR]
 [org.gradle.internal.buildevents.BuildExceptionReporter]
 * What went wrong:
08:43:53 08:43:53.830 [ERROR]
 [org.gradle.internal.buildevents.BuildExceptionReporter]
 Execution failed for task ':vaadinPrepareFrontend'.
08:43:53 08:43:53.830 [ERROR]
 [org.gradle.internal.buildevents.BuildExceptionReporter]
 > Failed to install Node

Could you please try obtaining the stacktrace by adding the --stacktrace switch to your gradle command please?

If the node is downloaded via the built-in Java URL machinery, perhaps configuring the proxy via system properties could help. Could you please try adding the proxy configuration according to https://stackoverflow.com/a/27491015/377320 and let me know whether it helped?

This issue was not due to proxy setting, so I didn’t have to make the modifications you mentioned, Martin, but thank you for the pointer.
It ended up being a corporate policy on boxes - agents were locked down to not permit nodejs install. I had to use a prepared label to use what’s available in the repo.
So from a build.gradle standpoint, I updated to

vaadin {
	pnpmEnable = false
}

Thank you Martin & Jean, for your suggestions & pointers.