maestro icon indicating copy to clipboard operation
maestro copied to clipboard

UNKNOWN: Unexpected error in RPC handling

Open jschisler opened this issue 2 years ago • 15 comments

com.github.michaelbull.result.UnwrapException: kotlin.Unit io.grpc.StatusRuntimeException: UNKNOWN: Unexpected error in RPC handling
        at maestro.drivers.IOSDriver.contentDescriptor(IOSDriver.kt:149)
        at maestro.ViewHierarchy$Companion.from-c1iYVAs(ViewHierarchy.kt:28)
        at maestro.Maestro.viewHierarchy-prqvCes(Maestro.kt:228)
        at maestro.orchestra.Orchestra.findElement(Orchestra.kt:257)
        at maestro.orchestra.Orchestra.findElement$default(Orchestra.kt:243)
        at maestro.orchestra.Orchestra.tapOnElement(Orchestra.kt:216)
        at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:120)
        at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:107)
        at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:69)
        at maestro.orchestra.Orchestra.runInitFlow(Orchestra.kt:79)
        at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:91)
        at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:32)
        at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:29)
        at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:116)
        at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:29)
        at maestro.cli.command.TestCommand.call(TestCommand.kt:60)
        at maestro.cli.command.TestCommand.call(TestCommand.kt:30)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
        at picocli.CommandLine.access$1200(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at maestro.cli.AppKt.main(App.kt:74)
appId: com.test.app
---
- launchApp
- hideKeyboard

# Initial choice screen (sign-in/subscribe)
- tapOn:
    id: "initialscreen_signin_button"

# Login screen
# dies here 
- tapOn:
    id: "username_textfield"
- inputText: [email protected]"
- tapOn:
    id: "password_textfield"
- inputText: "p@$$w0rd"
- tapOn:
    id: "login_continue_button"

jschisler avatar Sep 16 '22 11:09 jschisler

Do you have idb_companion running?

dmitry-zaitsev avatar Sep 16 '22 12:09 dmitry-zaitsev

Yes I do. It works through 1 screen before I navigate to the login screen and then I see that exception.

jschisler avatar Sep 19 '22 10:09 jschisler

Could you please share your:

  • Xcode version
  • idb version

dmitry-zaitsev avatar Sep 19 '22 12:09 dmitry-zaitsev

Looks like idb 3.10 if the return from the "which idb" command is right: idb is /Library/Frameworks/Python.framework/Versions/3.10/bin/idb

Xcode Version 14.0 (14A309)

jschisler avatar Sep 19 '22 12:09 jschisler

Using mobile-dev-inc/tap/idb-companion 1.1.7 if that helps.

jschisler avatar Sep 19 '22 14:09 jschisler

Also, if I navigate manually to the screen in question and run maestro hierarchy I get the same error stack trace

jschisler avatar Sep 20 '22 12:09 jschisler

@jschisler thanks, that is useful context. What if you run idb ui describe-all instead of maestro hierarchy on the said screen?

dmitry-zaitsev avatar Sep 20 '22 12:09 dmitry-zaitsev

I did idb --companion localhost:10882 ui describe-all and it returned Unexpected error in RPC handling

So this appears to be an idb problem?

jschisler avatar Sep 20 '22 13:09 jschisler

Could you share logs that you see from idb_companion?

It appears that there is some issue in the idb which is what causes that. Possibly due to some particular state of your application. Is there perhaps anything even remotely unusual on the screen that is causing the issue? I.e. some particular system APIs being used?

dmitry-zaitsev avatar Sep 20 '22 13:09 dmitry-zaitsev

The screen in question contains a WKWebView and is loaded with a EULA from a URL. However, I see the same error on different screens that make no such call. I have noticed problems with screens that have attributed strings in them, but that was from a different build of idb_companion and I no longer see this.

idb_companion log: IDB Companion.txt

jschisler avatar Sep 20 '22 13:09 jschisler

Further, if I debug idb_companion in Xcode, it dies here:

image

jschisler avatar Sep 21 '22 16:09 jschisler

Having this same problem on Xcode14. Do you have news @dmitry-zaitsev?

marcocadei avatar Sep 27 '22 15:09 marcocadei

+1 Same

Gruppio avatar Oct 11 '22 13:10 Gruppio

Hey folks, this is still on our radar. The fact that the issue is on idb_companion side makes it hard to come up with a fix so we are exploring options where we provide some sort of alternative to work around this problem

cc @berikv

dmitry-zaitsev avatar Oct 11 '22 13:10 dmitry-zaitsev

+1 on the same problem 🥶, following for any work around 👀 🤞

AlessandroSteri avatar Oct 11 '22 15:10 AlessandroSteri

@jschisler @MarcoCadei @Gruppio @AlessandroSteri We've made a lot of improvements on this front especially with the release of the new iOS driver. Can you please try again on the latest and reopen if you are still running into issues? Thanks!

Leland-Takamine avatar Jan 18 '23 19:01 Leland-Takamine

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[bot] avatar Jul 11 '24 16:07 github-actions[bot]