AXDisableAccessibilityOnTermination: kAXErrorCannotComplete

Originator:nozomi.ito
Number:rdar://FB8924923 Date Originated:06/12/2020
Status:Open Resolved:
Product:Xcode Product Version:12.2
Classification:Incorrect/Unexpected Behavior Reproducible:Frequently
 
While running "xcodebuild test-without-building" repeatedly by using headless iOS simulator launched by "xcrun simctl create", I sometimes encounter "AXDisableAccessibilityOnTermination: kAXErrorCannotComplete" and the build fails. I have rarely saw this phenomennon with Xcode11 or earlier, but now I encounter this far more freqently since Xcode12.0 (and still happen with Xcode12.2). I use mac OS Catalina 10.15.6 currently.

- I run xcodebuild in SSH session with non-root user without GUI.
- I sometimes run multiple "xcodebuild test-without-building" processes in parallel.
- What I actually build and run is WebDriverAgent.xcodeproj, which is used by Appium. According to an Appium developer, this is not Appium's issue but XCTest issue ( https://github.com/appium/appium/issues/13920 ).

The following part of Xcode log. If you need further info or the step to reproduce the issue, please let me know. I have long been suffering from this issue..

---------------------------------
2020-12-06 17:09:38.750 xcodebuild[17729:241800]  IDETestOperationsObserverDebug: Failed to move logarchive from /Users/my-user/Library/Developer/CoreSimulator/Devices/B9D3982B-9707-4CBA-9C55-9CDD7234F6FC/data/tmp/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive to diagnostics location /my_directory/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed/DerivedData/14.2/Logs/Test/Test-WebDriverAgentRunner-2020.12.06_17-09-29-+0900.xcresult/Staging/1_Test/Diagnostics/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed_B9D3982B-9707-4CBA-9C55-9CDD7234F6FC/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive: Error Domain=NSCocoaErrorDomain Code=4 "“test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive” couldn’t be moved to “20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed_B9D3982B-9707-4CBA-9C55-9CDD7234F6FC” because either the former doesn’t exist, or the folder containing the latter doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/Users/my-user/Library/Developer/CoreSimulator/Devices/B9D3982B-9707-4CBA-9C55-9CDD7234F6FC/data/tmp/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSUserStringVariant=(
    Move
), NSDestinationFilePath=/my_directory/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed/DerivedData/14.2/Logs/Test/Test-WebDriverAgentRunner-2020.12.06_17-09-29-+0900.xcresult/Staging/1_Test/Diagnostics/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed_B9D3982B-9707-4CBA-9C55-9CDD7234F6FC/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSFilePath=/Users/my-user/Library/Developer/CoreSimulator/Devices/B9D3982B-9707-4CBA-9C55-9CDD7234F6FC/data/tmp/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSUnderlyingError=0x7feb57234400 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2020-12-06 17:09:41.066 xcodebuild[17729:241800]  IDETestOperationsObserverDebug: Failed to move logarchive from /var/tmp/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive to diagnostics location /my_directory/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed/DerivedData/14.2/Logs/Test/Test-WebDriverAgentRunner-2020.12.06_17-09-29-+0900.xcresult/Staging/1_Test/Diagnostics/My Mac_1673EAD1-576B-5769-98A5-F06133842949/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive: Error Domain=NSCocoaErrorDomain Code=4 "“test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive” couldn’t be moved to “My Mac_1673EAD1-576B-5769-98A5-F06133842949” because either the former doesn’t exist, or the folder containing the latter doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/var/tmp/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSUserStringVariant=(
    Move
), NSDestinationFilePath=/my_directory/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed/DerivedData/14.2/Logs/Test/Test-WebDriverAgentRunner-2020.12.06_17-09-29-+0900.xcresult/Staging/1_Test/Diagnostics/My Mac_1673EAD1-576B-5769-98A5-F06133842949/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSFilePath=/var/tmp/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSUnderlyingError=0x7feb55cdf860 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

2020-12-06 17:09:41.066 xcodebuild[17729:241800]  IDETestOperationsObserverDebug: Failure collecting logarchive: Error Domain=NSCocoaErrorDomain Code=4 "“test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive” couldn’t be moved to “My Mac_1673EAD1-576B-5769-98A5-F06133842949” because either the former doesn’t exist, or the folder containing the latter doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/var/tmp/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSUserStringVariant=(
    Move
), NSDestinationFilePath=/my_directory/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed/DerivedData/14.2/Logs/Test/Test-WebDriverAgentRunner-2020.12.06_17-09-29-+0900.xcresult/Staging/1_Test/Diagnostics/My Mac_1673EAD1-576B-5769-98A5-F06133842949/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSFilePath=/var/tmp/test-session-systemlogs-2020.12.06_17-09-29-+0900.logarchive, NSUnderlyingError=0x7feb55cdf860 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2020-12-06 17:09:41.066 xcodebuild[17729:241739] [MT] IDETestOperationsObserverDebug: 11.582 elapsed -- Testing started completed.
2020-12-06 17:09:41.066 xcodebuild[17729:241739] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2020-12-06 17:09:41.066 xcodebuild[17729:241739] [MT] IDETestOperationsObserverDebug: 11.582 sec, +11.582 sec -- end

Test session results, code coverage, and logs:
	/my_directory/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed/DerivedData/14.2/Logs/Test/Test-WebDriverAgentRunner-2020.12.06_17-09-29-+0900.xcresult

Testing failed:
	WebDriverAgentRunner:
		WebDriverAgentRunner-Runner.app (17735) encountered an error (The test runner failed to initialize for UI testing. If you believe this error represents a bug, please attach the result bundle at /my_directory/20201206170717_ccdb24f9-9765-474c-89d4-354e8deb10ed/DerivedData/14.2/Logs/Test/Test-WebDriverAgentRunner-2020.12.06_17-09-29-+0900.xcresult. (Underlying Error: Failed call to AXDisableAccessibilityOnTermination: kAXErrorCannotComplete))

** TEST EXECUTE FAILED **

Testing started
---------------------------------------------

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!