question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appium crashes on install_app (uncaughtException: write EPIPE) 1.16.0-beta.3

See original GitHub issue

The problem

After install_app failed due to timeout, it was retried, then appium crashed with:

2019-12-19 02:48:58:423 - uncaughtException: write EPIPE
Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:16)

Environment

  • Appium version (or git revision) that exhibits the issue: 1.16.0-beta.3
  • Last Appium version that did not exhibit the issue (if applicable): 1.14.1
  • Desktop OS/version used to run Appium: OSX 10.14.6
  • Node.js version (unless using Appium.app|exe): 12.10.0
  • Npm or Yarn package manager: npm 6.13.4
  • Mobile platform/version under test: iPhone 13.3
  • Real device or emulator/simulator: Real device
  • Appium CLI or Appium.app|exe: cli

Details

First install_app failure:

Install app failed the first time on what should have been fixed with new xcuitest-driver

vr-qa05:00008020-XXXXXXXX jenkins$ npm ls appium-xcuitest-driver
/Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX
└─┬ appium@1.16.0-beta.3
  ├─┬ appium-flutter-driver@0.0.20
  │ └── appium-xcuitest-driver@2.133.1  extraneous
  ├── appium-xcuitest-driver@3.10.1 
  └─┬ appium-youiengine-driver@1.2.3
    └── appium-xcuitest-driver@3.10.1  deduped

npm ERR! extraneous: appium-xcuitest-driver@2.133.1 /Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/node_modules/appium-flutter-driver/node_modules/appium-xcuitest-driver
vr-qa05:00008020-XXXXXXXX jenkins$ 
2019-12-19 02:47:54:110 - [XCUITest] Installing '/var/folders/ll/brhhr98d59j9yjzm3fmjbssw0000gp/T/20191118-30206-120p125.yhzzh/Payload/MyCompany.app' to the real device with UDID 00008020-XXXXXXXX
2019-12-19 02:47:54:829 - [XCUITest] Falling back to ios-deploy usage
2019-12-19 02:47:54:830 - [XCUITest] Error: Unexpected response OBJECT_NOT_FOUND
2019-12-19 02:47:54:830 - [XCUITest]     at AfcService._checkStatus (/Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/node_modules/appium/node_modules/appium-ios-device/lib/afc/index.js:271:13)
2019-12-19 02:47:54:830 - [XCUITest]     at AfcService.openFile (/Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/node_modules/appium/node_modules/appium-ios-device/lib/afc/index.js:118:12)
2019-12-19 02:47:54:830 - [XCUITest]     at AfcService.createWriteStream (/Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/node_modules/appium/node_modules/appium-ios-device/lib/afc/index.js:131:24)
2019-12-19 02:47:54:830 - [XCUITest]     at /Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/node_modules/appium/node_modules/appium-xcuitest-driver/lib/ios-deploy.js:95:31
2019-12-19 02:47:54:830 - [XCUITest]     at /Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-support/lib/fs.js:97:47

finally:

2019-12-19 02:48:17:487 - [HTTP] --> POST /wd/hub/session/05e3c4b1-4fa9-4d20-9110-99e117092c84/appium/device/install_app
2019-12-19 02:48:17:487 - [HTTP] {"appPath":"http://myserver.com:8000/files/mycompany-prerelease-1-34.7-191223018.ipa"}
2019-12-19 02:48:17:487 - [debug] [W3C (05e3c4b1)] Calling AppiumDriver.installApp() with args: ["http://myserver.com:8000/files/mycompany-prerelease-1-34.7-191223018.ipa",null,null,null,"05e3c4b1-4fa9-4d20-9110-99e117092c84"]
2019-12-19 02:48:17:488 - [debug] [XCUITest] Executing command 'installApp'
2019-12-19 02:48:17:488 - [BaseDriver] Using downloadable app 'http://myserver.com:8000/files/mycompany-prerelease-1-34.7-191223018.ipa'
2019-12-19 02:48:17:493 - [debug] [BaseDriver] App Last-Modified: Wed, 18 Dec 2019 02:00:21 GMT
2019-12-19 02:48:17:494 - [BaseDriver] Reusing previously downloaded application at '/var/folders/ll/brhhr98d59j9yjzm3fmjbssw0000gp/T/20191118-30206-120p125.yhzzh/Payload/MyCompany.app'
2019-12-19 02:48:17:494 - [XCUITest] Installing '/var/folders/ll/brhhr98d59j9yjzm3fmjbssw0000gp/T/20191118-30206-120p125.yhzzh/Payload/MyCompany.app' to the real device with UDID 00008020-XXXXXXXX
2019-12-19 02:48:58:423 - uncaughtException: write EPIPE
Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:87:16)
2019-12-19 02:48:59:881 - [BaseDriver] Shutting down because we waited 100 seconds for a command
2019-12-19 02:48:59:882 - [Appium] Closing session, cause was 'New Command Timeout of 100 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'
2019-12-19 02:48:59:882 - [Appium] Removing session '0b4e5a65-9162-409a-933c-9eb9b0e8ca59' from our master session list
2019-12-19 02:48:59:882 - [DevCon Factory] Releasing connections for 00008020-XXXXXXXX device on any port number
2019-12-19 02:48:59:883 - [DevCon Factory] Found cached connections to release: ["00008020-XXXXXXXX:7848"]
2019-12-19 02:48:59:883 - [DevCon Factory] Releasing the listener for '00008020-XXXXXXXX:7848'
2019-12-19 02:48:59:885 - [debug] [DevCon Factory] Cached connections count: 0
2019-12-19 02:49:01:426 - [BaseDriver] The application 'http://myserver.com:8000/files/mycompany-prerelease-1-34.7-191223018.ipa' cached at '/var/folders/ll/brhhr98d59j9yjzm3fmjbssw0000gp/T/20191118-30206-120p125.yhzzh/Payload/MyCompany.app' has expired after 86400000ms
2019-12-19 02:49:01:427 - [debug] [BaseDriver] Performing cleanup of 1 cached application

