Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestcontainersConfigurationConverter.ctor throws ArgumentNullException #485

Closed
pellared opened this issue Jun 22, 2022 · 0 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@pellared
Copy link
Contributor

pellared commented Jun 22, 2022

Describe the bug

An exception started to occur when upgraded from DotNet.Testcontainers 1.6.0 to Testcontainers 2.0.0.

System.AggregateException with System.ArgumentNullException is thrown from TestcontainersContainer.StartAsync on Windows Container.

To Reproduce
Steps to reproduce the behavior:

  1. Check out https://github.com/pellared/opentelemetry-dotnet-instrumentation/tree/bump-testcontainers (take notice that it is on bump-testcontainers branch)
  2. Run build.cmd Workflow --containers windows --WindowsContainerVersion ltsc2019 or build.cmd Workflow --containers windows --WindowsContainerVersion ltsc2022 (WindowsContainerVersion param depends on your Windows OS to use proper base image for the Windows container)
  3. See error

Expected behavior
Works as in the previous version (no exception is thrown).

Screenshots

13:26:11 [ERR] [xUnit.net 00:00:12.66]     IntegrationTests.AspNet.AspNetTests.SubmitsTraces [FAIL]
13:26:11 [DBG]   Failed IntegrationTests.AspNet.AspNetTests.SubmitsTraces [11 s]
13:26:11 [DBG]   Error Message:
13:26:11 [DBG]    System.AggregateException : One or more errors occurred.
13:26:11 [DBG] ---- System.ArgumentNullException : Value cannot be null.
13:26:11 [DBG] Parameter name: source
13:26:11 [DBG]   Stack Trace:
13:26:11 [DBG]      at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
13:26:11 [DBG]    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
13:26:11 [DBG]    at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
13:26:11 [DBG]    at IntegrationTests.Helpers.TestHelper.<StartContainerAsync>d__9.MoveNext() in C:\Users\rpajak\repos\opentelemetry-dotnet-instrumentation\test\integration-tests\IntegrationTests.Helpers\TestHelper.cs:line 88
13:26:11 [DBG] --- End of stack trace from previous location where exception was thrown ---
13:26:11 [DBG]    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
13:26:11 [DBG]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
13:26:11 [DBG]    at IntegrationTests.AspNet.AspNetTests.<SubmitsTraces>d__2.MoveNext() in C:\Users\rpajak\repos\opentelemetry-dotnet-instrumentation\test\integration-tests\aspnet\IntegrationTests.AspNet\AspNetTests.cs:line 29
13:26:11 [DBG] --- End of stack trace from previous location where exception was thrown ---
13:26:11 [DBG]    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
13:26:11 [DBG]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
13:26:11 [DBG] --- End of stack trace from previous location where exception was thrown ---
13:26:11 [DBG]    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
13:26:11 [DBG]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
13:26:11 [DBG] --- End of stack trace from previous location where exception was thrown ---
13:26:11 [DBG]    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
13:26:11 [DBG]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
13:26:11 [DBG] ----- Inner Stack Trace -----
13:26:11 [DBG]    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
13:26:11 [DBG]    at DotNet.Testcontainers.Clients.TestcontainersConfigurationConverter.ToNetworks.<Convert>b__2_0(IDockerNetwork network)
13:26:11 [DBG]    at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
13:26:11 [DBG]    at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
13:26:11 [DBG]    at DotNet.Testcontainers.Clients.TestcontainersConfigurationConverter..ctor(ITestcontainersConfiguration configuration)
13:26:11 [DBG]    at DotNet.Testcontainers.Clients.DockerContainerOperations.<RunAsync>d__16.MoveNext()
13:26:11 [DBG] --- End of stack trace from previous location where exception was thrown ---
13:26:11 [DBG]    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
13:26:11 [DBG]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
13:26:11 [DBG]    at DotNet.Testcontainers.Clients.TestcontainersClient.<RunAsync>d__22.MoveNext()
13:26:11 [DBG] --- End of stack trace from previous location where exception was thrown ---
13:26:11 [DBG]    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
13:26:11 [DBG]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
13:26:11 [DBG]    at DotNet.Testcontainers.Containers.TestcontainersContainer.<Create>d__35.MoveNext()
13:26:11 [DBG] --- End of stack trace from previous location where exception was thrown ---
13:26:11 [DBG]    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
13:26:11 [DBG]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
13:26:11 [DBG]    at DotNet.Testcontainers.Containers.TestcontainersContainer.<StartAsync>d__27.MoveNext()

Desktop (please complete the following information):

  • Docker Desktop 4.9.1
  • Windows 10.0.19044

Additional context

I think the issue has been introduced here: 1a093fc#diff-ddb14d5a30822df3d949f10479846d36111e93feb525d0a7cc82be5e669ab584

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants