1.2.3: Appium reproducibly crashes on first startup, works subsequent times

Whenever I start the Appium server for the first time in a day, I get the below logs, and then my test fails because the driver can’t start. Subsequent runs (no code changes) work perfectly.

Is it because of --no-reset? I swore I had this issue when I was using --full-reset as well. (Would need to do additional testing to confirm)

I’m going to add some sort of retry to get around this, but is this a known issue?

Interesting snippet:

error: Failed to start an Appium session, err was: Error: Command failed: 
info: [debug] Error: Command failed: 
    at ChildProcess.exithandler (child_process.js:637:15)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: )","killed":true,"code":null,"signal":"SIGTERM","origValue":"Command failed: "},"sessionId":null}

Full logs:

info: Welcome to Appium v1.2.3 (REV 90d746b373f55e8653a251d2ce8c62df37941919)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"app":"/Users/jessicasachs/kinsa/automation-ios/buildOutput/KinsaNative-259-simulator.app","noReset":false}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"7.1","deviceName":"iPhone Simulator","platformName":"iOS","autoAcceptAlerts":true}}
info: [debug] Using local app from command line: /Users/jessicasachs/kinsa/automation-ios/buildOutput/KinsaNative-259-simulator.app
info: [debug] Creating new appium session 1a8f5344-3723-4595-b997-4c05dd24f494
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version
info: [debug] iOS SDK Version set to 7.1
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
error: Could not parse plist file (as binary) at /Users/jessicasachs/kinsa/automation-ios/buildOutput/KinsaNative-259-simulator.app/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
`parseFileSync()` is deprecated. Use `parseStringSync()` instead.
error: Could not parse plist file (as XML) at /Users/jessicasachs/kinsa/automation-ios/buildOutput/KinsaNative-259-simulator.app/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings
info: [debug] Not setting locale
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/jessicasachs/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/Cellar/node/0.10.26/bin/node","commandProxyClientPath":"/usr/local/avm/versions/1.2.3/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":true}
...o: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
info: [debug] Dynamic bootstrap path: /Users/jessicasachs/Library/Application Support/appium/bootstrap/bootstrap-93121a35aa200e9d.js
info: [debug] Reusing dynamic bootstrap: /Users/jessicasachs/Library/Application Support/appium/bootstrap/bootstrap-93121a35aa200e9d.js
info: [debug] Fixing device was changed from:"
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS 7.* simulator log capture
info: [debug] Killing the simulator process
info: [debug] Killing any other simulator daemons
info: [debug] Checking whether instruments supports our device string
info: [debug] Getting list of devices instruments supports
info: [debug] Instruments is at: /Applications/Xcode_5.app/Contents/Developer/usr/bin/instruments
info: [debug] Fixing device was changed from:"
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: 
info: [debug] Error: Command failed: 
    at ChildProcess.exithandler (child_process.js:637:15)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: )","killed":true,"code":null,"signal":"SIGTERM","origValue":"Command failed: "},"sessionId":null}

I’ve noticed the same bug, not sure what causes it.

Hmmph :frowning: I’ll keep my eyes open for a better test case.

Interesting, @bootstraponline
It happens every time on my jenkins box.
I wrapped my test runner in a try/except block, but yeah. It’s a thing that happens.

I suggest opening an issue on github.

1 Like

Hi,

I got the same issue on my Jenkins machine. Subsequent test runs fine.

Would you please let me know whether there’s workaround for this?

Thanks!
Yanming

I opened an issue on github, but nobody has looked at it yet.

@bootstraponline do you know if this will get looked at and prioritized?

I marked it as a bug so it’ll get looked at. The current focus is on iOS 8 support (appium 1.3). It’ll probably be after that.

1 Like

Scheduled for 1.3