runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Failed USB connection via port 54050, error 61, in tvOS arm64 Release AllSubsets_Mono

Open carlossanlop opened this issue 2 years ago • 10 comments

  • Affected PR: https://github.com/dotnet/runtime/pull/82554
  • Affected queue: Build tvOS arm64 Release AllSubsets_Mono
  • Job result: https://dev.azure.com/dnceng-public/public/public%20Team/_build/results?buildId=182544&view=logs&j=f4520fb1-1559-5885-1d9c-3cb3f6a85e23&t=6c7a8cfe-f92e-569a-eef9-b2ad3e13056d&l=57
  • Artifacts: https://dev.azure.com/dnceng-public/public/_build/results?buildId=182544&view=ms.vss-test-web.build-test-results-tab&runId=3552693&resultId=100001&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab
  • console.log output file repeatedly shows the USB connection error below: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-82554-merge-8bea006df9294c8cbf/System.Runtime.Tests/1/console.76e18c2e.log?helixlogtype=result
[13:58:26] dbug: [TCP tunnel] Xamarin.Hosting: Failed to connect to port 54050 (8915) on device (error: 61)
[13:58:26] dbug: [TCP tunnel] Xamarin.Hosting: Attempting USB tunnel between the port 54050 on the device and the port 54050 (8915) on the mac: 61

It's a bit confusing, since there's a net.dot.System.Runtime.Tests.log output file that shows some succeeded System.Runtime test executions.

Anyway, the USB failure seems to be unique, so I'm adding the "known issue" json text to track it.

{
  "ErrorMessage": "Xamarin.Hosting: Failed to connect to port",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}

Report

Build Definition Test Pull Request
533615 dotnet/runtime System.Text.Json.Serialization.Tests.UnmappedMemberHandlingTests_AsyncStream.JsonTypeInfo_ReturnsExpectedUnmappedMemberHandling dotnet/runtime#96169
533192 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#97195
533025 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
531719 dotnet/runtime System.Text.Json.Serialization.Tests.StreamTests_DeserializeAsyncEnumerable.DeserializeAsyncEnumerable_ReadSimpleObjectAsync dotnet/runtime#96169
530853 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#88167
531577 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#96974
531169 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
530446 dotnet/runtime System.Text.Json.Serialization.Tests.StreamTests_AsyncWithSmallBuffer.NestedJsonFileCircularDependencyTest dotnet/runtime#96169
529628 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
529638 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
529644 dotnet/runtime System.Xml.Linq.TreeManipulation.Tests.WorkItemExecution
529437 dotnet/runtime System.Xml.Misc.Tests.WorkItemExecution
529322 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
529025 dotnet/runtime System.ValueTuple.Tests.WorkItemExecution
529022 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
528490 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#96974
528549 dotnet/runtime System.Diagnostics.Tests.DebugTestsUsingListeners.Debug_WriteLineNull_IndentsEmptyStringProperly dotnet/runtime#88167
528334 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
528331 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution
528263 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#96974
527989 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
527804 dotnet/runtime System.Memory.Tests.WorkItemExecution dotnet/runtime#96974
526413 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
526231 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
526046 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
525794 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
525537 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
525544 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
524696 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
524688 dotnet/runtime System.Xml.Linq.xNodeReader.Tests.WorkItemExecution
524678 dotnet/runtime Microsoft.NETCore.Platforms.Tests.WorkItemExecution
524337 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
523644 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
523004 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
522895 dotnet/runtime System.IO.Pipes.Tests.WorkItemExecution
522451 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#96778
520498 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
522376 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
522362 dotnet/runtime System.Xml.RW.XmlConvert.Tests.WorkItemExecution
521253 dotnet/runtime System.Xml.XmlSerializer.ReflectionOnly.Tests.WorkItemExecution dotnet/runtime#96684
521526 dotnet/runtime System.Runtime.CompilerServices.VisualC.Tests.WorkItemExecution
521035 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
521016 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
520888 dotnet/runtime System.Xml.RW.XmlWriter.Tests.WorkItemExecution
520802 dotnet/runtime System.Threading.Tasks.Tests.WorkItemExecution
520561 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
520489 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution
520325 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#96684
519643 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution dotnet/runtime#96684
519094 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution dotnet/runtime#96658
516278 dotnet/runtime System.Text.Json.Serialization.Tests.CollectionTestsDynamic_SyncStream.DictionaryOfObject_NonPrimitiveTypes dotnet/runtime#96169
515337 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution dotnet/runtime#96270
515328 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution
515137 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
514939 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution
514729 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
514508 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution
514489 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution dotnet/runtime#96243
513866 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution
513695 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution dotnet/runtime#96243
513152 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution
512367 dotnet/runtime System.Threading.Tasks.Parallel.Tests.WorkItemExecution
511957 dotnet/runtime System.Threading.Tasks.Dataflow.Tests.WorkItemExecution
511815 dotnet/runtime System.Linq.Tests.WorkItemExecution
511505 dotnet/runtime System.Linq.Tests.WorkItemExecution
511441 dotnet/runtime System.Linq.Tests.WorkItemExecution
511284 dotnet/runtime System.Linq.Tests.WorkItemExecution
511204 dotnet/runtime System.Linq.Tests.WorkItemExecution
510942 dotnet/runtime System.Linq.Tests.WorkItemExecution
510757 dotnet/runtime System.Linq.Tests.WorkItemExecution
510401 dotnet/runtime System.Linq.Tests.WorkItemExecution
510418 dotnet/runtime System.Text.Json.Serialization.Tests.CollectionTestsDynamic_String.Read_SpecializedCollection_Throws dotnet/runtime#96169
510202 dotnet/runtime System.Memory.Tests.WorkItemExecution
509716 dotnet/runtime System.Linq.Tests.WorkItemExecution
509549 dotnet/runtime System.Text.Json.Serialization.Tests.CacheTests.MultipleThreads_SameType_DifferentJson dotnet/runtime#96169
509359 dotnet/runtime System.Linq.Tests.WorkItemExecution
507446 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#96270
509338 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#96243
509126 dotnet/runtime System.Text.Json.Serialization.Tests.CollectionTestsDynamic_AsyncStream.ReadSimpleImmutableArray dotnet/runtime#96169
508973 dotnet/runtime System.Text.Json.Serialization.Tests.CollectionTestsDynamic_AsyncStreamWithSmallBuffer.WritePrimitiveImmutableListT dotnet/runtime#96169
508957 dotnet/runtime System.Linq.Tests.WorkItemExecution
508952 dotnet/runtime System.Runtime.Tests.WorkItemExecution dotnet/runtime#96169
508845 dotnet/runtime System.Linq.Tests.WorkItemExecution
508784 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#92523
508502 dotnet/runtime System.Linq.Tests.WorkItemExecution
508356 dotnet/runtime System.Linq.Tests.WorkItemExecution
507905 dotnet/runtime System.Linq.Tests.WorkItemExecution
507758 dotnet/runtime System.Linq.Tests.WorkItemExecution
507332 dotnet/runtime System.Text.Json.Serialization.Tests.StreamTests_AsyncWithSmallBuffer.NestedJsonFileCircularDependencyTest dotnet/runtime#96169
506741 dotnet/runtime System.Linq.Tests.WorkItemExecution dotnet/runtime#96243

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 22 90

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=323893 Error message validated: Xamarin.Hosting: Failed to connect to port Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 6/28/2023 9:28:49 PM UTC

