Open aureq opened 5 months ago
Thanks for reporting! From a cursory look, this looks like an issue in the upstream provider: https://github.com/kreuzwerker/terraform-provider-docker/blob/master/internal/provider/data_source_docker_logs.go#L118 seems to assume each line of output is at least 8 bytes long, which is wrong in the example you've provided.
I believe this is the same issue as https://github.com/kreuzwerker/terraform-provider-docker/issues/544 upstream, although that issue might have been lost, so it'd be worth raising a new one with the repro here.
Great debugging @VenelinMartinov!
As a workaround to avoid the crash, it's possible to execute the container while at the same time retrieving the logs.
Note that due to https://github.com/kreuzwerker/terraform-provider-docker/issues/545 these logs will probably include some mangled prefixes. Setting discardHeaders
to false
on the getLogs
call should also work around the issue.
While I couldn't get the same error message as our customer
@aureq what error were they seeing?
Removing the p1 label since this is an upstream issue with an existing workaround.
Describe what happened
(Related to this Slack thread)
While investigating the thread mentioned above, I create a basic container printing garbage utf-8 sequences. While I couldn't get the same error message as our customer, I found 4 occurrences of a crash when calling the datasource
Docker.GetLogs()
.The app consists of:
echo
ing the sequencesSample program
Program.cs
Dockerfile
app/entrypoint.sh
Log output
After a close look, the 5 different test cases all generate the same crash.
Affected Resource(s)
Docker.GetLogs
Output of
pulumi about
Additional context
As a workaround to avoid the crash, it's possible to execute the container while at the same time retrieving the logs.
Attach
,Logs
andMustRun
need to be set as shown above and thenMyDockerContainer.ContainerLogs
should contain the logs generated during the container's execution..Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).