docker-android icon indicating copy to clipboard operation
docker-android copied to clipboard

[Web test] Error in Appium server: 'app' option is required for reinstall

Open bonigarcia opened this issue 6 years ago • 9 comments

Operating System Ubuntu 18.04.1 LTS

Docker Image butomo1989/docker-android-x86-8.1:1.6-p0

Docker Version
Docker version 17.05.0-ce, build 89658be

Docker Command to start docker-android

docker run --rm --privileged -p 6080:6080 -p 4723:4723 -e DEVICE="Samsung Galaxy S6" -e AUTO_RECORD=true -e APPIUM=true -v $PWD:/tmp/video butomo1989/docker-android-x86-8.1:1.6-p0

Expected Behavior

I want to run the following test with Appium using the URL: http://localhost:4723/wd/hub

Actual Behavior

The request reaches the Appium server in the container, but an internal error happens:

An unknown server-side error occurred while processing the command. Original error: 'app' option is required for reinstall
    at getResponseForW3CError (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
    at asyncHandler (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)

The error can be seen in the Appium server console through noVNC:

screenshot from 2019-01-09 14-09-44

bonigarcia avatar Jan 09 '19 13:01 bonigarcia

I think it is not from my side, it might be from Appium side. could you maybe check with Appium with local machine (without docker)? @bonigarcia

budtmo avatar Jan 09 '19 14:01 budtmo

@butomo1989 I have just executed the same test against a local Appium server and it is working fine. It seems there is something wrong in the Docker images. As described in #137, the same problem happens (randomly, it sometimes passes) when the Android device is registered in a Selenium Hub.

bonigarcia avatar Jan 09 '19 16:01 bonigarcia

@bonigarcia it works fine on my side. I think you need to explain steps to reproduce it.

budtmo avatar Jan 17 '19 12:01 budtmo

As I said, I started docker-android as follows:

docker run --rm --privileged -p 6080:6080 -p 4723:4723 -e DEVICE="Samsung Galaxy S6" -e AUTO_RECORD=true -e APPIUM=true -v $PWD:/tmp/video butomo1989/docker-android-x86-8.1:1.6-p0

Before running the test, of course you need to wait until the emulator is ready. It can be done checking http://localhost:6080/

Then, you need to execute the test I reported in the issue description. It's a JUnit 4 test. It can be executed from the shell as follows (you need Maven and Java installed in your machine):

git clone https://github.com/bonigarcia/webdrivermanager-examples/
cd webdrivermanager-examples/
mvn test -Dtest=AppiumTest

The test fails, and the error trace contains the error I already reported:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running io.github.bonigarcia.wdm.test.AppiumTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.576 sec <<< FAILURE! - in io.github.bonigarcia.wdm.test.AppiumTest
test(io.github.bonigarcia.wdm.test.AppiumTest)  Time elapsed: 8.573 sec  <<< ERROR!
org.openqa.selenium.SessionNotCreatedException: 
Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: 'app' option is required for reinstall
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-43-generic', java.version: '1.8.0_181'
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: 'app' option is required for reinstall
    at getResponseForW3CError (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
    at asyncHandler (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-43-generic', java.version: '1.8.0_181'
Driver info: driver.version: AndroidDriver
	at io.github.bonigarcia.wdm.test.AppiumTest.setupTest(AppiumTest.java:49)
Caused by: java.lang.reflect.InvocationTargetException
	at io.github.bonigarcia.wdm.test.AppiumTest.setupTest(AppiumTest.java:49)
Caused by: org.openqa.selenium.WebDriverException: 
An unknown server-side error occurred while processing the command. Original error: 'app' option is required for reinstall
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-43-generic', java.version: '1.8.0_181'
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: 'app' option is required for reinstall
    at getResponseForW3CError (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
    at asyncHandler (/usr/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
	at io.github.bonigarcia.wdm.test.AppiumTest.setupTest(AppiumTest.java:49)


Results :

Tests in error: 
  AppiumTest.setupTest:49 » SessionNotCreated Unable to create a new remote sess...

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

@butomo1989 How did you execute it to ensure that it works fine?

bonigarcia avatar Jan 17 '19 13:01 bonigarcia

I use the newest image. Could you try to use 1.6-p2 ?

budtmo avatar Jan 17 '19 13:01 budtmo

I see the same problem with 1.6-p2 and 1.6-p1.

bonigarcia avatar Jan 17 '19 14:01 bonigarcia

ahhh.. I use for app testing and it seems that you use it for web testing. I need to take a look. does it work on the previous version: 1.5-p6? @bonigarcia

budtmo avatar Jan 17 '19 14:01 budtmo

@butomo1989 I don't know.

bonigarcia avatar Jan 17 '19 14:01 bonigarcia

Not sure if this is related but when using your example in docker-compose: When using device samsung_galaxy_s6_8.1 i get "Error in Appium server: 'app' option is required for reinstall"

However when using samsung_galaxy_s6_5.1.1 everything is fine

I noticed that the first device does not seem to have a default browser, is this related?

anton264 avatar Apr 04 '19 18:04 anton264