AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Other
328 stars 102 forks source link

Not able to access remote real device from hub #1417

Open Al-Fareed opened 13 hours ago

Al-Fareed commented 13 hours ago

Able to connect real device to Node Able to view the dashboard of appium device farm, where all the devices are listed When clicked on use device, It throws error

Error from api: {"value":{"error":"unknown error","message":"An unknown server-side error occurred while processing the command. Original error: Unknown error while creating session","stacktrace":"UnknownError: An unknown server-side error occurred while processing the command. Original error: Unknown error while creating session\n at getResponseForW3CError (/opt/homebrew/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1145:9)\n at asyncHandler (/opt/homebrew/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:485:57)"}}

Error logged in Terminal: Error while creating session: undefined [device-farm-main] :iphone: 778b7282-a157-496b-a293-251730268cae Session response: {} [device-farm-main] :iphone: Removing pending session with capability_id: 778b7282-a157-496b-a293-251730268cae [device-farm-main] Unable to unblock device. Reason: Error: EACCES: permission denied, open '/Users/test/.cache/appium-device-farm/storage/99697ffc15980553eab86c4224dfe4a3' [device-farm-main] 778b7282-a157-496b-a293-251730268cae :iphone: Device UDID 2fb01d2e unblocked. Reason: Failed to create session [AppiumDriver@9b6c] Command 'createSession' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command was handled by these: ["device-farm"]. [AppiumDriver@9b6c] Encountered internal error running command: Error: Unknown error while creating session at Wu.generator (/Users/test/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/plugin.js:446:24) at Generator.throw () at WC (/Users/test/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/plugin.js:29:47) [HTTP] <-- POST /wd/hub/session 500 60036 ms - 578 [device-farm-main] Received error from remote node: {"message":"Request failed with status code 500","name":"AxiosError","stack":"AxiosError: Request failed with status code 500\n at settle (/Users/test/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (/Users/test/node_modules/axios/lib/adapters/http.js:599:11)\n at IncomingMessage.emit (node:events:531:35)\n at endReadableNT (node:internal/streams/readable:1698:12)\n at processTicksAndRejections (node:internal/process/task_queues:90:21)\n at Axios.request (/Users/test/node_modules/axios/lib/core/Axios.js:45:41)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http","fetch"],"transformRequest":[null],"transformResponse":[null],"timeout":260000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/json","User-Agent":"axios/1.7.4","Content-Length":"549","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"http://127.0.0.1:31337/wd/hub/session","data":"{\"capabilities\":{\"alwaysMatch\":{\"platformName\":\"android\",\"appium:automationName\":\"UIAutomator2\",\"appium:newCommandTimeout\":120,\"appium:waitForIdleTimeout\":10,\"appium:udid\":\"2fb01d2e\",\"df:skipReport\":true,\"appium:systemPort\":51824,\"appium:adbExecTimeout\":80000,\"appium:uiautomator2ServerLaunchTimeout\":60000},\"firstMatch\":[{}]},\"desiredCapabilities\":{\"platformName\":\"android\",\"appium:automationName\":\"UIAutomator2\",\"appium:newCommandTimeout\":120,\"appium:waitForIdleTimeout\":10,\"appium:udid\":\"2fb01d2e\",\"df:skipReport\":true,\"appium:systemPort\":51824}}"},"code":"ERR_BAD_RESPONSE","status":500} [HTTP] <-- POST /device-farm/api/dashboard/appiumSession 400 60046 ms - 608 [HTTP] --> POST /device-farm/api/unblock {"udid":"2fb01d2e","host":"http://192.168.1.150:4723/"} [device-farm-main] Received non-webdriver request with url /device-farm/api/unb

sudharsan-selvaraj commented 12 hours ago

@Al-Fareed Can you try starting the appium server with sudo?

Tejas5657 commented 11 hours ago

we are trying out the remote control of the real device can you share any doc to achieve that

Tejas5657 commented 11 hours ago

our requirement is devices hub which has real devices need to controlled from anywhere we tried with execution test cases it works but with the manual interaction getting appium session error

saikrishna321 commented 9 hours ago

@Tejas5657 can you create a new issue with full server logs pls