Reveal 7 (9558) times out trying to load my app

revealapp's Avatar

revealapp

03 Mar, 2017 11:51 PM

I keep getting this error trying to inspect my app. It's always worked fine in the past.

  1. 1 Posted by revealapp on 03 Mar, 2017 11:55 PM

    revealapp's Avatar

    Looks like there are some errors in Console:

    default 15:52:33.095258 -0800 Reveal TIC TCP Conn Start [7:0x60000019d8e0]
    default 15:52:33.099200 -0800 Reveal TIC TCP Conn Event [7:0x60000019d8e0]: 1 Err(0)
    default 15:52:33.099225 -0800 Reveal TIC TCP Conn Connected [7:0x60000019d8e0]: Err(0)
    default 15:52:38.095356 -0800 Reveal UNIX error exception: 17

    error 15:52:43.094719 -0800 Reveal NSURLSessionTask finished with error - code: -1001
    default 15:52:43.095006 -0800 Reveal TIC TCP Conn Cancel [7:0x60000019d8e0]
    default 15:52:43.095065 -0800 Reveal TIC TCP Conn Destroyed [7:0x60000019d8e0]
    default 15:52:43.096062 -0800 Reveal ERROR: Failed to refresh application state: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSUnderlyingError=0x61000044a680 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=http://localhost:58717/application, NSErrorFailingURLKey=http://localhost:58717/application, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.}
    default 15:53:32.542201 -0800 Reveal UNIX error exception: 17

  2. Support Staff 2 Posted by Vlas Voloshin on 05 Mar, 2017 08:33 AM

    Vlas Voloshin's Avatar

    Hi Christopher, thanks for reaching out to us here.

    I'd like to double-check a few things first:

    • Are you inspecting your app in Simulator or on device?
    • Which integration method do you use?
    • Are you sure your app isn't paused in the debugger when you're inspecting it, and that inspecting it doesn't trigger a debugger breakpoint?

    The Console logs you've provided don't look too suspicious to me, to be honest. Aside from a stray UNIX error exception: 17 message (which is more related to Security Services, if I understand correctly), I see that Reveal has enforced a 10-second timeout on the network request and cancelled it. But it's great that you have looked in the Console anyway, because the error details provide you with an underlying HTTP link to the Reveal Server.

    To start debugging this issue, I'd suggest following the Bonjour Debugging guide first, but since it seems like the app is discovered, and you can see the underlying URL (in the form of http://localhost:<port>/application), we can skip to the "Testing a Connection to Reveal's Server" part. I'll need to you execute this command in Terminal while your app is running and shows up in Reveal:

    curl -s -D - http://localhost:<port>/application -o /dev/null

    Please replace the <port> part with the port number that you can see in the Console logs after an unsuccessful attempt to inspect your app. Please note that the port may change every time you restart your app. I'm wondering how long does it take for Reveal Server to respond to you using this command, if it does at all. It's also interesting whether your app's UI is responsive while that command is being executed.

    Please let me know about the results, and I'll make further suggestions to try getting to the bottom of this issue.

    Best regards,
    Vlas.

  3. 3 Posted by revealapp on 10 Mar, 2017 06:06 PM

    revealapp's Avatar

    Sorry for the delay, was working on other things. I'm testing on simulator,
    the Reveal server is running, and I'm not paused at a breakpoint. It looks
    like I was using this breakpoint:

    expr (Class)NSClassFromString(@"IBARevealLoader") == nil ? (void
    *)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer",
    0x2) : ((void*)0)

    Interestingly, it only seems to have this timeout on a specific branch.

    I updated to the reveal load breakpoint, and it seems to be working now.

    I'm up and running, but if there's any other troubleshooting I can do
    locally that might be interesting/useful to you, let me know and I'm happy
    to help.

  4. 4 Posted by revealapp on 10 Mar, 2017 06:59 PM

    revealapp's Avatar

    I spoke too soon. I am still getting intermittent timeouts. It looks like
    Reveal has a 10-second timeout, and the server takes closer to 12 seconds
    to respond:

    10:53:40 [cpickslay] ~ $ dns-sd -L Reveal--12baeb65 _reveal._tcp.
    Lookup Reveal--12baeb65._reveal._tcp..local
    DATE: ---Fri 10 Mar 2017---
    10:54:16.855 ...STARTING...
    10:54:16.856 Reveal--12baeb65._reveal._tcp.local. can be reached at
    localhost.:49581 (interface -1)
     appIsExt=false devSysVer=10.2 devLocalModel=iPhone appName=Bleacher\
    Report protoVer=39 deviceID=ChocolateChipBurrito-iOS-10.2 appShortVers=5.0
    appVers=1055 appExtTypeId= devName=Chocolate\ Chip\ Burrito devSysName=iOS
    isSim=true appBundleId=com.bleacherreport.TeamStreamDev devModel=iPhone
    ^C

    10:55:32 [cpickslay] ~ $ time curl -s -D -
    http://localhost:49581/application -o /dev/null
    HTTP/1.1 200 OK
    Reveal-Device-Simulator: YES
    Content-Type: application/json; charset=utf-8
    Reveal-Protocol-Version: 39
    Content-Length: 6668905
    Reveal-System-Version: 10.2
    Date: Fri, 10 Mar 2017 18:56:14 GMT
    Reveal-System-Name: iOS
    Reveal-Device-Model: iPhone
    Accept-Ranges: bytes

    real 0m11.655s
    user 0m0.008s
    sys 0m0.017s

  5. Support Staff 5 Posted by Vlas Voloshin on 11 Mar, 2017 01:07 AM

    Vlas Voloshin's Avatar

    Hi again Christopher, thanks for this information.

    reveal load command is indeed the recommended method for breakpoint integration for Reveal v.5 and later. However, it doesn't affect the amount of time required to inspect your view hierarchy.

    12 seconds is indeed beyond the current timeout for Reveal Server to respond. Under normal circumstances, it should take just under a few seconds for Reveal Server to serialise your view hierarchy, though very large ones can theoretically reach the 10-second limit. However, the field Content-Length: 6668905 from the response you've provided tells me that the actual amount of content being loaded is not that large – it should only have taken about a second to serialise. This makes me think that there could be something that slows down Reveal Server in your app. To determine what that is, I'll need a Time Profiler instrument report. Unless, of course, you can provide us with the source code for your app (which I don't expect you to), please follow these steps to collect it:

    • Run your app normally, with Reveal integration enabled. We'll need this in order to make sure Reveal Server loads via the breakpoint as usual.
    • When your app finishes loading, open the scene in it where you'd get timeouts in Reveal.
    • Using the same method as you've used before, determine the current URL to Reveal Server. Try the same time curl -s -D - http://localhost:<port>/application -o /dev/null command in Terminal as you did before, to make sure that the response time is over 10 seconds again.
    • Now go back to Xcode, open the Debug navigator (⌘6 shortcut), and click the "CPU" gauge.
    • In the CPU Report that opens, click "Profile in Instruments". Click "Transfer" in the dialog that appears.
    • Time Profiler will start collecting data immediately. Go back to Terminal and execute the time curl... command again. Wait until it completes.
    • Back in the Time Profiler, click "Stop" (or just hit ⌘R shortcut) to stop profiling. Use FileSave command (or ⌘S) to save the profiling report to disk.
    • Please zip the report and attach it here. If the archive is larger than 10Mb, I'll have to ask you to upload it somewhere else and provide me with a link, as unfortunately our support system imposes attachment size limits.

    You can also try to see if you can find the culprit yourself: focus on the Main Thread in the finished profiler report, then in Display Settings (⌘2 shortcut) enable "Top Functions". While this will mostly show some symbols internal to Reveal Server implementation, you might see something related to your code (marked with a black "user space" icon). In any case, I'd be happy to help with this.

    You have mentioned that the timeout occurs on a specific branch – maybe something has been added or modified there, and Reveal Server simply triggers some performance-heavy code section? This usually never happens as Reveal tries its best not to cause side effects when gathering information about your view hierarchy, but in certain cases (e.g. if a view's method or property is overridden in a particular way) this might not be the case. A Time Profiler report can shed some light on this.

    Looking forward for your reply!

    Best regards,
    Vlas.

  6. 6 Posted by revealapp on 11 Mar, 2017 02:22 AM

    revealapp's Avatar

    Thanks Vlas

    I've tried what you suggest below, with no luck. When I try to profile by transferring the debug session, the app in the simulator becomes unresponsive, and the curl command never completes (though I can see the Reveal server is still running). If I instead click Restart to start a new debug session in Instruments, I can interact with the app, but it seems the reveal breakpoint doesn't hit and the reveal server is not running.

    I did poke around at the Time Profiler report with the app just running without Reveal, but I don't see anything unusual there. While the app is unresponsive, there is some small CPU utilization, but not much.

    I'm going to try again on Monday on someone else's machine to see if they have the same performance problems. But I wanted to fill you in in case the problem with the app not responding once I transfer the debug session rings any bells.

    Christopher Pickslay

    Sent from
    https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature

    On Fri, Mar 10, 2017 at 5:07 PM Vlas Voloshin

    <
    mailto:Vlas Voloshin <[email blocked]>
    > wrote:

    a, pre, code, a:link, body { word-wrap: break-word !important; }

    pre { width: 92%; margin: 10px 2%; padding: 5px 2%; background: #efefef; border: 1px solid #d6d6d6 } blockquote { margin-left: 0; padding-left: 1em; border-left: 5px solid #ccc; }

  7. Support Staff 7 Posted by Vlas Voloshin on 13 Mar, 2017 02:56 AM

    Vlas Voloshin's Avatar

    Hi Christopher,

    Sounds like Xcode doesn't do the best job to help us with this... Not sure if it's indicative of some issue in your app or just some bug in Xcode, but I guess we'll need to use a different way to profile your app. Please try the following steps (note that some are the same as in my previous message):

    • Disable Reveal integration breakpoint for now – you can enable it again once we're done.
    • Make sure your project's working copy is clean. We'll make some changes that I'll ask you to reset later.
    • In Reveal, use HelpShow Reveal Library in FinderiOS Library menu. Drag and drop the framework directly into your project in Xcode. Tick "Copy items if needed" in the "Add files" dialog.
    • Open your project target's "General" settings, scroll down to "Embedded Binaries" and add RevealServer.framework from your project into the list. Xcode usually doesn't do that automatically.
      • Please note: this Reveal integration method should only be used for debugging. It's not recommended to follow these steps normally.
    • Now run your app for profiling using ProductProfile menu. Choose "Time Profiler" in the instrument selector. Click "Record" button or hit ⌘R shortcut to start your app and gather profiling data.
    • When your app finishes loading, open the scene in it where you'd get timeouts in Reveal.
    • Using the same method as you've used before, determine the current URL to Reveal Server. Try the same time curl -s -D - http://localhost:<port>/application -o /dev/null command in Terminal as you did before, and check whether the response time is over 10 seconds again.
    • Once the curl command finishes, go back to Instruments and click "Stop" (or just hit ⌘R shortcut) to stop profiling. Use FileSave menu (or ⌘S) to save the profiling report to disk.
    • Once your profiling report is complete, you can git reset --hard the changes you've made to the project, and re-enable Reveal breakpoint. I'd also recommend cleaning the build folder and deleting your app from the Simulator to get rid of the "leftovers".
    • Please zip the report and attach it here. If the archive is larger than 10Mb, I'll have to ask you to upload it somewhere else and provide me with a link, as unfortunately our support system imposes attachment size limits.

    I understand that these steps are somewhat more complex, and I appreciate you taking the time to follow them. Hopefully this time everything works correctly, and we'll get some useful information on Reveal Server performance in your app!

    Best regards,
    Vlas.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • Screen_Region_2017-03-02_at_18.12.35.png 34.2 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac