appium / appium-inspector

A GUI inspector for mobile apps and more, powered by a (separately installed) Appium server
https://appium.github.io/appium-inspector/
Other
1.17k stars 289 forks source link

bug: Failed to create session. An unknown server-side error occurred while processing the command. #1367

Closed JakfarShodiq closed 8 months ago

JakfarShodiq commented 8 months ago

Is this an issue specifically with Appium Inspector?

Is there an existing issue for this?

Current Behavior

When starting the session with Appium Inspector on Mac the iOS simulator doesn't run, with an error message Failed to create session. An unknown server-side error occurred while processing the command. Original error: Device with udid 'AFEA9EAC-5F01-4A0E-8551-0AB3A41EE220' not yet created

Screenshot: Screenshot 2024-02-23 at 14 14 26

Expected Behavior

Can start session normally

Operating System

Mac

Appium Inspector Version

2024.2.2

Appium Version

2.5.0

Further Information

No response

eglitise commented 8 months ago

Please provide the Appium server log. Also check the output of xcrun xctrace list devices - is the simulator with that UDID present in the list?

JakfarShodiq commented 8 months ago

Hi @eglitise thank you for the response, this is from appium logs

[DevCon Factory] Neither device UDID nor local port is set. Did not know how to release the connection
[AppiumDriver@a93c] Event 'newSessionStarted' logged at 1708677796320 (15:43:16 GMT+0700 (Western Indonesia Time))
[AppiumDriver@a93c] Encountered internal error running command: Error: Device with udid '99F3B23A-6B8B-4E2E-8FD0-45D7817B2F6A' not yet created
[AppiumDriver@a93c]     at /Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/node_modules/node-simctl/lib/subcommands/create.js:112:11
[AppiumDriver@a93c]     at wrapped (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:93:13)
[AppiumDriver@a93c]     at retry (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:66:13)
[AppiumDriver@a93c]     at retryInterval (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/node_modules/asyncbox/lib/asyncbox.js:103:10)
[AppiumDriver@a93c]     at Simctl.createDevice (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/node_modules/node-simctl/lib/subcommands/create.js:97:3)
[AppiumDriver@a93c]     at createSim (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/lib/simulator-management.js:50:16)
[AppiumDriver@a93c]     at XCUITestDriver.createSim (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/lib/driver.js:1336:17)
[AppiumDriver@a93c]     at XCUITestDriver.determineDevice (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/lib/driver.js:1290:20)
[AppiumDriver@a93c]     at XCUITestDriver.start (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/lib/driver.js:480:40)
[AppiumDriver@a93c]     at XCUITestDriver.createSession (/Users/muhamadjakfars/Documents/Projects/TestAutomation/node_modules/appium-xcuitest-driver/lib/driver.js:400:7)
[AppiumDriver@a93c]     at AppiumDriver.createSession (/opt/homebrew/lib/node_modules/appium/lib/appium.js:717:35)

List device

TestAutomation xcrun xctrace list devices
== Devices ==
Jakfar MacBook Pro (89AE39D3-4E29-5A57-90CB-C124C931BB66)

== Simulators ==
iPad (10th generation) (17.0.1) (EF068F84-D4B9-4C0F-902B-3FF8910B6AF7)
iPad Air (5th generation) (17.0.1) (0AF8F315-817B-46AF-AA8F-FF454FCCA0F0)
iPad Pro (11-inch) (4th generation) (17.0.1) (F0E0E12C-C22B-484D-9BCC-AA5D713B0AA0)
iPad Pro (12.9-inch) (6th generation) (17.0.1) (40DB7117-EDB2-40AF-8620-1B1132EFFB2D)
iPad mini (6th generation) (17.0.1) (26405FF1-B466-4847-89C9-B10E330EF7AD)
iPhone 14 (17.0.1) (2BF116C4-16FB-4490-A952-609FE65321EA)
iPhone 14 Plus (17.0.1) (4D6350F1-BBCB-49AD-88DF-9CC91B3185A3)
iPhone 14 Pro (17.0.1) (69D74ECD-275D-41D3-8466-0213B915349D)
iPhone 14 Pro Max (17.0.1) (297B6FE2-42F5-4D57-B163-CAAA154B1737)
iPhone 15 (17.0.1) (A55EE4E4-9E27-4FE9-8E3E-896FF2D96DD6)
iPhone 15 Plus (17.0.1) (616D716A-E0B8-468F-B859-215CBC19BA3B)
iPhone 15 Pro (17.0.1) (82E56C24-49F7-4D77-AF5A-BEE7909ABD5A)
iPhone 15 Pro Max (17.0.1) (1894785C-41E8-4E15-ADAB-154723DC21F0)
iPhone SE (3rd generation) (17.0.1) (30CB29D3-2EEF-45C7-840E-7658E571A2CB)
eglitise commented 8 months ago

It seems like you don't have any installed simulators with iOS 17.0, only 17.0.1. Try changing appium:platformVersion to 17.0.1. If that doesn't help, please provide the full Appium server log.

JakfarShodiq commented 8 months ago

Hi @eglitise Previously, I gave iOS 17.0.1, but the error still appeared.

Screenshot 2024-02-23 at 16 33 51

"How can I print the complete Appium server logs?"

eglitise commented 8 months ago

Ok, then I would suggest to keep appium:platformVersion as 17.0 or remove it entirely, and use appium:udid with the simulator's UDID. You are already setting it in the above screenshot, but the capability is incorrectly named as appium:uuid.

A simple way to get the full logs is to print everything to a file (launch the server as appium >> logfile.log 2>&1)

JakfarShodiq commented 8 months ago

Hi @eglitise Still failed, I have updated the UDID and removed the capability, but the issue is still not resolved. I have attached the complete logs for reference. logile.log

I have no idea for this case hmm still searching for the solutions.

eglitise commented 8 months ago

One thing that seems odd about the log is that it lists the current user as root. Maybe you're running something in sudo mode?

JakfarShodiq commented 8 months ago

hi @eglitise issues SOLVED, My simulator is showing up perfectly. ohh man, thank you very much. I spend 2 days for this issues 🙏🏽 🙏🏽 When running Appium commands, I sometimes need to use 'sudo' mode, so I think all Appium commands require it 😲

Once again, thank you for your help

eglitise commented 8 months ago

Which commands require sudo for you? I've never encountered this. I think using Appium with sudo is generally discouraged anyway.

jlipps commented 8 months ago

Yes, avoid running in sudo at all costs.

Jenora1 commented 7 months ago

What did you do to fix the issue? I am having this exact problem. Thanks!

@JakfarShodiq

JakfarShodiq commented 7 months ago

What did you do to fix the issue? I am having this exact problem. Thanks!

@JakfarShodiq

Hi @Jenora1 simply remove sudo command. As the default appium command doesn't require it, there is no need for it.