Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An unknown network error occurred while communicating with the XCUITest server #1914

Closed
1 task done
gtokman opened this issue Aug 14, 2024 · 10 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working maestro cli Related to the command-line Maestro tool P0 Critical issues that affect many users

Comments

@gtokman
Copy link

gtokman commented Aug 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues and didn't find mine.

Steps to reproduce

We're running Maestro on CI on a macos-14 runner (GitHub actions) and are experiencing XCUITest not starting the test. I added some logs of the failure below.

Actual results

The server is not starting and running the tests on CI.

Expected results

We are expecting it to start correctly.

About app

React Native - 0.74.5 - iOS

About environment

Xcode 15.4, arm64

Logs

Logs

Running on iPhone 15 Pro - iOS 17.5 - B23095CC-E2ED-4301-A857-BCC36C176ACB

Flow
Run flow...
ℹ️ Retrying connection to the XCUITest server for 1...
ℹ️ Retrying connection to the XCUITest server for 2...
ℹ️ Retrying connection to the XCUITest server for 3...
ℹ️ Retrying connection to the XCUITest server for 4...
ℹ️ Retrying connection to the XCUITest server for 5...
Error: ⚠️ Error: An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.
⚠️ Error: An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.
Error: Request for http://[::1]:7001/deviceInfo failed, because of XCUITest server got crashed/exit, body: {"errorMessage":"An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.","code":"network-error"}
kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@35a3f96
❌ Error: BlockingCoroutine is cancelling
Caused by: NetworkError(errorResponse=Request for http://[::1]:7001/deviceInfo failed, because of XCUITest server got crashed/exit, body: {"errorMessage":"An unknown network error occurred while communicating with the XCUITest server. If the issue persists, consider raising a GitHub issue with the error message and any available logs for further assistance.","code":"network-error"})
at xcuitest.XCTestDriverClient.handleExceptions(XCTestDriverClient.kt:280)
at xcuitest.XCTestDriverClient.processResponse(XCTestDriverClient.kt:258)
at xcuitest.XCTestDriverClient.executeJsonRequest(XCTestDriverClient.kt:207)
at xcuitest.XCTestDriverClient.deviceInfo(XCTestDriverClient.kt:180)
at xcuitest.XCTestDriverClient.deviceInfo$default(XCTestDriverClient.kt:179)
at ios.xctest.XCTestIOSDevice$deviceInfo$1.invoke(XCTestIOSDevice.kt:31)
at ios.xctest.XCTestIOSDevice$deviceInfo$1.invoke(XCTestIOSDevice.kt:30)
at ios.xctest.XCTestIOSDevice.execute(XCTestIOSDevice.kt:227)
at ios.xctest.XCTestIOSDevice.deviceInfo(XCTestIOSDevice.kt:30)
at ios.LocalIOSDevice.deviceInfo(LocalIOSDevice.kt:29)
at maestro.drivers.IOSDriver$deviceInfo$2.invoke(IOSDriver.kt:46)
at maestro.drivers.IOSDriver$deviceInfo$2.invoke(IOSDriver.kt:45)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at maestro.drivers.IOSDriver.getDeviceInfo(IOSDriver.kt:45)
at maestro.drivers.IOSDriver.access$getDeviceInfo(IOSDriver.kt:41)
at maestro.drivers.IOSDriver$deviceInfo$4.invoke(IOSDriver.kt:79)
at maestro.drivers.IOSDriver$deviceInfo$4.invoke(IOSDriver.kt:76)
at maestro.drivers.IOSDriver.runDeviceCall(IOSDriver.kt:499)
at maestro.drivers.IOSDriver.deviceInfo(IOSDriver.kt:76)
at maestro.Maestro.fetchDeviceInfo(Maestro.kt:60)
at maestro.Maestro.access$fetchDeviceInfo(Maestro.kt:38)
at maestro.Maestro$cachedDeviceInfo$2.invoke(Maestro.kt:44)
at maestro.Maestro$cachedDeviceInfo$2.invoke(Maestro.kt:43)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at maestro.Maestro.getCachedDeviceInfo(Maestro.kt:43)
at maestro.Maestro.deviceInfo(Maestro.kt:54)
at maestro.orchestra.Orchestra.initJsEngine(Orchestra.kt:227)
at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:83)
at maestro.orchestra.Orchestra.runFlow$default(Orchestra.kt:75)
at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:185)
at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:54)
at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:51)
at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:145)
at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:51)
at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:291)
at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:249)
at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:107)
at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58)
at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:249)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)

