mobile-dev-inc / maestro

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

Android error #559

Closed sinanerdinc closed 1 month ago

sinanerdinc commented 1 year ago

When i want to run maestro test android-flow.yaml command I get the following error;

java.io.IOException: Failed to install apk /tmp/maestro-app12885964060812153585.apk: Connection reset by peer (Write failed)
    at maestro.drivers.AndroidDriver.install(AndroidDriver.kt:487)
    at maestro.drivers.AndroidDriver.installMaestroApks(AndroidDriver.kt:467)
    at maestro.drivers.AndroidDriver.open(AndroidDriver.kt:82)
    at maestro.Maestro$Companion.android(Maestro.kt:498)
    at maestro.Maestro$Companion.android$default(Maestro.kt:496)
    at maestro.cli.util.MaestroFactory.createMaestro(MaestroFactory.kt:43)
    at maestro.cli.command.TestCommand.call(TestCommand.kt:84)
    at maestro.cli.command.TestCommand.call(TestCommand.kt:40)
    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:119)
Caused by: java.net.SocketException: Connection reset by peer (Write failed)
    at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
    at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
    at okio.OutputStreamSink.write(JvmOkio.kt:57)
    at okio.AsyncTimeout$sink$1.write(AsyncTimeout.kt:99)
    at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:255)
    at okio.RealBufferedSink.writeAll(RealBufferedSink.kt:194)
    at dadb.Dadb$DefaultImpls.install(Dadb.kt:81)
    at dadb.adbserver.AdbServerDadb.install(AdbServer.kt:118)
    at maestro.drivers.AndroidDriver.install(AndroidDriver.kt:485)
    ... 16 more
➜  adb devices  
List of devices attached
emulator-5554   device

OS: Ubuntu 20.04.4 LTS maestro version: 1.18.3 openjdk 11.0.17 2022-10-18 OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu220.04) OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu220.04, mixed mode, sharing)

woen4 commented 1 year ago

Same problem

dima60216 commented 1 year ago

Sometimes the app starts, but sometimes I see this error instead of running a test on a real android device via WSL2.

maestro 1.23.0 openjdk version "11.0.17" 2022-10-18 OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu220.04) OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu220.04, mixed mode, sharing)

java.io.IOException: Failed to install apk /tmp/maestro-app15178729350851792478.apk: Connection reset by peer (Write failed) at maestro.drivers.AndroidDriver.install(AndroidDriver.kt:552) at maestro.drivers.AndroidDriver.installMaestroApks(AndroidDriver.kt:532) at maestro.drivers.AndroidDriver.open(AndroidDriver.kt:85) at maestro.Maestro$Companion.android(Maestro.kt:538) at maestro.Maestro$Companion.android$default(Maestro.kt:531) 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.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:53) at maestro.cli.command.TestCommand.call(TestCommand.kt:115) at maestro.cli.command.TestCommand.call(TestCommand.kt:41) 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:124) Caused by: java.net.SocketException: Connection reset by peer (Write failed) at java.base/java.net.SocketOutputStream.socketWrite0(Native Method) at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110) at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150) at okio.OutputStreamSink.write(JvmOkio.kt:57) at okio.AsyncTimeout$sink$1.write(AsyncTimeout.kt:99) at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:255) at okio.RealBufferedSink.writeAll(RealBufferedSink.kt:194) at dadb.Dadb$DefaultImpls.install(Dadb.kt:81) at dadb.adbserver.AdbServerDadb.install(AdbServer.kt:118) at maestro.drivers.AndroidDriver.install(AndroidDriver.kt:550) ... 23 more

ghost commented 1 year ago

Same here: maestro 1.24.0 openjdk version "17.0.5" 2022-10-18 LTS OpenJDK Runtime Environment Zulu17.38+21-CA (build 17.0.5+8-LTS) OpenJDK 64-Bit Server VM Zulu17.38+21-CA (build 17.0.5+8-LTS, mixed mode, sharing)

MariaMatyushenkoMicropsi commented 1 year ago

Hi! same here, I am have the following stack:

I have alternating errors:

A bit more logs when trying to start maestro studio:

Tip: Maestro Studio can now run simultaneously alongside other Maestro CLI commands!

Navigate to http://localhost:10000 in your browser to open Maestro Studio. Ctrl-C to exit.
Opening in existing browser session.
mesa: for the --simplifycfg-sink-common option: may only occur zero or one times!
mesa: for the --global-isel-abort option: may only occur zero or one times!
mesa: for the --amdgpu-atomic-optimizations option: may only occur zero or one times!
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:634)
    at maestro.drivers.AndroidDriver.deviceInfo(AndroidDriver.kt:148)
    at maestro.ViewHierarchy$Companion.from-c1iYVAs(ViewHierarchy.kt:28)
    at maestro.Maestro.viewHierarchy-prqvCes(Maestro.kt:405)
    at maestro.studio.DeviceService.getDeviceScreen(DeviceService.kt:172)
    at maestro.studio.DeviceService.access$getDeviceScreen(DeviceService.kt:43)
    at maestro.studio.DeviceService$routes$3$1.invokeSuspend(DeviceService.kt:82)
    at maestro.studio.DeviceService$routes$3$1.invoke(DeviceService.kt)
    at maestro.studio.DeviceService$routes$3$1.invoke(DeviceService.kt)
    at io.ktor.http.content.ChannelWriterContent.writeTo(ChannelWriterContent.kt:21)
    at io.ktor.server.engine.BaseApplicationResponse$respondWriteChannelContent$2$1.invokeSuspend(BaseApplicationResponse.kt:174)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:7001
Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
    at io.netty.channel.unix.Errors.newConnectException0(Errors.java:166)
    at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:131)
    at io.netty.channel.unix.Socket.finishConnect(Socket.java:359)
    at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710)
    at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687)
    at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567)
    at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:489)
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397)
    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:829)
bartekpacia commented 2 months ago

Hey, thanks for creating this issue! Unfortunately, it's not reproducible to us.

Please provide a minimal, reproducible example that clearly explains how to reproduce the problem with the detailed, step-by-step instructions (that can be easily run by me or other maintainers).

This issue does not contain such an example, therefore if more accurate reproduction steps aren't provided, we'll have to reluctantly close it.

If you don't have time to do it right now, that's totally OK. Feel free to open a new issue in the future with all the required information provided.

github-actions[bot] commented 1 month ago

Without additional information, we can't resolve this issue. We're therefore reluctantly going to close it.

Feel free to open a new issue with all the required information provided, including a minimal, reproducible sample. When creating a new issue, please make sure to diligently fill out the issue template.

Thank you for your contribution to our open-source community!

github-actions[bot] commented 1 month 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!