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
335 stars 102 forks source link

Unable to start Appium server for ios #672

Closed rajivnw closed 1 year ago

rajivnw commented 1 year ago

Appium version 2.0.0-beta.48

  1. I installed the plugins using below commands-:

appium plugin install --source=npm appium-device-farm appium plugin install --source=npm appium-dashboard

  1. Starting server using below config -:

    { "server": { "port": 31337, "plugin": { "device-farm": { "platform": "ios", "skipChromeDownload": true, "derivedDataPath": { "simulator": "/Users//Library/Developer/Xcode/DerivedData/WebDriverAgent-Test" } } } } }

    note: I created folder'WebDriverAgent-Test' under DerivedData. This was not exist earlier.

command I ran to start appium: appium server -ka 800 --use-plugins=device-farm,appium-dashboard --config -pa /wd/hub

Once I run the above command, I get an error and exited from terminal-:


[device-farm] Device Farm Plugin will served at http://localhost:31337/device-farm [Appium] Could not configure Appium server. It's possible that a driver or plugin tried to update the server and failed. Original Error: ENDET: no such file or directory, scandir './node_modules/go-ios/dist'

I installed 'go-ios' using NPM but still same issue persist.

saikrishna321 commented 1 year ago

@rajivnw Can you please provide full server logs

jorgoncalves commented 1 year ago

I'm also having the same issue. Updated to 5.2 yesterday.

This is the ouput of appium.log.

The terminal output looks like to have more info then appium.log.

rajivnw commented 1 year ago

appium server -ka 800 --use-plugins=device-farm,appium-dashboard --config server-config.json -pa /wd/hub

[Appium] Attempting to load plugin device-farm... [debug] [Appium] Requiring plugin at /Users/user/.appium/node_modules/appium-device-farm [Appium] Attempting to load plugin appium-dashboard... [debug] [Appium] Requiring plugin at /Users/user/.appium/node_modules/appium-dashboard [appium-dashboard] Unable to create adb instance. (node:1816) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit (Use node --trace-warnings ... to show where the warning was created) [Appium] Welcome to Appium v2.0.0-beta.48 [Appium] Non-default server args: [Appium] { [Appium] basePath: '/wd/hub', [Appium] keepAliveTimeout: 800, [Appium] port: 31337, [Appium] usePlugins: [ [Appium] 'device-farm', [Appium] 'appium-dashboard' [Appium] ] [Appium] } [device-farm] 📣📣📣 Device Farm Plugin will be served at 🔗 http://localhost:31337/device-farm uncaughtException: SQLITE_READONLY: attempt to write a readonly database Error: at Database. (/Users/user/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/dialects/sqlite/query.js:236:27) at /Users/user/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/dialects/sqlite/query.js:234:50 at new Promise () at Query.run (/Users/user/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/dialects/sqlite/query.js:234:12) at /Users/user/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/sequelize.js:650:28 at SQLiteQueryInterface.bulkUpdate (/Users/user/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/dialects/abstract/query-interface.js:930:12) at Function.update (/Users/user/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/model.js:3280:28) [Appium] Could not configure Appium server. It's possible that a driver or plugin tried to update the server and failed. Original error: ENOENT: no such file or directory, scandir './node_modules/go-ios/dist/' [debug] [Appium] Error: ENOENT: no such file or directory, scandir './node_modules/go-ios/dist/' [debug] [Appium] at Object.readdirSync (node:fs:1438:3) [debug] [Appium] at GoIosTracker. (/Users/user/.appium/node_modules/appium-device-farm/lib/device-managers/iOSTracker.js:32:40) [debug] [Appium] at Generator.next () [debug] [Appium] at /Users/user/.appium/node_modules/appium-device-farm/lib/device-managers/iOSTracker.js:8:71 [debug] [Appium] at new Promise () [debug] [Appium] at __awaiter (/Users/user/.appium/node_modules/appium-device-farm/lib/device-managers/iOSTracker.js:4:12) [debug] [Appium] at GoIosTracker.start (/Users/user/.appium/node_modules/appium-device-farm/lib/device-managers/iOSTracker.js:28:16) [debug] [Appium] at IOSDeviceManager. (/Users/user/.appium/node_modules/appium-device-farm/lib/device-managers/IOSDeviceManager.js:140:32) [debug] [Appium] at Generator.next () [debug] [Appium] at fulfilled (/Users/user/.appium/node_modules/appium-device-farm/lib/device-managers/IOSDeviceManager.js:5:58)

saikrishna321 commented 1 year ago

@rajivnw can you try without Appium-dashboard plugin?

@sudharsan-selvaraj

saikrishna321 commented 1 year ago

I can reproduce the folios issue. Will 🔧 it

saikrishna321 commented 1 year ago

@rajivnw @jorgoncalves can you try with latest version and let me know if this issue is resolved.

https://github.com/AppiumTestDistribution/appium-device-farm/releases/tag/5.3.0

outi5 commented 1 year ago

@rajivnw @jorgoncalves can you try with latest version and let me know if this issue is resolved.

https://github.com/AppiumTestDistribution/appium-device-farm/releases/tag/5.3.0

That worked for me @saikrishna321. Thanks!

rajivnw commented 1 year ago

@saikrishna321 its working for me. Thanks for a quick fix. Really appreciated!!

[Appium] - appium-dashboard@v2.0.2 (ACTIVE) No tvOS simulators found! No tvOS simulators found! No tvOS simulators found! No tvOS simulators found! No tvOS simulators found! [HTTP] --> GET /device-farm [HTTP] {} [HTTP] <-- GET /device-farm 301 26 ms - 189 [HTTP] [HTTP] --> GET /device-farm/ [HTTP] {} [HTTP] <-- GET /device-farm/ 200 19 ms - 713

rajivnw commented 1 year ago

@saikrishna321 quick check so we just need to provide http://localhost:31337/wd/hub as a grid URL, and it automatically route the tests to devices based on capabilities?

saikrishna321 commented 1 year ago

Yes ur right!

tking16 commented 1 year ago

I can see this issue on version 5.4.0, with or without Appium-dashboard, only works when --plugin-device-farm-platform is set to android, ios and both give

Could not configure Appium server. It's possible that a driver or plugin tried to update the server and failed. Original error: ENOENT: no such file or directory, scandir '/Users/tking16/node_modules/appium-device-farm/node_modules/go-ios/dist/

Edit: adding gist with more info https://gist.github.com/tking16/70e6943c22af5f9e555105298259b0bf

saikrishna321 commented 1 year ago

Can you uninstall and install the plugin

tking16 commented 1 year ago

Hi @saikrishna321 thanks for the response, doesn't help unfortunately, have tried many times, if it helps, here's what my devDependencies looks like

  "devDependencies": {
    "appium-dashboard": "2.0.2",
    "appium-device-farm": "^5.4.0",
    "appium-uiautomator2-driver": "^2.4.1",
    "appium-xcuitest-driver": "^4.7.0"
  }
saikrishna321 commented 1 year ago

Can you share a sample project to replicate this problem? @tking16

tking16 commented 1 year ago

I've added you as a collaborator to the sample project, let me know if it doens't work https://github.com/tking16/SampleProj-deviceFarm

There's a lot of noise in there, but the important command that should work is make appium

tking16 commented 1 year ago

@saikrishna321 Did you manage to reproduce the isseue?

saikrishna321 commented 1 year ago

@tking16 Sorry, I was not able to build your project. Has some python env issues. Can you provide a simple project please

tking16 commented 1 year ago

Hi @saikrishna321 that issue should be resolved now, sorry about that