mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.79k stars 270 forks source link

"io.grpc.StatusRuntimeException: UNAVAILABLE: io exception" on macOS #883

Closed ln-12 closed 1 year ago

ln-12 commented 1 year ago

Hey there, I want to use maestro studio on macOS (M1 Pro chip) with OpenJDK 17. When running maestro using JAVA_HOME=/opt/homebrew/opt/openjdk@17/ maestro studio, I get two errors. when I first launch maestro, it fails to install the apk:

Running on XXXXXXXXXXXX

java.io.IOException: Failed to install apk /var/folders/ft/g8ym9b_10l59b8kv3_c5r2mr0000gp/T/maestro-app2750686546312295871.apk: Install failed:
    at maestro.drivers.AndroidDriver.install(AndroidDriver.kt:726)
    at maestro.drivers.AndroidDriver.installMaestroApks(AndroidDriver.kt:706)
    at maestro.drivers.AndroidDriver.open(AndroidDriver.kt:91)
    at maestro.Maestro$Companion.android(Maestro.kt:543)
    at maestro.Maestro$Companion.android$default(Maestro.kt:536)
    at maestro.cli.session.MaestroSessionManager.createMaestro(MaestroSessionManager.kt:151)
    at maestro.cli.session.MaestroSessionManager.access$createMaestro(MaestroSessionManager.kt:45)
    at maestro.cli.session.MaestroSessionManager$newSession$session$1.invoke(MaestroSessionManager.kt:80)
    at maestro.cli.session.MaestroSessionManager$newSession$session$1.invoke(MaestroSessionManager.kt:79)
    at maestro.cli.db.KeyValueStore.withExclusiveLock(KeyValueStore.kt:37)
    at maestro.cli.session.SessionStore.withExclusiveLock(SessionStore.kt:74)
    at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:79)
    at maestro.cli.command.StudioCommand.call(StudioCommand.kt:36)
    at maestro.cli.command.StudioCommand.call(StudioCommand.kt:18)
    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 maestro.cli.DisableAnsiMixin$Companion.executionStrategy(DisableAnsiMixin.kt:22)
    at picocli.CommandLine.execute(CommandLine.java:2058)
    at maestro.cli.AppKt.main(App.kt:125)
Caused by: java.io.IOException: Install failed:
    at dadb.Dadb$DefaultImpls.install(Dadb.kt:85)
    at dadb.adbserver.AdbServerDadb.install(AdbServer.kt:118)
    at maestro.drivers.AndroidDriver.install(AndroidDriver.kt:724)
    ... 22 more

When I try to start it a second time, it gives me this exception:

io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
    at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:271)
    at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:252)
    at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:165)
    at maestro_android.MaestroDriverGrpc$MaestroDriverBlockingStub.deviceInfo(MaestroDriverGrpc.java:422)
    at maestro.drivers.AndroidDriver.deviceInfo(AndroidDriver.kt:159)
    at maestro.ViewHierarchy$Companion.from-c1iYVAs(ViewHierarchy.kt:28)
    at maestro.Maestro.viewHierarchy-prqvCes(Maestro.kt:379)
    at maestro.studio.DeviceScreenService$routes$1.invokeSuspend(DeviceScreenService.kt:41)
        ...
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.ktor.server.netty.EventLoopGroupProxy$Companion.create$lambda$1$lambda$0(NettyApplicationEngine.kt:291)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/[0:0:0:0:0:0:0:1]:7001
Caused by: java.net.ConnectException: Connection refused
    at java.base/sun.nio.ch.Net.pollConnect(Native Method)
    at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
    at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:337)
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:833)

Here are my logs: 2023-03-10_164202.zip 2023-03-10_164343.zip 2023-03-10_164350.zip

ln-12 commented 1 year ago

Probably the same as: https://github.com/mobile-dev-inc/maestro/issues/829

github-actions[bot] commented 3 months ago

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!