Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create session through device farm getting AxiosError after setup is done #1433

Open
VyshnaviNagaruru opened this issue Oct 28, 2024 · 11 comments

Comments

@VyshnaviNagaruru
Copy link

VyshnaviNagaruru commented Oct 28, 2024

Issue Details

Installed latest appium version 2.12.1 and device farm plugin 9.4.5. Started appium server with appium device farm plugin enabled.
Connected to local host device farm URL (http://localhost:4723/device-farm/).
When I clicked on Use Device for available devices, unable to create session got below error.

Logs

[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/.../.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (/Users/.../.appium/node_modules/appium-device-farm/node_modules/axios/lib/adapters/http.js:599:11)\n at IncomingMessage.emit (node:events:532:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (/Users/nagaruru.vyshnavi/.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/Axios.js:45:41)\n at processTicksAndRejections (node:internal/process/task_queues:95: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.7","Content-Length":"555","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"http://127.0.0.1:4723/wd/hub/session","data":"{\"capabilities\":{\"alwaysMatch\":{\"platformName\":\"android\",\"appium:automationName\":\"UIAutomator2\",\"appium:newCommandTimeout\":120,\"appium:waitForIdleTimeout\":10,\"appium:udid\":\"RZ8N800R06E\",\"df:skipReport\":true,\"appium:systemPort\":54035,\"appium:adbExecTimeout\":80000,\"appium:uiautomator2ServerLaunchTimeout\":60000},\"firstMatch\":[{}]},\"desiredCapabilities\":{\"platformName\":\"android\",\"appium:automationName\":\"UIAutomator2\",\"appium:newCommandTimeout\":120,\"appium:waitForIdleTimeout\":10,\"appium:udid\":\"RZ8N800R06E\",\"df:skipReport\":true,\"appium:systemPort\":54035}}"},"code":"ERR_BAD_RESPONSE","status":500}
[HTTP] <-- POST /device-farm/api/dashboard/appiumSession 400 1107 ms - 886

Version Details
npm version - 10.8.1
node version - v22.4.1
appium version - v2.12.1
device farm plugin - v9.4.5

@erdncyz
Copy link
Contributor

erdncyz commented Oct 28, 2024

Hi @VyshnaviNagaruru,

Can you try below command and try again please ?

appium plugin run device-farm reset

@VyshnaviNagaruru
Copy link
Author

Hi @erdncyz

Tried this command appium plugin run device-farm reset, but getting same error

[AppiumDriver@14d4] 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@14d4] The thrown error object does not seem to be a valid instance of the Error class. This might be a genuine bug of a driver or a plugin.
[AppiumDriver@14d4] Encountered internal error running command: undefined
[HTTP] <-- POST /wd/hub/session 500 1254 ms - 855
[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/.../.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (/Users/.../.appium/node_modules/appium-device-farm/node_modules/axios/lib/adapters/http.js:599:11)\n at IncomingMessage.emit (node:events:532:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (/Users/.../.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/Axios.js:45:41)\n at processTicksAndRejections (node:internal/process/task_queues:95: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.7","Content-Length":"555","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"http://127.0.0.1:4723/wd/hub/session","data":"{\"capabilities\":{\"alwaysMatch\":{\"platformName\":\"android\",\"appium:automationName\":\"UIAutomator2\",\"appium:newCommandTimeout\":120,\"appium:waitForIdleTimeout\":10,\"appium:udid\":\"RZ8N800R06E\",\"df:skipReport\":true,\"appium:systemPort\":55789,\"appium:adbExecTimeout\":80000,\"appium:uiautomator2ServerLaunchTimeout\":60000},\"firstMatch\":[{}]},\"desiredCapabilities\":{\"platformName\":\"android\",\"appium:automationName\":\"UIAutomator2\",\"appium:newCommandTimeout\":120,\"appium:waitForIdleTimeout\":10,\"appium:udid\":\"RZ8N800R06E\",\"df:skipReport\":true,\"appium:systemPort\":55789}}"},"code":"ERR_BAD_RESPONSE","status":500}

@erdncyz
Copy link
Contributor

erdncyz commented Oct 28, 2024

Did you open develeoper mode on your devices ? ı think that this issue deal with your devices or your devices connection.

@VyshnaviNagaruru
Copy link
Author

Developer Options are enabled and able to perform execution with appium.
Issue is observed only when appium server started with appium device farm plugin. Unable to create session from appium device farm local host.

@erdncyz
Copy link
Contributor

erdncyz commented Oct 28, 2024

What is your device os version

@saikrishna321
Copy link
Member

@VyshnaviNagaruru please provide full server logs

@VyshnaviNagaruru
Copy link
Author

VyshnaviNagaruru commented Oct 30, 2024

ServerLogs.txt
Please find the logs.
@saikrishna321 .
For all devices same issue is observed. Currently version 12 I'm using.

@erdncyz
Copy link
Contributor

erdncyz commented Oct 30, 2024

Hi @VyshnaviNagaruru,

Appium device-farm stream (Screen 2) is installed for your devices ? İf not can you check screen 1 settings in Developer mode page

Screen 1
image

Screen 2
image

@VyshnaviNagaruru
Copy link
Author

@erdncyz Appium Device Farm is not installed in my device, but option shared in screen 1 is enabled (Verify Apps over USB)

@erdncyz
Copy link
Contributor

erdncyz commented Oct 30, 2024

Hi @VyshnaviNagaruru

can you try install manually please and then try again? Can you install in "https://github.com/AppiumTestDistribution/appium-device-farm/blob/main/device-farm.apk" here. We can understand problem deal with this issue.

@VyshnaviNagaruru
Copy link
Author

@erdncyz
Installed device-farm.apk manually and started server, still same issue is observed it is not communicating with apk installed in device.

Error Logs:

[device-farm-main] Streaming apk not present, so downloading..
[AppiumDriver@ae8d] 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@ae8d] The thrown error object does not seem to be a valid instance of the Error class. This might be a genuine bug of a driver or a plugin.
[AppiumDriver@ae8d] Encountered internal error running command: undefined
[HTTP] <-- POST /wd/hub/session 500 257 ms - 855
[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/nagaruru.vyshnavi/.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (/Users/nagaruru.vyshnavi/.appium/node_modules/appium-device-farm/node_modules/axios/lib/adapters/http.js:599:11)\n at IncomingMessage.emit (node:events:532:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (/Users/nagaruru.vyshnavi/.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/Axios.js:45:41)\n at processTicksAndRejections (node:internal/process/task_queues:95: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.7","Content-Length":"555","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"http://127.0.0.1:4723/wd/hub/session","data":"{\"capabilities\":{\"alwaysMatch\":{\"platformName\":\"android\",\"appium:automationName\":\"UIAutomator2\",\"appium:newCommandTimeout\":120,\"appium:waitForIdleTimeout\":10,\"appium:udid\":\"RZ8N800R06E\",\"df:skipReport\":true,\"appium:systemPort\":55532,\"appium:adbExecTimeout\":80000,\"appium:uiautomator2ServerLaunchTimeout\":60000},\"firstMatch\":[{}]},\"desiredCapabilities\":{\"platformName\":\"android\",\"appium:automationName\":\"UIAutomator2\",\"appium:newCommandTimeout\":120,\"appium:waitForIdleTimeout\":10,\"appium:udid\":\"RZ8N800R06E\",\"df:skipReport\":true,\"appium:systemPort\":55532}}"},"code":"ERR_BAD_RESPONSE","status":500}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants