budtmo / docker-android

Android in docker solution with noVNC supported and video recording
Other
9.92k stars 1.3k forks source link

Appium server is not starting in Gitlab CI environment #313

Open adityaddy opened 2 years ago

adityaddy commented 2 years ago

🐛 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

divyashivali commented 2 years ago

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)  on User1-MacBook-Pro.local KHvHQX-g section_start:1656597864:prepare_executor Preparing the "shell" executor Using Shell executor... section_end:1656597864:prepare_executor section_start:1656597864:prepare_script Preparing environment Running on User1-MacBook-Pro.local... section_end:1656597864:prepare_script section_start:1656597864:get_sources Getting source from Git repository Fetching changes with git depth set to 50... Initialized empty Git repository in /Users/user1/builds/KHvHQX-g/0/Documents/myapp/.git/ Created fresh repository. Checking out 6f63cfb0 as chore/bddautomation... Skipping Git submodules setup section_end:1656598022:get_sources section_start:1656598022:step_script Executing "step_script" stage of the job script $ echo "Execute scripts on android" Execute scripts on android $ npm config set strict-ssl false $ npm config delete registry $ npm config set proxy $CODE_PROXY 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 $ npm config set https-proxy $CODE_PROXY 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 $ npm set chromedriver_cdnurl $npm_config_chromedriver_cdnurl $ npm config set registry [http://registry.npmjs.org/](http://registry.npmjs.org/%1B[0;m) $ export JAVA_HOME=$(/usr/libexec/java_home) $ export ANDROID_HOME=/Users/user1/Documents/sdk $ export PATH=$JAVA_HOME/bin:$PATH $ PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools $ cd bdd-appium-webdriverio-test $ npm i 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 uuid@3.4.0: 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 $ chmod 777 check_for_android_devices.sh $ ./check_for_android_devices.sh cannot connect to daemon at tcp:5037: Connection refused

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] 2022-06-30T14:07:49.007Z INFO @wdio/local-runner: 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] 2022-06-30T14:07:51.428Z INFO webdriver: Initiate new session using the WebDriver protocol [0-0] 2022-06-30T14:07:51.487Z INFO webdriver: [POST] http://localhost:9515/session [0-0] 2022-06-30T14:07:51.487Z INFO webdriver: DATA { [0-0] capabilities: { alwaysMatch: { browserName: 'chrome' }, firstMatch: [ {} ] }, [0-0] desiredCapabilities: { browserName: 'chrome' } [0-0] } [0-0] 2022-06-30T14:07:51.492Z INFO webdriver: Initiate new session using the WebDriver protocol [0-0] 2022-06-30T14:07:51.493Z INFO webdriver: [POST] http://localhost:4723/session [0-0] 2022-06-30T14:07:51.493Z INFO webdriver: DATA { [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] 2022-06-30T14:07:51.506Z ERROR webdriver: 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] 2022-06-30T14:07:51.506Z ERROR @wdio/runner: 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 section_start:1656598071:after_script Running after_script Running after script... $ cd bdd-appium-webdriverio-test $ npm run report

wdio7-appium-cucumber@1.0.0 report allure generate allure-results --clean

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

suaadBatis commented 1 year ago

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

selvaraj-kuppusamy commented 7 months ago

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