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

ArgumentNullException executing Hosts.Discover #33

Closed
TioLuiso opened this issue May 20, 2017 · 2 comments
Closed

ArgumentNullException executing Hosts.Discover #33

TioLuiso opened this issue May 20, 2017 · 2 comments
Assignees
Labels

Comments

@TioLuiso
Copy link

Have just begun learning docker, and downloaded versión 17.3.1-ce. I am trying to use FluentDocker to setup and throw machines at integration tests. Looks like a good scenario for the library

However, trying to run Hosts.Discover() explodes with an ArgumentNullException.

Downloaded your code and run MachineServiceTests.DiscoverShouldReturnNativeWhenSuchIsPresent

Call Stack is

Newtonsoft.Json.Linq.Extensions.Value(IEnumerable1 value) Ductus.FluentDocker.Executors.Parsers.MachineInspectResponseParser.Process(ProcessExecutionResult response) in MachineInspectResponseParser.cs: line: 28 Ductus.FluentDocker.Executors.ProcessExecutor2.Execute() in ProcessExecutor.cs: line: 68
Ductus.FluentDocker.Commands.Machine.Inspect(String machine) in Machine.cs: line: 23
Ductus.FluentDocker.Services.Hosts.<>c.b__0_0(MachineLsResponse machine) in Hosts.cs: line: 23
System.Linq.Enumerable.<>c__DisplayClass7_03.<CombineSelectors>b__0(TSource x) System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection)
Ductus.FluentDocker.Services.Hosts.Discover() in Hosts.cs: line: 22
Ductus.FluentDockerTest.ServiceTests.MachineServiceTests.DiscoverShouldReturnNativeWhenSuchIsPresent() in MachineServiceTests.cs: line: 21

Checking it closely the problem lies at MachineInspectResponseParser.
To retrieve memory, it does

MemorySizeMb = j["Driver"]["Memory"].Value(),

but the objet it is trying to parse doesn't have a memory entry inside Driver. It has MemSize instead.

So it explodes

@mariotoffia mariotoffia self-assigned this May 22, 2017
@mariotoffia
Copy link
Owner

Thanks for the report. I'll fix this during this week

mariotoffia pushed a commit that referenced this issue May 22, 2017
The response for memory size is now "MemSize" instead of "Memory" in old machine. The fix copes with both types.
@mariotoffia
Copy link
Owner

I've fixed it and published a net set of nugget packages (2.2.2) that handles both old style and new style of json payload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants