{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/5318","labels_url":"https://api.github.com/repos/appium/appium/issues/5318/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/5318/comments","events_url":"https://api.github.com/repos/appium/appium/issues/5318/events","html_url":"https://github.com/appium/appium/issues/5318","id":92224116,"number":5318,"title":"Unhandled exception EPIPE","user":{"login":"chris1248","id":2918666,"avatar_url":"https://avatars.githubusercontent.com/u/2918666?v=3","gravatar_id":"","url":"https://api.github.com/users/chris1248","html_url":"https://github.com/chris1248","followers_url":"https://api.github.com/users/chris1248/followers","following_url":"https://api.github.com/users/chris1248/following{/other_user}","gists_url":"https://api.github.com/users/chris1248/gists{/gist_id}","starred_url":"https://api.github.com/users/chris1248/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris1248/subscriptions","organizations_url":"https://api.github.com/users/chris1248/orgs","repos_url":"https://api.github.com/users/chris1248/repos","events_url":"https://api.github.com/users/chris1248/events{/privacy}","received_events_url":"https://api.github.com/users/chris1248/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/appium/appium/labels/OnGoing","name":"OnGoing","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-30T23:26:58Z","updated_at":"2015-09-17T20:09:40Z","closed_at":null,"body":"So I was running some rspec tests again the IPad simulator using appium, when it crapped out on me with this cryptic message:\r\n\r\n`error: uncaughtException: write EPIPE date=Tue Jun 30 2015 17:07:45 GMT-0600 (MDT), pid=2348, uid=1465707852, gid=1095186886, cwd=/Users/cjohnson/code/appium, execPath=/usr/local/Cellar/node/0.12.4/bin/node, version=v0.12.4, argv=[node, /Users/cjohnson/code/appium/lib/server/main.js, --session-override], rss=259129344, heapTotal=131841792, heapUsed=67632848, loadavg=[5.27294921875, 3.24609375, 2.546875], uptime=633176, trace=[column=11, file=util.js, function=exports._errnoException, line=746, method=_errnoException, native=false, column=14, file=net.js, function=WriteWrap.afterWrite, line=775, method=afterWrite, native=false], stack=[Error: write EPIPE,     at exports._errnoException (util.js:746:11),     at WriteWrap.afterWrite (net.js:775:14)]`\r\n\r\nHopefully you guys can decipher that stuff.\r\n\r\nHere is the code I used to run it:\r\n\r\n    Capybara.register_driver(:appium) do |app|\r\n      # Set the ip address of the where the browser will navigate to\r\n      Capybara.app_host = ENV[\"BRIDGE_HOST\"]\r\n      # By default Capybara starts this web server listening to localhost only\r\n      # It is advised to force Capybara to listen to all interfaces\r\n      Capybara.server_host = \"0.0.0.0\"\r\n      # instead of using a random port, let's just use one we pick\r\n      Capybara.server_port = 5567\r\n      # To start the server, install the appium tools\r\n      # and start the Appium server with this url\r\n      url = \"http://0.0.0.0:4723/wd/hub\"\r\n    \r\n      # Setup the capabilities\r\n      desired_caps_ios = {\r\n        platform:        \"Mac\",\r\n        platformName:    \"iOS\",\r\n        platformVersion: \"8.3\",\r\n        browserName: \"Safari\",\r\n        noReset: false, # this\r\n        # fullReset: true # and this are mutually exclusive\r\n      }\r\n    \r\n      # For a list of devices we can assign for the :deviceName, See the documentation here:\r\n      # http://appium.io/slate/en/master/?ruby#server-flags\r\n      # specifically this command:\r\n      # instruments -s devices\r\n      desired_caps_ios[:deviceName] = case ENV[\"APPIUM_DEVICE\"]\r\n        when \"IPad\"\r\n          \"iPad Air\"\r\n        when \"IPhone\"\r\n          \"iPhone 6 Plus\"\r\n        else\r\n          \"iPad Air\"\r\n      end\r\n    \r\n      # See https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md\r\n      appium_lib_options = {\r\n        server_url:           url,\r\n        newCommandTimeout: 15, # How long (in seconds) Appium will wait for a new command from the client before assuming the client quit     and ending the session\r\n        showIOSLog: true, # Whether to show any logs captured from a device in the appium logs. Default false\r\n        webviewConnectRetries: 15, # Number of times to send connection message to remote debugger, to get webview. Default: 8\r\n        launchTimeout: 15 * 1000, # Amount of time in ms to wait for instruments before assuming it hung and failing the session\r\n        debug: false # uncomment to get a deluge of debugging messages\r\n      }\r\n      all_options = {\r\n        appium_lib:  appium_lib_options,\r\n        caps:        desired_caps_ios,\r\n      }\r\n    \r\n      Appium::Capybara::Driver.new app, all_options\r\n    end"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/141212527","html_url":"https://github.com/appium/appium/issues/5318#issuecomment-141212527","issue_url":"https://api.github.com/repos/appium/appium/issues/5318","id":141212527,"user":{"login":"jwallis","id":148590,"avatar_url":"https://avatars.githubusercontent.com/u/148590?v=3","gravatar_id":"","url":"https://api.github.com/users/jwallis","html_url":"https://github.com/jwallis","followers_url":"https://api.github.com/users/jwallis/followers","following_url":"https://api.github.com/users/jwallis/following{/other_user}","gists_url":"https://api.github.com/users/jwallis/gists{/gist_id}","starred_url":"https://api.github.com/users/jwallis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwallis/subscriptions","organizations_url":"https://api.github.com/users/jwallis/orgs","repos_url":"https://api.github.com/users/jwallis/repos","events_url":"https://api.github.com/users/jwallis/events{/privacy}","received_events_url":"https://api.github.com/users/jwallis/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T20:09:40Z","updated_at":"2015-09-17T20:09:40Z","body":"I can reproduce this pretty consistently if not 100%.  My app has a very large XML tree and after au.mainApp().getTreeForXML() logs the tree it dies:\r\n\r\n\r\ninfo: --> GET /wd/hub/session/8fe681a5-8428-4534-9822-108848f233c9/source {}\r\ninfo: [debug] Pushing command to appium work queue: \"au.mainApp().getTreeForXML()\"\r\ninfo: [debug] Sending command to instruments: au.mainApp().getTreeForXML()\r\ninfo: [debug] [INST] 2015-09-17 20:01:54 +0000 Debug: Got new command 51 from instruments: au.mainApp().getTreeForXML()\r\ninfo: [debug] [INST] 2015-09-17 20:01:54 +0000 Debug: evaluating au.mainApp().getTreeForXML()\r\ninfo: [debug] [INST] 2015-09-17 20:02:06 +0000 Fail: The target application appears to have died\r\ninfo: [debug] [INST STDERR] 2015-09-17 15:02:06.364 instruments[28048:996493] Attempting to set event horizon when core is not engaged, request ignored\r\ninfo: [debug] [INST] 2015-09-17 20:02:06 +0000 Debug: evaluation finished\r\ninfo: [debug] [INST] 2015-09-17 20:02:06 +0000 Debug: responding with:alid\":true,\"visible\":true,\"hint\":null,\"path\":\"/0/0\",\"x\":0,\"y\":0,\"width\":375,\"height\":667},\">\":[]}},{\"UIAWindow\":{\"@\":{\"name\":null,\"label\":null,\"value\":null,\"dom\":null,\"enabled\":true,\"valid\":true,\"visible\":true,\"hint\":null,\"path\":\"/0/1\",\"x\":0,\"y\":0.6875,\"width\":375,\"height\":665.625},\">\":[{\"UIAButton\":{\"@\":{\"name\":\"Cancel\",\"label\":\"Cancel\",\"value\":null,\"dom\":null,\"enabled\":true,\"vali\r\n\r\n...\r\n\r\ninfo: [debug] [INST] 2015-09-17 20:02:06 +0000 Debug: Running system command #52: /usr/local/Cellar/node/0.12.7_1/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{\"status\":0,\"value\":{\"UIAApplication\":{\"@\":{\"name\":\"my_app\",\"label\":\"my_app\",\"value\":null,\"dom\":null,\"enabled\":true,\"valid\":true,\"visible\":true,\"hint\":...\r\ninfo: [debug] Socket data being routed.\r\ninfo: [debug] Got null result from instruments\r\nerror: Couldn't parse result buffer: SyntaxError: Unexpected end of input\r\ninfo: [debug] Responding to client with error: {\"status\":13,\"value\":{\"message\":\"An unknown server-side error occurred while processing the command.\",\"origValue\":\"\\\"Error parsing socket data from instruments\\\"\"},\"sessionId\":\"8fe681a5-8428-4534-9822-108848f233c9\"}\r\ninfo: <-- GET /wd/hub/session/8fe681a5-8428-4534-9822-108848f233c9/source 500 11979.853 ms - 215 \r\ninfo: [debug] [INST] Instruments Trace Complete (Duration : 263.628479s; Output : /tmp/appium-instruments/instrumentscli0.trace)\r\ninfo: [debug] [INSTSERVER] Instruments exited with code 0\r\ninfo: [debug] Cleaning up after instruments exit\r\ninfo: [debug] Instruments exited unexpectedly\r\ninfo: [debug] Shutting down command proxy and ignoring any errors\r\ninfo: [debug] Destroying instruments client socket.\r\ninfo: [debug] Closing socket server.\r\ninfo: [debug] Instruments socket server was closed\r\ninfo: [debug] Stopping iOS log capture\r\ninfo: [debug] Running ios sim reset flow\r\ninfo: [debug] Killing the simulator process\r\ninfo: [debug] Killing any other simulator daemons\r\ninfo: [debug] Killall iOS Simulator\r\ninfo: [debug] Cleaning sim data files\r\ninfo: node-simctl: Executing: xcrun with args: simctl erase DB3378BA-5ACB-45C3-A61B-571223EC85C2 and timeout: 2000\r\ninfo: [debug] Cleaning app data files\r\nwarn: Applications directory /Users/me/Library/Developer/CoreSimulator/Devices/DB3378BA-5ACB-45C3-A61B-571223EC85C2/data/Containers/Data/Application doesn't exist. Have you run this simulator before?\r\nwarn: Applications directory /Users/me/Library/Developer/CoreSimulator/Devices/DB3378BA-5ACB-45C3-A61B-571223EC85C2/data/Containers/Bundle/Application doesn't exist. Have you run this simulator before?\r\ninfo: Couldn't find app directories to delete. Probably it's not installed\r\ninfo: [debug] Cleaning up appium session\r\n\r\n"}}