microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
173 stars 26 forks source link

Visual Studio reports 'invalid value for "since"' when starting container #419

Open kitgrose opened 4 months ago

kitgrose commented 4 months ago

I recently opened Visual Studio and rebuilt a Docker Compose project without making any changes since it was last run.

Visual Studio's Containers window shows a banner saying "An error occurred during the stream operation":

A screenshot of the error banner in the Visual Studio Containers window

When I click the View Details link, I get a dialog box saying:

Containers Tools Extensions

invalid value for "since": failed to parse value as time or duration: "16:12:44".\r\n\r\nFor more troubleshooting information, go to https://aka.ms/DockerToolsTroubleshooting

The broken formatting (CRLF literals, lowercase starting letter on the error message, weird pluralisation and formatting of the header, etc.) are all exactly as per the dialog, which makes it feel like an error generated by a less trustworthy third party:

A screenshot of the Container Tools Extensions error dialog

I've seen this dialog before and I'm fairly sure it went away once I restarted Docker, but surely 16:12:44 is a valid duration, and should be supported.

patverb commented 4 months ago

I've also noticed this bug rarely but haven't been able to track it down. Do you have a way to reproduce this consistently or is it just intermittent?

Also what version of VS and Docker are you using?

kitgrose commented 4 months ago

I haven't figured out reproduction instructions, no, but I do notice the behaviour seems to persist for me. It's happening for me again (still?), though, with the same duration (16:12:44) shown in the error dialog.

I've had a bit of a scan of the output of docker inspect for some of my key containers and volumes, but I don't see anything with a timestamp like that.

I do perform fairly regular updates of both VS and Docker, but here's the versions I have currently:

Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.8.5

Docker Desktop version: 4.26.1 (131620) Docker engine version: 24.0.7 Docker Compose version: 2.23.3-desktop.2

HydTechie commented 3 days ago

any update on Visual Studio, experts?

patverb commented 3 days ago

@HydTechie Do you have the exact same error mesage with 16:12:44 or is the same error message just with a different timestamp?

patverb commented 3 days ago

@kitgrose sorry this issue slipped through the cracks. I have a suspicion on what is causing this, but I would like to confirm.

  1. What is your base image? Is it a standard dotnet runtime/aspnet image or something else.
  2. Do you set the time zone or anything similar with datetime inside the image?
  3. Does the error occur when looking at a compose logs or a single container logs?
  4. When you get the error could you run docker compose --ansi never -p <compose project name> logs -t and look for the timestamp that is in the error message and supply a few log lines including before and after the offending timestamp.

The first part of the error is from docker as --since requires a datetime and not just the time. I think the issue could be we are splitting/parsing the log line incorrectly and only storing the time and not the whole datetime.