Skip to content

compatible issue with appium 2.19 #1868

@Johnny987

Description

@Johnny987

Describe the bug

  1. launched appium with device-farm plugin
  2. opened http://127.0.0.1:4723/device-farm page, my device is listed in the page
  3. failed to connect any devices listed in the page
Image

Link to Appium logs

[HTTP] --> POST /wd/hub/session {"capabilities":{"alwaysMatch":{"platformName":"iOS","appium:automationName":"XCUITest","appium:udid":"B4D50515-210A-425F-A4FF-3E15AC404F91","df:filterByHost":"http://192.168.31.243:4723","df:skipReport":true,"df:liveVideo":true,"appium:mjpegServerPort":54370,"appium:waitForQuiescence":false,"appium:wdaEventloopIdleDelay":0,"appium:eventLoopIdleDelaySec":0,"appium:waitForIdleTimeout":0,"appium:skipLogCapture":true,"appium:settings":{"mjpegServerFramerate":10,"mjpegServerScreenshotQuality":0,"mjpegScalingFactor":50,"animationCoolOffTimeout":0}},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"iOS","appium:automationName":"XCUITest","appium:udid":"B4D50515-210A-425F-A4FF-3E15AC404F91","df:filterByHost":"http://192.168.31.243:4723","df:skipReport":true,"df:liveVideo":true,"appium:mjpegServerPort":54370,"appium:waitForQuiescence":false,"appium:wdaEventloopIdleDelay":0,"appium:eventLoopIdleDelaySec":0,"appium:waitForIdleTimeout":0,"appium:skipLogCapture":true,"appium:settings":{"mjpegServerFramerate":1...
[device-farm-main] Received non-webdriver request with url /wd/hub/session. So, not proxying it to downstream.
[HTTP] No route found for /wd/hub/session
[HTTP] <-- POST /wd/hub/session 404 1 ms - 211 
[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/yan/node_modules/axios/lib/core/settle.js:19:12)\n    at IncomingMessage.handleStreamEnd (/Users/yan/node_modules/axios/lib/adapters/http.js:599:11)\n    at IncomingMessage.emit (node:events:529:35)\n    at endReadableNT (node:internal/streams/readable:1400:12)\n    at processTicksAndRejections (node:internal/process/task_queues:82:21)\n    at Axios.request (/Users/yan/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.9.0","Content-Length":"1110","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"http://127.0.0.1:4723/wd/hub/session","data":"{\"capabilities\":{\"alwaysMatch\":{\"platformName\":\"iOS\",\"appium:automationName\":\"XCUITest\",\"appium:udid\":\"B4D50515-210A-425F-A4FF-3E15AC404F91\",\"df:filterByHost\":\"http://192.168.31.243:4723\",\"df:skipReport\":true,\"df:liveVideo\":true,\"appium:mjpegServerPort\":54370,\"appium:waitForQuiescence\":false,\"appium:wdaEventloopIdleDelay\":0,\"appium:eventLoopIdleDelaySec\":0,\"appium:waitForIdleTimeout\":0,\"appium:skipLogCapture\":true,\"appium:settings\":{\"mjpegServerFramerate\":10,\"mjpegServerScreenshotQuality\":0,\"mjpegScalingFactor\":50,\"animationCoolOffTimeout\":0}},\"firstMatch\":[{}]},\"desiredCapabilities\":{\"platformName\":\"iOS\",\"appium:automationName\":\"XCUITest\",\"appium:udid\":\"B4D50515-210A-425F-A4FF-3E15AC404F91\",\"df:filterByHost\":\"http://192.168.31.243:4723\",\"df:skipReport\":true,\"df:liveVideo\":true,\"appium:mjpegServerPort\":54370,\"appium:waitForQuiescence\":false,\"appium:wdaEventloopIdleDelay\":0,\"appium:eventLoopIdleDelaySec\":0,\"appium:waitForIdleTimeout\":0,\"appium:skipLogCapture\":true,\"appium:settings\":{\"mjpegServerFramerate\":10,\"mjpegServerScreenshotQuality\":0,\"mjpegScalingFactor\":50,\"animationCoolOffTimeout\":0}}}","allowAbsoluteUrls":true},"code":"ERR_BAD_REQUEST","status":404}

Environment

  1. Appium version (or git revision) that exhibits the issue: v2.19
  2. Last Appium version that did not exhibit the issue (if applicable):
  3. Node.js version (unless using Appium.app|exe):v18.20.7
  4. Npm or Yarn package manager: npm 10.8.2
  5. Mobile platform/version under test: Android 13 and iOS simulater
  6. Real device or emulator/simulator: both not work
  7. Appium CLI or Appium.app|exe: appium cli

Cause: It's a compatible issue for appium 2.19:
The problem is that the device farm 10.x dashboard is trying to create sessions at /wd/hub/session but my Appium server expects sessions at /session. This is because:
Appium 2.x uses /session as the default endpoint
The device farm dashboard (v10.2.0) might be configured to use the old /wd/hub/session endpoint

WORKAROUND: If I manually set appium base-path to /wd/hub it will work:
appium server --base-path /wd/hub --use-plugins=device-farm --use-drivers=uiautomator2,xcuitest --plugin-device-farm-platform=both --plugin-device-farm-enable-dashboard

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions