4

Getting the following appium error once in a while and not sure how to solve it. Any way to increase this timeout or help fix this issue? Your help is appreciated.

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: Timed out after 10000 milliseconds waiting for root AccessibilityNodeInfo
    at io.appium.uiautomator2.utils.AXWindowHelpers.refreshRootAXNode(AXWindowHelpers.java:78)
    at io.appium.uiautomator2.handler.Source.safeHandle(Source.java:38)
    at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:36)
    at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:250)
    at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:241)
    at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    at java.lang.Thread.run(Thread.java:764)

../../.ve/qa/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py:242: WebDriverException
  • Some permissions problem perhaps? You can set them in the [Desired Capabilities](http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities). – PixelPlex Apr 29 '19 at 07:10
  • In my case, I had a low-level `import` error in my React Native JavaScript Bundle which essentially crashed the application and resulted in this Appium error. – Joshua Pinter Jul 27 '20 at 13:53

2 Answers2

4

There is nothing you can do here actually. The exception you got occurs on system function call:

root = UiAutomatorBridge.getInstance().getAccessibilityRootNode();

where it calls the following code:

    public AccessibilityNodeInfo getAccessibilityRootNode() throws UiAutomator2Exception {
        Object queryController = invoke(method(UiDevice.class, "getQueryController"), Device.getUiDevice());
        return (AccessibilityNodeInfo) invoke(method(queryController.getClass(), "getRootNode"), queryController);
    }

It's not an Appium issue, but Uiautomator by Google, that Appium is using under the hood.

As you can see from the code, you cannot increase the timeout. I suggest trying to reset device/using other device/emulator.

dmle
  • 3,498
  • 1
  • 14
  • 22
0

I have a tricky solution ...

This exception usually happens on start of an activity for the first time. So when I get the exception , I just swallow it , sleep for sometime , and try starting it again .

Usually it works ..

mythsman
  • 111
  • 1
  • 5