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

Appium server is not starting in Gitlab CI environment

Open adityaddy opened this issue 3 years ago • 3 comments

🐛 Bug Report

Hi I am running Appium test in Gitlab CI environment by passing the relevant environment variables, but Appium server is not starting up.

Operating System: Any

Docker Image: Any

Docker Version:
Any

Docker Command to start docker-android: Started in Gitlab CI environment

Expected Behavior

Appium server should start

Actual Behavior

Appium server does not start

adityaddy avatar Dec 06 '21 11:12 adityaddy

Appium server is not starting up for my project as well in GitLab CI all of a sudden. Tried with both these versions v14.8.2 and v15.1.1

Any help would be appreciated.

Please find my GitLab CI job log for your reference below

`[0KRunning with gitlab-runner 14.8.2 (c6e7e194)[0;m [0K on User1-MacBook-Pro.local KHvHQX-g[0;m section_start:1656597864:prepare_executor [0K[0K[36;1mPreparing the "shell" executor[0;m[0;m [0KUsing Shell executor...[0;m section_end:1656597864:prepare_executor [0Ksection_start:1656597864:prepare_script [0K[0K[36;1mPreparing environment[0;m[0;m Running on User1-MacBook-Pro.local... section_end:1656597864:prepare_script [0Ksection_start:1656597864:get_sources [0K[0K[36;1mGetting source from Git repository[0;m[0;m [32;1mFetching changes with git depth set to 50...[0;m Initialized empty Git repository in /Users/user1/builds/KHvHQX-g/0/Documents/myapp/.git/ [32;1mCreated fresh repository.[0;m [32;1mChecking out 6f63cfb0 as chore/bddautomation...[0;m [32;1mSkipping Git submodules setup[0;m section_end:1656598022:get_sources [0Ksection_start:1656598022:step_script [0K[0K[36;1mExecuting "step_script" stage of the job script[0;m[0;m [32;1m$ echo "Execute scripts on android"[0;m Execute scripts on android [32;1m$ npm config set strict-ssl false[0;m [32;1m$ npm config delete registry[0;m [32;1m$ npm config set proxy $CODE_PROXY[0;m npm WARN invalid config proxy="" set in /Users/user1/.npmrc npm WARN invalid config Must be full url with "http://" npm WARN config omitting invalid config values [32;1m$ npm config set https-proxy $CODE_PROXY[0;m npm WARN invalid config https-proxy="" set in /Users/user1/.npmrc npm WARN invalid config Must be full url with "http://" npm WARN config omitting invalid config values [32;1m$ npm set chromedriver_cdnurl $npm_config_chromedriver_cdnurl[0;m [32;1m$ npm config set registry [http://registry.npmjs.org/0;m [32;1m$ export JAVA_HOME=$(/usr/libexec/java_home)[0;m [32;1m$ export ANDROID_HOME=/Users/user1/Documents/sdk[0;m [32;1m$ export PATH=$JAVA_HOME/bin:$PATH[0;m [32;1m$ PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools[0;m [32;1m$ cd bdd-appium-webdriverio-test[0;m [32;1m$ npm i[0;m npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/ npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/ npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

added 551 packages in 38s

57 packages are looking for funding run npm fund for details [32;1m$ chmod 777 check_for_android_devices.sh[0;m [32;1m$ ./check_for_android_devices.sh[0;m cannot connect to daemon at tcp:5037: Connection refused

  • daemon not running; starting now at tcp:5037
  • daemon started successfully 14011FDD4001YT[32;1m$ npx wdio ./config/android.config.ts[0;m
  • daemon not running; starting now at tcp:5037
  • daemon started successfully 14011FDD4001YTGoogle Pixel 5 12

Execution of 1 workers started at 2022-06-30T14:07:46.360Z

2022-06-30T14:07:46.416Z INFO @wdio/cli:launcher: Run onPrepare hook 2022-06-30T14:07:46.420Z INFO chromedriver: Start Chromedriver (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/chromedriver/lib/chromedriver/chromedriver) with args --silent --port=9515 --url-base=/ 2022-06-30T14:07:46.713Z INFO chromedriver: ChromeDriver was started successfully. 2022-06-30T14:07:48.416Z INFO @wdio/cli:launcher: Run onWorkerStart hook 2022-06-30T14:07:48.420Z INFO @wdio/local-runner: Start worker 0-0 with arg: ./config/android.config.ts [0-0] [90m2022-06-30T14:07:49.007Z[39m [96mINFO[39m [97m@wdio/local-runner[39m: Run worker command: run [0-0] * daemon not running; starting now at tcp:5037 [0-0] * daemon started successfully [0-0] 14011FDD4001YTGoogle [0-0] Pixel 5 [0-0] 12 [0-0] RUNNING in MultiRemote - /tests/features/Mobile.feature [0-0] [90m2022-06-30T14:07:51.428Z[39m [96mINFO[39m [97mwebdriver[39m: Initiate new session using the WebDriver protocol [0-0] [90m2022-06-30T14:07:51.487Z[39m [96mINFO[39m [97mwebdriver[39m: [POST] http://localhost:9515/session [0-0] [90m2022-06-30T14:07:51.487Z[39m [96mINFO[39m [97mwebdriver[39m: [33mDATA[39m { [0-0] capabilities: { alwaysMatch: { browserName: 'chrome' }, firstMatch: [ {} ] }, [0-0] desiredCapabilities: { browserName: 'chrome' } [0-0] } [0-0] [90m2022-06-30T14:07:51.492Z[39m [96mINFO[39m [97mwebdriver[39m: Initiate new session using the WebDriver protocol [0-0] [90m2022-06-30T14:07:51.493Z[39m [96mINFO[39m [97mwebdriver[39m: [POST] http://localhost:4723/session [0-0] [90m2022-06-30T14:07:51.493Z[39m [96mINFO[39m [97mwebdriver[39m: [33mDATA[39m { [0-0] capabilities: { [0-0] alwaysMatch: { [0-0] platformName: 'Android', [0-0] noReset: false, [0-0] fullReset: true, [0-0] maxInstances: 1, [0-0] automationName: 'uiautomator2', [0-0] deviceName: 'Google Pixel 5\n', [0-0] udid: '14011FDD4001YT', [0-0] platformVersion: '12\n', [0-0] app: '/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/apps/app-staging.apk', [0-0] newCommandTimeout: 200000 [0-0] }, [0-0] firstMatch: [ {} ] [0-0] }, [0-0] desiredCapabilities: { [0-0] platformName: 'Android', [0-0] noReset: false, [0-0] fullReset: true, [0-0] maxInstances: 1, [0-0] automationName: 'uiautomator2', [0-0] deviceName: 'Google Pixel 5\n', [0-0] udid: '14011FDD4001YT', [0-0] platformVersion: '12\n', [0-0] app: '/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/apps/app-staging.apk', [0-0] newCommandTimeout: 200000 [0-0] } [0-0] } [0-0] [90m2022-06-30T14:07:51.506Z[39m [31mERROR[39m [97mwebdriver[39m: RequestError: connect ECONNREFUSED ::1:4723 [0-0] at ClientRequest. (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/got/dist/source/core/index.js:962:111) [0-0] at Object.onceWrapper (node:events:642:26) [0-0] at ClientRequest.emit (node:events:539:35) [0-0] at ClientRequest.emit (node:domain:475:12) [0-0] at ClientRequest.origin.emit (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20) [0-0] at Socket.socketErrorListener (node:_http_client:442:9) [0-0] at Socket.emit (node:events:527:28) [0-0] at Socket.emit (node:domain:475:12) [0-0] at emitErrorNT (node:internal/streams/destroy:164:8) [0-0] at emitErrorCloseNT (node:internal/streams/destroy:129:3) [0-0] at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1158:16) [0-0] [90m2022-06-30T14:07:51.506Z[39m [31mERROR[39m [97m@wdio/runner[39m: Error: Failed to create session. [0-0] Unable to connect to "http://localhost:4723/", make sure browser driver is running on that address. [0-0] If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver. [0-0] at startWebDriverSession (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/webdriver/build/utils.js:73:15) [0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5) [0-0] at async Function.newSession (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/webdriver/build/index.js:46:45) [0-0] at async remote (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/webdriverio/build/index.js:77:22) [0-0] at async /Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/webdriverio/build/index.js:139:26 [0-0] at async Promise.all (index 1) [0-0] at async multiremote (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/webdriverio/build/index.js:138:5) [0-0] at async initialiseInstance /Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/@wdio/runner/build/utils.js:73:21) [0-0] at async Runner._startSession (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/@wdio/runner/build/index.js:223:56) [0-0] at async Runner._initSession (/Users/user1/builds/KHvHQX-g/0/Documents/myapp/bdd-appium-webdriverio-test/node_modules/@wdio/runner/build/index.js:176:25) [0-0] FAILED in MultiRemote - /tests/features/Mobile.feature 2022-06-30T14:07:51.617Z INFO @wdio/cli:launcher: Run onWorkerEnd hook 2022-06-30T14:07:51.618Z INFO @wdio/cli:launcher: Run onComplete hook

Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:05

2022-06-30T14:07:51.618Z INFO @wdio/local-runner: Shutting down spawned worker 2022-06-30T14:07:51.870Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully 2022-06-30T14:07:51.870Z INFO @wdio/local-runner: shutting down section_end:1656598071:step_script [0Ksection_start:1656598071:after_script [0K[0K[36;1mRunning after_script[0;m[0;m [32;1mRunning after script...[0;m [32;1m$ cd bdd-appium-webdriverio-test[0;m [32;1m$ npm run report[0;m

[email protected] report allure generate allure-results --clean

Report successfully generated to allure-report [32;1m$ cd ..[0;m section_end:1656598074:after_script [0Ksection_start:1656598074:upload_artifacts_on_failure [0K[0K[36;1mUploading artifacts for failed job[0;m[0;m [32;1mUploading artifacts...[0;m Runtime platform [0;m arch[0;m=amd64 os[0;m=darwin pid[0;m=12640 revision[0;m=c6e7e194 version[0;m=14.8.2 bdd-appium-webdriverio-test/allure-report: found 55 matching files and directories[0;m bdd-appium-webdriverio-test/allure-results: found 1 matching files and directories[0;m Uploading artifacts as "archive" to coordinator... 201 Created[0;m id[0;m=80913374 responseStatus[0;m=201 Created token[0;m=pMpsnVTk section_end:1656598083:upload_artifacts_on_failure [0Ksection_start:1656598083:cleanup_file_variables [0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m section_end:1656598083:cleanup_file_variables [0K[31;1mERROR: Job failed: exit status 1 [0;m`

divyashivali avatar Jul 01 '22 07:07 divyashivali

did you set up your env correctly? if yes drop yours setting here

suaadBatis avatar Oct 25 '23 11:10 suaadBatis

I am facing the same issue. $ /opt/homebrew/bin/appium --address 127.0.0.1 -p 4723 env: node: No such file or directory

but inside the machine works properly

selvaraj-kuppusamy avatar Apr 25 '24 11:04 selvaraj-kuppusamy