question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

uncaughtException: The frame is bigger than expected

See original GitHub issue

The problem

Appium is sometimes crashing when running with video recording against real iOS devices.

Environment

  • Appium version (or git revision) that exhibits the issue: v1.16.0-beta.1 (also happens on v1.15.0)
  • Last Appium version that did not exhibit the issue (if applicable): Unsure, we just started using video recording
  • Desktop OS/version used to run Appium: macOS 10.14.5
  • Node.js version (unless using Appium.app|exe): v12.10.0
  • Npm or Yarn package manager: npm 6.10.3
  • Mobile platform/version under test: iOS 13.1
  • Real device or emulator/simulator: Real
  • Appium CLI or Appium.app|exe: CLI

Details

We are running native iOS tests against a real device with video recording on, per test. At the start of each test, we start video recording. At the end of each test, we stop video recording. There are multiple tests per suite run.

Sometimes Appium will crash when attempting to start the next video recording, with an error like the following:

uncaughtException: The frame is bigger than expected. Length: 1347703880, max: 1000000
Error: The frame is bigger than expected. Length: 1347703880, max: 1000000
    at LengthBasedSplitter._decode (/usr/local/lib/node_modules/appium/node_modules/appium-ios-device/lib/util/transformer/length-based-splitter.js:37:13)
    at LengthBasedSplitter._decode [as _transform] (/usr/local/lib/node_modules/appium/node_modules/appium-ios-device/lib/util/transformer/length-based-splitter.js:19:48)
    at LengthBasedSplitter.Transform._read (_stream_transform.js:189:10)
    at LengthBasedSplitter.Transform._write (_stream_transform.js:177:12)
    at doWrite (_stream_writable.js:428:12)
    at writeOrBuffer (_stream_writable.js:412:5)
    at LengthBasedSplitter.Writable.write (_stream_writable.js:302:11)
    at Socket.ondata (_stream_readable.js:722:22)
    at Socket.emit (events.js:209:13)
    at addChunk (_stream_readable.js:305:12)
    at readableAddChunk (_stream_readable.js:286:11)
    at Socket.Readable.push (_stream_readable.js:220:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)

This may be related to the following issues: https://github.com/appium/appium/issues/13229 https://github.com/appium/appium/issues/13451

However, our problem differs in that we are only seeing these crashes when utilizing video recording, and our frame sizes seem absurdly high compared to the other issues. I should note, that this seems to happen more frequently on our older phones (iPhone 6+) compared to our newer phones (iPhone Xs), leading me to believe that this issue is exacerbated by how quickly the phone is to respond to video recording requests.

Link to Appium logs

https://gist.github.com/grant-mccarriagher/aaac30d0d76b4bb0d7eae3c55d339e98

Here’s a log of the suite when the error pops up.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
hemantbanafalcommented, Jan 8, 2020

@mykola-mokhnach I am still getting this issue with Appium 1.16.0

