Unable to start appium through Jenkins programatically, although it works fine when i'm running it through ide

the error message i’m getting is, "io.appium.java_client.service.local.InvalidServerInstanceException: Invalid server instance exception has occured: There is no installed nodes! Please install node via NPM "

Appium and node is already installed.

@Nitish_Kumar1 try follow https://github.com/appium/appium/issues/6197

@Aleksei tried workaround with everything , but nothing helps

Tell us more about your jenkins and slaves. What machines. How configured and so on.

@Aleksei do i need to configure nodejs in my jenkins ?? as i have not configured nodejs on my jenkins.
it just acting as to trigger my test cases.
Appium version - 1.7.2
npm verion - 3.10.10
machine - AWS(windows 8.1)

here is my code that i have added to start my appium through program in my script ,

private AppiumDriverLocalService service;
private AppiumServiceBuilder builder;
private DesiredCapabilities cap;

public void startServer() {
	//Set Capabilities
	cap = new DesiredCapabilities();
	cap.setCapability("noReset", "false");
	
	//Build the Appium service
	builder = new AppiumServiceBuilder();
	builder.withIPAddress("127.0.0.1");
	builder.usingPort(4723);
	builder.withCapabilities(cap);
	builder.withArgument(GeneralServerFlag.SESSION_OVERRIDE);
	builder.withArgument(GeneralServerFlag.LOG_LEVEL,"error");
	
	//Start the server with the builder
	service = AppiumDriverLocalService.buildService(builder);
	service.start();
}

public void stopServer() {
	service.stop();
}

}

@Nitish_Kumar1 never tried with AWS locally. we use jenkins in AWS but nodes other slave machines. Can you check that you can start appium in console on AWS machine? Also suggest to look into folder where jenkins starting your job and under what user - try to do same manually.

BTW: just wonder the need to start appium in AWS cloud. Can you connect devices to this cloud or you going to start on the same machine Android Emulators ?

@Aleksei Yes Appium is working fine locally in AWS via GUI appium or Console,
just not sure about the about the user thing, will check on this

yes the requirement is to run the test cases on daily basis so the appium in AWS cloud,
regarding the android device i’m using ‘Genymotion on Demand’ .

Running emulator on AWS will be a hectic job.
Android Virtual Device based on an ARM system image (This is 10x slower than hardware accelerated virtualisation).
so the cloud device via ‘Genymotion on Demand’.

interesting… nice solution.

ok →

  1. find in jenkins job logs place where the job starting.
  2. identify under what user starting jenkins job
  3. after 1+2 → navigate to needed folder and try to start appium there with “appium” in console.

good luck.