Maestro version

1.38.7

How did you install Maestro?

install script (https://get.maestro.mobile.dev)

Anything else?

No response

@nahn20
Copy link

nahn20 commented Aug 15, 2024

If anyone is looking for a temporary solution, it seems 1.37.7 is still working. Here's the steps in the docs for installing a specific version. (Also, I believe the Maestro version listed above is a typo and should be 1.37.8 instead).

@bartekpacia bartekpacia added bug Something isn't working maestro cli Related to the command-line Maestro tool P0 Critical issues that affect many users labels Aug 15, 2024
@bartekpacia
Copy link
Contributor

Off, that's a bad one. Thanks for a quick report and all the likes, this really makes it obvious to see it's impacting many of you.

Working on a fix right now.

To share a bit more:
We have e2e testing for Android that prevents these kinds of total outages. Unfortunately I wasn't able to get the equivalent E2E pipeline for iOS working on GitHub Actions in a reasonable time (how ironic, lol). This is a strong signal we have to get that done finally.

@bartekpacia
Copy link
Contributor

bartekpacia commented Aug 15, 2024

The cause is #1809 (strange, it was working!, sigh)

I reverted that change. Released as Maestro v1.37.9 - please update.

Sorry about sudden breakage. We made some progress on E2E testing pipeline but apparently it's not enough. We will do better.

@CodingItWrong
Copy link

As a datapoint, I am still seeing the error when using Maestro 1.37.9. Reverting to 1.37.7 does fix it for me.

Logs
Downloading maestro 1.37.9
  Unzipping maestro
  /usr/bin/unzip -o -q /Users/runner/work/_temp/55694391-77df-4b75-8d70-92771dfe4fb6
  maestro succesffuly installed

[snip]

Waiting on http://localhost:8081
› Installing on iPhone 14 Pro
› Opening on iPhone 14 Pro (com.chickfila.international)
› Opening exp+chick-fil-a-international://expo-development-client/?url=http%3A%2F%2F192.168.64.6%3A8081 on iPhone 14 Pro
› Opening the iOS simulator, this might take a moment.

> [email protected] maestro /Users/runner/work/mobile-ordering/mobile-ordering
> scripty ".maestro/RunThrough.yaml"

scripty > Executing "/Users/runner/work/mobile-ordering/mobile-ordering/scripts/maestro/index":

CI detected, analytics was automatically enabled.
To opt out, set MAESTRO_CLI_NO_ANALYTICS environment variable to any value before running Maestro.

kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@2e122d32
❌ Error: BlockingCoroutine is cancelling
Caused by: maestro.MaestroDriverStartupException$IOSDriverTimeoutException: Maestro iOS driver did not start up in time
	at maestro.drivers.IOSDriver.awaitLaunch(IOSDriver.kt:494)
	at maestro.drivers.IOSDriver.open(IOSDriver.kt:64)
	at maestro.Maestro$Companion.ios(Maestro.kt:610)
	at maestro.cli.session.MaestroSessionManager.createIOS(MaestroSessionManager.kt:330)
	at maestro.cli.session.MaestroSessionManager.createMaestro(MaestroSessionManager.kt:163)
	at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:88)
 ELIFECYCLE  Command failed with exit code 1.
	at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58)
	at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:249)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
scripty ERR! script failed: '/Users/runner/work/mobile-ordering/mobile-ordering/scripts/maestro/index'
scripty ERR! exit status: 1

@disrae
Copy link

disrae commented Aug 15, 2024

As a datapoint, I am still seeing the error when using Maestro 1.37.9. Reverting to 1.37.7 does fix it for me.

Logs

Hm, 1.37.9 is working for me so far...

@bartekpacia
Copy link
Contributor

Hey @CodingItWrong, it looks like a different error. The stacktraces are different.

@disrae thanks for confirming!

@CodingItWrong
Copy link

thank you @bartekpacia, I will work on a minimal repro of my error so I can open a separate issue

@bartekpacia
Copy link
Contributor

i see, thank you!

@CodingItWrong
Copy link

As a heads up, the error I posted above is no longer occurring for me as of today, with no changes to Maestro version or otherwise. Must have either been a transient error or some underlying change in GitHub Actions.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.
Thank you for helping keep us our issue tracker clean!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maestro cli Related to the command-line Maestro tool P0 Critical issues that affect many users
Projects
None yet
Development

No branches or pull requests

5 participants