2020-01-08 15:18:09:878 [HTTP] --> POST /wd/hub/session/77ae062f-6fa2-4cf4-8288-4c76a63e226a/appium/start_recording_screen
2020-01-08 15:18:09:878 [HTTP] {"options":{"timeLimit":600,"forceRestart":true,"videoQuality":"medium"}}
2020-01-08 15:18:09:879 [W3C (77ae062f)] Calling AppiumDriver.startRecordingScreen() with args: [{"timeLimit":600,"forceRestart":true,"videoQuality":"medium"},"77ae062f-6fa2-4cf4-8288-4c76a63e226a"]
2020-01-08 15:18:09:879 [XCUITest] Executing command 'startRecordingScreen'
2020-01-08 15:18:09:881 [DevCon Factory] Releasing connections for 8543a569e3d21db7778f649b71187bdfa50cdec6 device on 9120 port number
2020-01-08 15:18:09:882 [DevCon Factory] No cached connections have been found
2020-01-08 15:18:09:884 [WD Proxy] Matched '/appium/settings' to command name 'getSettings'
2020-01-08 15:18:09:884 [WD Proxy] Proxying [GET /appium/settings] to [GET http://localhost:8120/session/2C814C20-270A-41FE-8BBC-26AF290D4B31/appium/settings] with no body
2020-01-08 15:18:09:889 [WD Proxy] Got response with status 200: {
2020-01-08 15:18:09:889 [WD Proxy]   "value" : {
2020-01-08 15:18:09:889 [WD Proxy]     "shouldUseCompactResponses" : true,
2020-01-08 15:18:09:889 [WD Proxy]     "mjpegServerFramerate" : 10,
2020-01-08 15:18:09:889 [WD Proxy]     "activeAppDetectionPoint" : "64.00,64.00",
2020-01-08 15:18:09:889 [WD Proxy]     "snapshotTimeout" : 15,
2020-01-08 15:18:09:890 [WD Proxy]     "elementResponseAttributes" : "type,label",
2020-01-08 15:18:09:890 [WD Proxy]     "keyboardPrediction" : false,
2020-01-08 15:18:09:890 [WD Proxy]     "screenshotQuality" : 1,
2020-01-08 15:18:09:890 [WD Proxy]     "keyboardAutocorrection" : false,
2020-01-08 15:18:09:890 [WD Proxy]     "useFirstMatch" : false,
2020-01-08 15:18:09:890 [WD Proxy]     "reduceMotion" : false,
2020-01-08 15:18:09:890 [WD Proxy]     "defaultActiveApplication" : "auto",
2020-01-08 15:18:09:890 [WD Proxy]     "mjpegScalingFactor" : 100,
2020-01-08 15:18:09:890 [WD Proxy]     "mjpegServerScreenshotQuality" : 25,
2020-01-08 15:18:09:890 [WD Proxy]     "includeNonModalElements" : false
2020-01-08 15:18:09:891 [WD Proxy]   },
2020-01-08 15:18:09:891 [WD Proxy]   "sessionId" : "2C814C20-270A-41FE-8BBC-26AF290D4B31"
2020-01-08 15:18:09:891 [WD Proxy] }
2020-01-08 15:18:09:893 [DevCon Factory] Requesting connection for device 8543a569e3d21db7778f649b71187bdfa50cdec6 on local port 9120, device port 9120
2020-01-08 15:18:09:893 [DevCon Factory] Cached connections count: 1
2020-01-08 15:18:09:894 [DevCon Factory] Successfully requested the connection for 8543a569e3d21db7778f649b71187bdfa50cdec6:9120
2020-01-08 15:18:09:925 [ffmpeg] ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
2020-01-08 15:18:09:925 [ffmpeg] 
2020-01-08 15:18:09:925 [ffmpeg]   built with Apple clang version 11.0.0 (clang-1100.0.33.8)
2020-01-08 15:18:09:925 [ffmpeg]   configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
2020-01-08 15:18:09:925 [ffmpeg]   libavutil      56. 31.100 / 56. 31.100
2020-01-08 15:18:09:926 [ffmpeg]   libavcodec     58. 54.100 / 58. 54.100
2020-01-08 15:18:09:926 [ffmpeg]   libavformat    58. 29.100 / 58. 29.100
2020-01-08 15:18:09:926 [ffmpeg]   libavdevice    58.  8.100 / 58.  8.100
2020-01-08 15:18:09:926 [ffmpeg]   libavfilter     7. 57.100 /  7. 57.100
2020-01-08 15:18:09:926 [ffmpeg]   libavresample   4.  0.  0 /  4.  0.  0
2020-01-08 15:18:09:926 [ffmpeg]   libswscale      5.  5.100 /  5.  5.100
2020-01-08 15:18:09:926 [ffmpeg]   libswresample   3.  5.100 /  3.  5.100
2020-01-08 15:18:09:926 [ffmpeg]   libpostproc    55.  5.100 / 55.  5.100
2020-01-08 15:18:09:926 [ffmpeg] 
2020-01-08 15:18:09:977 uncaughtException: The frame is bigger than expected. Length: 1347703880, max: 1000000
Error: The frame is bigger than expected. Length: 1347703880, max: 1000000
    at LengthBasedSplitter._decode (/Users/qaserver/.nvm/versions/node/v9.9.0/lib/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-ios-device/lib/util/transformer/length-based-splitter.js:37:13)
    at LengthBasedSplitter._transform (/Users/qaserver/.nvm/versions/node/v9.9.0/lib/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-ios-device/lib/util/transformer/length-based-splitter.js:19:48)
    at LengthBasedSplitter.Transform._read (_stream_transform.js:185:10)
    at LengthBasedSplitter.Transform._write (_stream_transform.js:173:12)
    at doWrite (_stream_writable.js:406:12)
    at writeOrBuffer (_stream_writable.js:392:5)
    at LengthBasedSplitter.Writable.write (_stream_writable.js:290:11)
    at Socket.ondata (_stream_readable.js:646:20)
    at Socket.emit (events.js:180:13)
    at addChunk (_stream_readable.js:269:12)
    at readableAddChunk (_stream_readable.js:256:11)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at Pipe.onread (net.js:581:20)
1reaction
KazuCocoacommented, Apr 12, 2021

appium:safariWebInspectorMaxFrameLength can customize it. https://github.com/appium/appium-xcuitest-driver#web-context

Read more comments on GitHub >

github_iconTop Results From Across the Web

The frame is bigger than expected. Length: 2511609, max ...
Description uncaughtException: The frame is bigger than expected. Length: 2511609, max: 1000000 Error: The frame is bigger than expected.
Read more >
appium/appium - Gitter
Our hybrid app throws the error [debug] [XCUITest] We are in the middle of selecting a page, ignoring uncaughtException: The frame is bigger...
Read more >
Why does exception within frame get no notification in qUnit?
Your code is changing Test.ignoreGlobalErrors setting (unlikely). There is an existing window.onerror handler that returns true and thus tells ...
Read more >
Chapter 2. The Structure of the Java Virtual Machine
A frame is destroyed when its method invocation completes, whether that completion is normal or abrupt (it throws an uncaught exception). Frames are...
Read more >
Configuration options | APM Node.js Agent Reference [3.x]
The secret token optionally expected by the APM Server. ... The recorded body will be truncated if larger than 2 KiB. If the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found