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

Newtonsoft.Json.JsonReaderException #672

Closed
Pentadome opened this issue Nov 11, 2022 · 5 comments
Closed

Newtonsoft.Json.JsonReaderException #672

Pentadome opened this issue Nov 11, 2022 · 5 comments
Assignees
Labels
question Have you tried our Slack workspace (https://testcontainers.slack.com)?

Comments

@Pentadome
Copy link

Pentadome commented Nov 11, 2022

Describe the bug

var dbContainer = new TestcontainersBuilder<MsSqlTestcontainer>()
    .WithDatabase(
        new MsSqlTestcontainerConfiguration("mcr.microsoft.com:2022-latest")
        {
            Password = Guid.NewGuid().ToString(),
        }
    )
    .Build();
    
await dbContainer.StartAsync(); ///< -- Newtonsoft.Json.JsonReaderException : Error parsing undefined value. Path '', line 1, position 2.
Newtonsoft.Json.JsonReaderException
  HResult=0x80131500
  Message=Error parsing undefined value. Path '', line 1, position 2.
  Source=Newtonsoft.Json
  StackTrace:
   at Newtonsoft.Json.JsonTextReader.<MatchAndSetAsync>d__21.MoveNext()
   at Newtonsoft.Json.JsonTextReader.<ParseValueAsync>d__8.MoveNext()
   at Docker.DotNet.Models.StreamUtil.<MonitorStreamForMessagesAsync>d__1`1.MoveNext()
   at Docker.DotNet.Models.StreamUtil.<MonitorResponseForMessagesAsync>d__2`1.MoveNext()
   at DotNet.Testcontainers.Clients.DockerImageOperations.<CreateAsync>d__9.MoveNext() in /home/runner/work/testcontainers-dotnet/testcontainers-dotnet/src/Testcontainers/Clients/DockerImageOperations.cs:line 81
   at DotNet.Testcontainers.Clients.TestcontainersClient.<RunAsync>d__22.MoveNext() in /home/runner/work/testcontainers-dotnet/testcontainers-dotnet/src/Testcontainers/Clients/TestcontainersClient.cs:line 252
   at DotNet.Testcontainers.Containers.TestcontainersContainer.<Create>d__34.MoveNext() in /home/runner/work/testcontainers-dotnet/testcontainers-dotnet/src/Testcontainers/Containers/TestcontainersContainer.cs:line 283
   at DotNet.Testcontainers.Containers.TestcontainersContainer.<StartAsync>d__27.MoveNext() in /home/runner/work/testcontainers-dotnet/testcontainers-dotnet/src/Testcontainers/Containers/TestcontainersContainer.cs:line 179

Desktop (please complete the following information):

OS Name	Microsoft Windows 10 Pro	
Version	10.0.19044 Build 19044	

Additional context
Sorry if it is something obvious, I really don't understand why I get this Json error.

@HofmeisterAn
Copy link
Collaborator

Do you use the latest version? Might be #634 (comment) and fixed with 2.2.0.

@Pentadome
Copy link
Author

Yes i'm using 2.2.0.

@HofmeisterAn
Copy link
Collaborator

The image looks not correct mcr.microsoft.com:2022-latest.

@Pentadome
Copy link
Author

The image looks not correct mcr.microsoft.com:2022-latest.

Ohh.. I feel like a idiot haha. It still doesnt work when i am logged in in docker dekstop, but i saw that was a known issue:

image

But I got it working now.
You dont want to know how much time i wasted 🤦

Thanks <3

@HofmeisterAn
Copy link
Collaborator

Ohh.. I feel like a idiot haha.

No worries. Happens to all of us sometimes.

It still doesnt work when i am logged in in docker dekstop, but i saw that was a known issue

Yes, we will take care of it in the next days.

@HofmeisterAn HofmeisterAn self-assigned this Nov 11, 2022
@HofmeisterAn HofmeisterAn added the question Have you tried our Slack workspace (https://testcontainers.slack.com)? label Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Have you tried our Slack workspace (https://testcontainers.slack.com)?
Projects
None yet
Development

No branches or pull requests

2 participants