Steps to reproduce the issue:
1.delete all containers using Docker Desktop
2.create client:
DockerClient client = new DockerClientConfiguration(new Uri("tcp://localhost:2375")).CreateClient();
3.attempt to get lit of containers
var containers = await client.Containers.ListContainersAsync(new ContainersListParameters
{
All = true // Include stopped containers in the list
});
What actually happened?:
error thrown:
Category: OBSStartupService.Worker EventId: 0 Queues Startup error: Object reference not set to an instance of an object. Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Docker.DotNet.QueryString1.<>c__132.b__13_0(PropertyInfo p) at System.Linq.Enumerable.WhereArrayIterator1.MoveNext() at System.Linq.Enumerable.<Any>g__WithEnumerator|36_0[TSource](IEnumerable1) at System.Linq.Enumerable.AnyTSource at Docker.DotNet.QueryString1.FindAttributedPublicProperties[TValue,TAttribType]() at Docker.DotNet.QueryString1..ctor(T) at Docker.DotNet.ContainerOperations.ListContainersAsync(ContainersListParameters, CancellationToken ) at OBSStartupService.Services.QueueStartupService.GetContainerByName(DockerClient, String) at OBSStartupService.Services.QueueStartupService.GetOrCreateContainer(DockerClient, String) at OBSStartupService.Services.QueueStartupService.StartContainer(DockerClient) at OBSStartupService.Services.QueueStartupService.StartQueues() at OBSStartupService.Worker.ExecuteAsync(CancellationToken)
What did you expect to happen?:
an empty list of containers would be returned
Additional information:
when running in debug in VS 2022, it works as expected. When deployed to a test environment (windows 11 azure VM), and installed as a windows service like:
sc.exe create "Omedus Base Station Startup Service" binpath= "C:\Omedus\OBSStartupService.exe"
Output of
dotnet --info
:What version of Docker.DotNet?: 3.125.15
Steps to reproduce the issue: 1.delete all containers using Docker Desktop 2.create client: DockerClient client = new DockerClientConfiguration(new Uri("tcp://localhost:2375")).CreateClient(); 3.attempt to get lit of containers var containers = await client.Containers.ListContainersAsync(new ContainersListParameters { All = true // Include stopped containers in the list });
What actually happened?: error thrown: Category: OBSStartupService.Worker EventId: 0 Queues Startup error: Object reference not set to an instance of an object. Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Docker.DotNet.QueryStringb__13_0(PropertyInfo p) at System.Linq.Enumerable.WhereArrayIterator
1.<>c__13
2.1.MoveNext() at System.Linq.Enumerable.<Any>g__WithEnumerator|36_0[TSource](IEnumerable
1) at System.Linq.Enumerable.AnyTSource at Docker.DotNet.QueryString1.FindAttributedPublicProperties[TValue,TAttribType]() at Docker.DotNet.QueryString
1..ctor(T) at Docker.DotNet.ContainerOperations.ListContainersAsync(ContainersListParameters, CancellationToken ) at OBSStartupService.Services.QueueStartupService.GetContainerByName(DockerClient, String) at OBSStartupService.Services.QueueStartupService.GetOrCreateContainer(DockerClient, String) at OBSStartupService.Services.QueueStartupService.StartContainer(DockerClient) at OBSStartupService.Services.QueueStartupService.StartQueues() at OBSStartupService.Worker.ExecuteAsync(CancellationToken)What did you expect to happen?: an empty list of containers would be returned
Additional information: when running in debug in VS 2022, it works as expected. When deployed to a test environment (windows 11 azure VM), and installed as a windows service like: sc.exe create "Omedus Base Station Startup Service" binpath= "C:\Omedus\OBSStartupService.exe"
it throws the above error.
dotnet --info from the test PC is shown below
Host: Version: 8.0.5 Architecture: x64 Commit: 087e15321b RID: win-x64
.NET SDKs installed: No SDKs were found.
.NET runtimes installed: Microsoft.AspNetCore.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables: Not set
global.json file: Not found