Code To Reproduce Issue [ Good To Have ]

Using selenium grid Multiple phones on the same machine running multiple instances of appium.

Creation of sessions just open up the ios Settings app, uninstall all other versions / packages of our app, then call install_app with our test app.

Appium log startup

NOTE: The appium.log file is currently 5.3MB, so pretty large. Here’s the startup data:

2019-12-18 19:32:25:605 - [Appium] Welcome to Appium v1.16.0-beta.3
2019-12-18 19:32:25:607 - [Appium] Non-default server args:
2019-12-18 19:32:25:610 - [Appium]   port: 4848
2019-12-18 19:32:25:610 - [Appium]   callbackPort: 4849
2019-12-18 19:32:25:611 - [Appium]   sessionOverride: true
2019-12-18 19:32:25:612 - [Appium]   logTimestamp: true
2019-12-18 19:32:25:613 - [Appium]   logNoColors: true
2019-12-18 19:32:25:613 - [Appium]   nodeconfig: /Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/selenium-conf.json
2019-12-18 19:32:25:613 - [Appium]   debugLogSpacing: true
2019-12-18 19:32:25:613 - [Appium]   defaultCapabilities: {
2019-12-18 19:32:25:613 - [Appium]     deviceName: 00008020-XXXXXXXX
2019-12-18 19:32:25:613 - [Appium]     udid: 00008020-XXXXXXXX
2019-12-18 19:32:25:614 - [Appium]     systemPort: 7848
2019-12-18 19:32:25:614 - [Appium]     wdaLocalPort: 7848
2019-12-18 19:32:25:614 - [Appium]     webkitDebugProxyPort: 9848
2019-12-18 19:32:25:614 - [Appium]     startIWDP: true
2019-12-18 19:32:25:614 - [Appium]     useXctestrunFile: true
2019-12-18 19:32:25:614 - [Appium]     bootstrapPath: /Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/wda
2019-12-18 19:32:25:614 - [Appium]   }
2019-12-18 19:32:25:615 - [Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
2019-12-18 19:32:25:616 - [Appium]   deviceName: 00008020-XXXXXXXX
2019-12-18 19:32:25:616 - [Appium]   udid: 00008020-XXXXXXXX
2019-12-18 19:32:25:616 - [Appium]   systemPort: 7848
2019-12-18 19:32:25:616 - [Appium]   wdaLocalPort: 7848
2019-12-18 19:32:25:616 - [Appium]   webkitDebugProxyPort: 9848
2019-12-18 19:32:25:617 - [Appium]   startIWDP: true
2019-12-18 19:32:25:617 - [Appium]   useXctestrunFile: true
2019-12-18 19:32:25:617 - [Appium]   bootstrapPath: /Users/jenkins/build_tools/ios_phone/00008020-XXXXXXXX/wda
2019-12-18 19:32:25:645 - [debug] [Appium] Starting auto register thread for grid. Will try to register every 5000 ms.
2019-12-18 19:32:25:646 - [Appium] Appium REST http interface listener started on 0.0.0.0:4848
2019-12-18 19:32:30:709 - [debug] [Appium] Appium successfully registered with the grid on http://myserver.com:4444

Session creation:

2019-12-19 02:47:25:247 - [HTTP] --> POST /wd/hub/session
2019-12-19 02:47:25:247 - [HTTP] {"desiredCapabilities":{"server:CONFIG_UUID":"60fcbf6d-8a2a-4405-8cf8-00212e4a25a9","simpleIsVisibleCheck":true,"noReset":false,"deviceName":"*","xcodeSigningId":"iPhone Developer","mycompany:node.defaultDevice":true,"mycompany:testng.session.hash":"ae0a01ed-69ef-47f7-9327-22908bc9ef36","newCommandTimeout":100,"platformVersion":"13.3","automationName":"XCuiTest","browserName":"","mycompany:testng.hostname":"mycompany.com","platformName":"ios","preventWDAAttachments":true,"mycompany:testng.jenkins.build":"1131","xcodeOrgId":"TEAM_ID","bundleId":"com.apple.Preferences",mycompany:testng.suite":"Attractions Native Core Ios","updatedWDABundleId":"com.mycompany.qa.WebDriverAgentRunner","mycompany:testng.jenkins.jobname":"qa-mobile-exp-core-ios","sendKeyStrategy":"grouped","mycompany:node.platformType":"Phone","mycompany:testng.test":"testAttractionsGoodPromoCode","useNewWDA":true},"capabilities":{"firstMatch":[{"browserName":"","platformName":"ios","serve
2019-12-19 02:47:25:247 - [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"server:CONFIG_UUID":"60fcbf6d-8a2a-4405-8cf8-00212e4a25a9","simpleIsVisibleCheck":true,"noReset":false,"deviceName":"*","xcodeSigningId":"iPhone Developer","mycompany:node.defaultDevice":true,"mycompany:testng.session.hash":"ae0a01ed-69ef-47f7-9327-22908bc9ef36","newCommandTimeout":100,"platformVersion":"13.3","automationName":"XCuiTest","browserName":"","mycompany:testng.hostname":"mycompany.com","platformName":"ios","preventWDAAttachments":true,"mycompany.jenkins.build":"1131","xcodeOrgId":"TEAM_ID","bundled":"com.apple.Preferences","mycompany.suite":"Attractions Native Core Ios","updatedWDABundleId":"com.mycompany.qa.WebDriverAgentRunner","mycompany.jenkins.jobname":"qa-mobile-exp-core-ios","sendKeyStrategy":"grouped","mycompany:node.platformType":"Phone","mycompany.test":"testAttractionsGoodPromoCode","useNewWDA":true},null, {"firstMatch" [{"browserName":"","platformName":"ios","server:CONFIG_UUID":"60fcbf6d-8a2a-4405-8cf8-00212e4a25a9"...
2019-12-19 02:47:25:248 - [debug] [BaseDriver] Event 'newSessionRequested' logged at 1576723645248 (21:47:25 GMT-0500 (Eastern Standard Time))
2019-12-19 02:47:25:254 - [BaseDriver] The capabilities ["deviceName","udid","systemPort","wdaLocalPort","webkitDebugProxyPort","startIWDP","useXctestrunFile","bootstrapPath"] are not standard capabilities and should have an extension prefix
2019-12-19 02:47:25:262 - [Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["simpleIsVisibleCheck","noReset","xcodeSigningId","newCommandTimeout","platformVersion","automation Name","preventWDAAttachments","xcodeOrgId","bundleId","updatedWDABundleId","sendKeyStrategy","useNewWDA"]
2019-12-19 02:47:25:262 - [Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
2019-12-19 02:47:25:265 - [BaseDriver] The capabilities ["simpleIsVisibleCheck","noReset","xcodeSigningId","newCommandTimeout","platformVersion","automationName","preventWDAAttachments","xcodeOrgId","bundleId","updatedWDABundleId","sendKeyStrategy", "useNewWDA","deviceName","udid","systemPort","wdaLocalPort","webkitDebugProxyPort","startIWDP","useXctestrunFile","bootstrapPath"] are not standard capabilities and should have an extension prefix
2019-12-19 02:47:25:267 - [Appium] Appium v1.16.0-beta.3 creating new XCUITestDriver (v3.10.1) session
2019-12-19 02:47:25:280 - [debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bennidcommented, Jan 10, 2020

That looks good now! Thanks! Can this be packaged into a 1.16.1 so I can stay stable / not using RC in our production tests?

0reactions
petrdunajcommented, Sep 9, 2021

Hey, My Appium also failing with this issue, I’m executing tests only on Android emulators.

Whole story short:

  • for a long time I had just non parallel test execution - one emulator (API 29), one appium (1.21.0), run tests daily and everything works well
  • 2 months ago I start to play with parallel execution - so I started another appium (-p 4733) and another emulator (API 30), I executed tests like a 2 stand alone sessions - half of the test-suites for the first one and second half for the second one and everything works well
  • yesterday I decided to have 5 parallel sessions with only the same emulators (API 30)
  • I add another 3 appium (-p 4743; -p 4753; -p 4763) another API 30 emulators and when I started the tests all new appiums crashed, the old ones finished tests without any issues but I don’t have logs from them
2021-09-08 19:05:25:438 uncaughtException: write EPIPE
Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:780:11)
    at Socket._write (node:net:792:8)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at Socket.Writable.write (node:internal/streams/writable:334:10)
    at Console.log (/appl/nvm/versions/node/v16.6.1/lib/node_modules/appium/node_modules/winston/lib/winston/transports/console.js:79:23)
    at Console._write (/appl/nvm/versions/node/v16.6.1/lib/node_modules/appium/node_modules/winston-transport/index.js:103:17)
    at doWrite (/appl/nvm/versions/node/v16.6.1/lib/node_modules/appium/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/appl/nvm/versions/node/v16.6.1/lib/node_modules/appium/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Console.Writable.write (/appl/nvm/versions/node/v16.6.1/lib/node_modules/appium/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at DerivedLogger.ondata (/appl/nvm/versions/node/v16.6.1/lib/node_modules/appium/node_modules/readable-stream/lib/_stream_readable.js:681:20)
    at DerivedLogger.emit (node:events:406:35)
    at addChunk (/appl/nvm/versions/node/v16.6.1/lib/node_modules/appium/node_modules/readable-stream/lib/_stream_readable.js:298:12)
    at readableAddChunk (/appl/nvm/versions/node/v16.6.1/lib/node_modules/appium/node_modules/readable-stream/lib/_stream_readable.js:280:11)

and this was in mvn log

19:05:10,395 WARN  - Sep 08, 2021 7:05:10 PM at.willhaben.factories.DriverFactory resolveParameterAndroid
19:05:10,395 WARN  - INFO: connecting to Appium at http://127.0.0.1:4743/wd/hub
19:05:22,841 WARN  - Sep 08, 2021 7:05:22 PM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
19:05:22,841 WARN  - INFO: Detected dialect: W3C
19:05:22,873 WARN  - Sep 08, 2021 7:05:22 PM at.willhaben.factories.DriverFactory resolveParameterAndroid
19:05:22,873 WARN  - INFO: initialized Android driver (12s)
19:05:23,158 WARN  - Sep 08, 2021 7:05:23 PM at.willhaben.extensions.PageObjectFactoryResolver resolveParameter
19:05:23,158 WARN  - INFO: Android PageObjectFactory is used.
19:05:23,239 WARN  - Sep 08, 2021 7:05:23 PM at.willhaben.commons.selenium.apiutils.WhUser generate
19:05:23,239 WARN  - INFO: New user is generated. - WhUser{email='...', firstName='...', lastName='null', password='...', gender='FEMALE'}
19:05:25,245 WARN  - Sep 08, 2021 7:05:25 PM at.willhaben.commons.selenium.apiutils.UserApiClient createUser


19:05:33,446 ERROR - at.willhaben.test.aza.immo.ImmoAzaHouseTest.testEstateCommercialAdInput(String,ImmoAzaData,EstateAttributeConstants$PropertyType,EstateAttributeConstants$AdTypeConstants,AppiumDriver,PageObjectFactory) Time elapsed: 22.959 s <<< ERROR!
19:05:33,446 ERROR - org.openqa.selenium.WebDriverException:
19:05:33,446 ERROR - Connection refused (Connection refused)
19:05:33,446 ERROR - Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
19:05:33,446 ERROR - System info: host: 'build4.appium', ip: '172.18.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-305.7.1.el8_4.x86_64', java.version: '11.0.11'
19:05:33,446 ERROR - Driver info: driver.version: RemoteWebDriver
19:05:33,446 ERROR - Caused by: java.net.ConnectException: Connection refused (Connection refused)

From the moment I’m not even able to finish single session of tests, every time appium failing with the same error. I removed additional emulators, stopped additional appiums, but no success.

using node v16.6.1 (nvm 0.38.0, npm v7.20.3, appium 1.21.0) buildserver_baseimage_centos7

Read more comments on GitHub >

github_iconTop Results From Across the Web

Appium opens app but crashes when executing test
Im using the next project to create a demo of appium using Windows Appium GUI and Android Studio: But when I try to...
Read more >
App opens and crashes on simulator using desktop Appium app
To get .app file for Appium test in simulator : ... The application crashes because the .app file you are trying to launch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found