carlossanlop avatar Feb 24 '23 18:02 carlossanlop

Tagging subscribers to 'os-tvos': @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.

Issue Details
  • Affected PR: https://github.com/dotnet/runtime/pull/82554
  • Affected queue: Build tvOS arm64 Release AllSubsets_Mono
  • Job result: https://dev.azure.com/dnceng-public/public/public%20Team/_build/results?buildId=182544&view=logs&j=f4520fb1-1559-5885-1d9c-3cb3f6a85e23&t=6c7a8cfe-f92e-569a-eef9-b2ad3e13056d&l=57
  • Artifacts: https://dev.azure.com/dnceng-public/public/_build/results?buildId=182544&view=ms.vss-test-web.build-test-results-tab&runId=3552693&resultId=100001&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab
  • console.log output file repeatedly shows the USB connection error below: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-82554-merge-8bea006df9294c8cbf/System.Runtime.Tests/1/console.76e18c2e.log?helixlogtype=result
[13:58:26] dbug: [TCP tunnel] Xamarin.Hosting: Failed to connect to port 54050 (8915) on device (error: 61)
[13:58:26] dbug: [TCP tunnel] Xamarin.Hosting: Attempting USB tunnel between the port 54050 on the device and the port 54050 (8915) on the mac: 61

It's a bit confusing, since there's a net.dot.System.Runtime.Tests.log output file that shows some succeeded System.Runtime test executions.

Anyway, the USB failure seems to be unique, so I'm adding the "known issue" json text to track it.

{
  "ErrorMessage": "Xamarin.Hosting: Failed to connect to port 54050 (8915) on device (error: 61)",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}
Author: carlossanlop
Assignees: -
Labels:

arch-arm64, blocking-clean-ci, area-VM-meta-mono, runtime-mono, os-tvos, Known Build Error

Milestone: 7.0.x

ghost avatar Feb 24 '23 18:02 ghost

https://github.com/dotnet/arcade/issues/11683

lewing avatar Feb 24 '23 18:02 lewing

Might be better to keep this open since it's tagged with a known build error label. I don't think we need to have blocking clean ci attached to it.

steveisok avatar Feb 24 '23 18:02 steveisok

I originally logged this issue for tvOS, but I'm also seeing it in iOS arm64. Here is a fresh example:

  • PR: https://github.com/dotnet/runtime/pull/85491
  • Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=288704&view=results
  • Job: ios-arm64 Release AllSubsets_Mono
  • Job results: https://dev.azure.com/dnceng-public/public/_build/results?buildId=288704&view=logs&j=7f49df26-8126-5de3-bf2f-6ac6bde01830&t=c62b6a8c-bf71-5057-7f45-9c355fe0b802
  • Log file: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-85491-merge-e34e065cea094eb8b3/System.Runtime.Tests.Attempt.3/1/console.43a8ef2d.log?helixlogtype=result
[22:47:19] dbug: [TCP tunnel] Xamarin.Hosting: Attempting USB tunnel between the port 52498 on the device and the port 52498 (4813) on the mac: 61
[22:47:19] dbug: [TCP tunnel] Xamarin.Hosting: Failed to connect to port 52498 (4813) on device (error: 61)

carlossanlop avatar May 30 '23 16:05 carlossanlop

https://helix.dot.net/api/jobs/4cbf9a6d-6389-43f9-9e2c-16540105525e/workitems?api-version=2019-06-17

Both tests pass based on the logs, but one of them is unable to establish a connection via TCP, while the other establishes a connection every time. This failure seems to be permanent and could be a good starting point for identifying the issue.

When I attempted to reproduce the error locally, I encountered the same issue. However, I have not opened any ports, which might be a possible cause. I assume that the CI machines have ports 49152-65535 (source https://support.apple.com/en-us/HT202944).

I wonder if certain ports are busy or if there might be a firewall misconfiguration.

@premun Any ideas why the error persists when running the functional test?

/cc @akoeplinger @steveisok

kotlarmilos avatar Jun 30 '23 13:06 kotlarmilos

@kotlarmilos if this was firewall misconfiguration, I think we should see the same set of machines failing. I don't think this is the case: https://dataexplorer.azure.com/clusters/engsrvprod/databases/engineeringdata?query=H4sIAAAAAAAAAx3MuwoCMRAF0N6vGLbabQI+ECy2EgsLBSvrMbmQoJmESaKr+PEu9odzTXo/VsSy+NLLQ0GHKdR9cqBxpN2KWBxdGhrOHEFBqO9SmcxybTi67cZwzg/Up0kZ0g3zUlqMrOEDsqlJ7Qe6venE1gf5HzNRiINSDrCetf4ANsm6/4QAAAA=

Seems like this is not tied to specific machines?

@premun Any ideas why the error persists when running the functional test?

Do I understand it correctly that you have 100% repro with a specific app?

premun avatar Jun 30 '23 13:06 premun

Host: osx-arm64 Device: iPhone iOS 16.5.1 Xcode: 14.3.1 (14E300c)

  1. Install xharness locally (I don't believe it has anything with the repro, that is just my local setup):
# Using bash on Linux/MacOS
curl -L https://aka.ms/get-xharness | bash -
  1. Download the bundle and place it in a test directory. tracing_eventpipe_tcp_issue.zip

  2. Run the following script from the local directory:

./xharness apple test --app "<LOCAL_DIRECTORY>/tracing_eventpipe_tcp_issue.app" --target "ios-device" --output-directory "<LOCAL_DIRECTORY>/output" --set-env=MONO_APPLE_APP_ENTRY_POINT_LIB_NAME=testdir-buffersize/buffersize.dll --set-env=MONO_APPLE_APP_ASSEMBLY_LOAD_PREFIX=testdir-buffersize --xcode /Applications/Xcode.app -v --launch-timeout 00:05:00

The test should start executing and may fail (due to other reasons), but the TCP connection is not established. The app fails locally with

fail: Application test run crashed
      TCP Tunnel Connection Failed to connect to TCP port

kotlarmilos avatar Jun 30 '23 14:06 kotlarmilos

For the apple test command, XHarness expects the application to contain a TestRunner which is a library you can find in this repository. This library executes unit tests similarly how you would execute them on other platforms. However, the TestRunner from this repository contains more mechanisms that help to work around some issues (mostly in Apple platforms).

The runtime test did not utilize the TestRunner, and it was expected to fail. After further investigation and monitoring of the CI, it appears that the TCP failures might be related to the app. If such a failure occurs, ensure that the app functions correctly or consider using apple run commands.

kotlarmilos avatar Sep 11 '23 10:09 kotlarmilos

Removed [7.0] from the title since this appears to be happening across branches.

ericstj avatar Sep 13 '23 15:09 ericstj

@ivanpovazan If you try to run the library tests using the apple run command, please share your results. I suspect the issue is either app-specific or related to the AppleTestRunner. We haven't observed this problem in runtime tests that utilize the apple run command.

kotlarmilos avatar Sep 29 '23 08:09 kotlarmilos

@kotlarmilos and myself are looking into this.

ivanpovazan avatar Jun 25 '24 09:06 ivanpovazan

Removing the Xamarin.Hosting: Failed to connect to port match string because it's too general and it's matching un-related failures. I'll keep the issue fyi: @ivanpovazan @kotlarmilos

matouskozak avatar Aug 05 '24 10:08 matouskozak