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
324 stars 101 forks source link

We are getting AxiosxError while creating the session #1187

Open Jitu1888 opened 3 months ago

Jitu1888 commented 3 months ago

Describe the bug We are not able to start the session

Attached the log file. appium.log.txt

saikrishna321 commented 3 months ago

@Jitu1888 I don't see any errors related to device-farm in the logs

Jitu1888 commented 3 months ago

[AppiumDriver@702c] 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","appium-dashboard"]. [AppiumDriver@702c] Encountered internal error running command: Error: {"status":9,"value":{"error":"unknown command","message":"The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource","stacktrace":""}} at uT.generator (/Users/himanshu-tak/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/plugin.js:441:24) at Generator.throw () at uN (/Users/himanshu-tak/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/plugin.js:29:47) at processTicksAndRejections (node:internal/process/task_queues:95:5) [HTTP] <-- POST /session 500 126 ms - 960

Jitu1888 commented 3 months ago

With axios config: "{"method":"post","url":"http://devicelab4.games24x7.com:4723/wd/hub/session","timeout":60000,"httpAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"protocol":"http:","options":{"keepAlive":true,"keepAliveMsecs":60000,"noDelay":true,"path":null},"requests":{},"sockets":{},"freeSockets":{},"keepAliveMsecs":60000,"keepAlive":true,"maxSockets":null,"maxFreeSockets":256,"scheduling":"lifo","maxTotalSockets":null,"totalSocketCount":0},"httpsAgent":{"_events":{},"_eventsCount":2,"defaultPort":443,"protocol":"https:","options":{"rejectUnauthorized":false,"keepAlive":true,"keepAliveMsecs":60000,"noDelay":true,"path":null},"requests":{},"sockets":{},"freeSockets":{},"keepAliveMsecs":60000,"keepAlive":true,"maxSockets":null,"maxFreeSockets":256,"scheduling":"lifo","maxTotalSockets":null,"totalSocketCount":0,"maxCachedSessions":100,"_sessionCache":{"map":{},"list":[]}},"headers":{"Content-Type":"application/json"},"data":{"capabilities":{"firstMatch":[{}],"alwaysMatch":{"appium:adbExecTimeout":60000,"appium:appActivity":"com.games24x7.coregame.common.deeplink.DeepLinkActivity -e \"setup_string\" \"https://docker-ttycfj.fickle.rummycircle.com/\" -e \"build_mode\" \"BUILD_WITH_URL\" -e pocoEnvData \"{\\"serverIp\\": \\"192.168.110.14\\", \\"serverPort\\": \\"7273\\"}\"","appium:appPackage":"com.my11circle.android.stage","appium:appWaitForLaunch":false,"appium:autoAcceptAlerts":true,"appium:autoGrantPermissions":true,"appium:automationName":"UIAutomator2","appium:chromeOptions":{"w3c":false},"appium:enableMultiWindows":true,"appium:enableWebviewDetailsCollection":true,"appium:newCommandTimeout":1200,"appium:noReset":false,"appium:noSign":true,"appium:session-override":"true","appium:skipServerInstallation":false,"appium:uiautomator2ServerInstallTimeout":90000,"appium:uiautomator2ServerLaunchTimeout":90000,"appium:uninstallOtherPackages":"apps.rummycircle.com.mobilerummy.stage, com.games24x7.rummycircle.rummy.stage, apps.rummycircle.com.mobilerummy, com.games24x7.rummycircle.rummy, com.my11circle.android.stage, com.games24x7.my11circle.fantasycricket.stage, com.games24x7.my11circle.fantasycricket, com.pokercircle.android.stage, io.appium.uiautomator2.server, io.appium.uiautomator2.server.test","browserName":"","platformName":"ANDROID","appium:clearDeviceLogsOnStart":true,"appium:nativeWebScreenshot":true,"appium:mjpegServerPort":59191,"appium:pCloudy_DeviceVersion":"dummy","appium:pCloudy_DeviceManufacturer":"dummy","appium:udid":"P12289001284","appium:platform":"android","appium:pCloudy_DeviceFullName":"P12289001284"},"pendingSessionId":"2522d2f6-7c21-405e-b77e-d38116e65821"}}}" [device-farm-main] Received error from remote node: {"message":"Request failed with status code 404","name":"AxiosError","stack":"AxiosError: Request failed with status code 404\n at settle (/Users/himanshu-tak/.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (/Users/himanshu-tak/.appium/node_modules/appium-device-farm/node_modules/axios/lib/adapters/http.js:589: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/himanshu-tak/.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":60000,"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.2","Content-Length":"1694","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"http://devicelab4.games24x7.com:4723/wd/hub/session","httpAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"protocol":"http:","options":{"keepAlive":true,"keepAliveMsecs":60000,"noDelay":true,"path":null},"requests":{},"sockets":{},"freeSockets":{"devicelab4.games24x7.com:4723:":[{"connecting":false,"_hadError":false,"_parent":null,"_host":"devicelab4.games24x7.com","_closeAfterHandlingError":false,"_events":{"timeout":[null,null]},"_readableState":{"highWaterMark":65536,"buffer":[],"bufferIndex":0,"length":0,"pipes":[],"awaitDrainWriters":null},"_writableState":{"highWaterMark":65536,"length":0,"corked":0,"writelen":0,"bufferedIndex":0,"pendingcb":0},"allowHalfOpen":false,"_eventsCount":6,"_sockname":null,"_pendingData":null,"_pendingEncoding":"","server":null,"_server":null,"parser":null,"_httpMessage":null,"timeout":0}]},"keepAliveMsecs":60000,"keepAlive":true,"maxSockets":null,"maxFreeSockets":256,"scheduling":"lifo","maxTotalSockets":null,"totalSocketCount":1},"httpsAgent":{"_events":{},"_eventsCount":2,"defaultPort":443,"protocol":"https:","options":{"rejectUnauthorized":false,"keepAlive":true,"keepAliveMsecs":60000,"noDelay":true,"path":null},"requests":{},"sockets":{},"freeSockets":{},"keepAliveMsecs":60000,"keepAlive":true,"maxSockets":null,"maxFreeSockets":256,"scheduling":"lifo","maxTotalSockets":null,"totalSocketCount":0,"maxCachedSessions":100,"_sessionCache":{"map":{},"list":[]}},"data":"{\"capabilities\":{\"firstMatch\":[{}],\"alwaysMatch\":{\"appium:adbExecTimeout\":60000,\"appium:appActivity\":\"com.games24x7.coregame.common.deeplink.DeepLinkActivity -e \\"setup_string\\" \\"https://docker-ttycfj.fickle.rummycircle.com/\\" -e \\"build_mode\\" \\"BUILD_WITH_URL\\" -e pocoEnvData \\"{\\\\"serverIp\\\\": \\\\"192.168.110.14\\\\", \\\\"serverPort\\\\": \\\\"7273\\\\"}\\"\",\"appium:appPackage\":\"com.my11circle.android.stage\",\"appium:appWaitForLaunch\":false,\"appium:autoAcceptAlerts\":true,\"appium:autoGrantPermissions\":true,\"appium:automationName\":\"UIAutomator2\",\"appium:chromeOptions\":{\"w3c\":false},\"appium:enableMultiWindows\":true,\"appium:enableWebviewDetailsCollection\":true,\"appium:newCommandTimeout\":1200,\"appium:noReset\":false,\"appium:noSign\":true,\"appium:session-override\":\"true\",\"appium:skipServerInstallation\":false,\"appium:uiautomator2ServerInstallTimeout\":90000,\"appium:uiautomator2ServerLaunchTimeout\":90000,\"appium:uninstallOtherPackages\":\"apps.rummycircle.com.mobilerummy.stage, com.games24x7.rummycircle.rummy.stage, apps.rummycircle.com.mobilerummy, com.games24x7.rummycircle.rummy, com.my11circle.android.stage, com.games24x7.my11circle.fantasycricket.stage, com.games24x7.my11circle.fantasycricket, com.pokercircle.android.stage, io.appium.uiautomator2.server, io.appium.uiautomator2.server.test\",\"browserName\":\"\",\"platformName\":\"ANDROID\",\"appium:clearDeviceLogsOnStart\":true,\"appium:nativeWebScreenshot\":true,\"appium:mjpegServerPort\":59191,\"appium:pCloudy_DeviceVersion\":\"dummy\",\"appium:pCloudy_DeviceManufacturer\":\"dummy\",\"appium:udid\":\"P12289001284\",\"appium:platform\":\"android\",\"appium:pCloudy_DeviceFullName\":\"P12289001284\"},\"pendingSessionId\":\"2522d2f6-7c21-405e-b77e-d38116e65821\"}}"},"code":"ERR_BAD_REQUEST","status":404} [device-farm-main] 📱 2522d2f6-7c21-405e-b77e-d38116e65821 Session response: {} [device-farm-main] 📱 Removing pending session with capability_id: 2522d2f6-7c21-405e-b77e-d38116e65821 [device-farm-main] Error while creating session: {"status":9,"value":{"error":"unknown command","message":"The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource","stacktrace":""}} [device-farm-main] 2522d2f6-7c21-405e-b77e-d38116e65821 📱 Device UDID 032dc08b-3913-42d0-960a-759123a714ad unblocked. Reason: Failed to create session

saikrishna321 commented 3 months ago

"code":"ERR_BAD_REQUEST","status":404}

@Jitu1888 Can you help see what is the right arguments that needs to be sent to pCloudy?

Jitu1888 commented 3 months ago

@saikrishna321 We have our own device lab we are just passing the pCloudy as argv for device udid and name with devicelab.com:4723 where appium is running

saikrishna321 commented 3 months ago

@Jitu1888 Check pCloudy logs.

Jitu1888 commented 3 months ago

@saikrishna321 We have built an inhouse device lab and where devices are connected to that system. We are running Automation ATD Farmework which run Appium with case URL /wd/hub but the appium server running on devicelab is without /wd/hub. That might be the issue right

saikrishna321 commented 3 months ago

@Jitu1888 That will affect. I remember we fixing this issue at the plugin side. Also I have not tested the latest plugin with the latest commit in ATD.

It will be great if you tested the latest ATD and plugin and if any issues. Feel free to raise PR. Will merge