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

Log issue #687

Closed
sczhh opened this issue Aug 30, 2021 · 14 comments · Fixed by #705
Closed

Log issue #687

sczhh opened this issue Aug 30, 2021 · 14 comments · Fixed by #705

Comments

@sczhh
Copy link

sczhh commented Aug 30, 2021

After updating to the latest version, there seems to be a problem with log reading. The previous version did not have this problem

@tg123
Copy link
Member

tg123 commented Aug 30, 2021

may i know what do you mean by 'a problem with log reading'

@sczhh
Copy link
Author

sczhh commented Aug 30, 2021

When I set the "follow" parameter, the method freezes.

@tg123
Copy link
Member

tg123 commented Aug 30, 2021

this is a know bug fixed by #681

I was thinking you are talking about logs emitted by sdk

@sczhh
Copy link
Author

sczhh commented Aug 30, 2021

How should I use it?

@tg123
Copy link
Member

tg123 commented Aug 30, 2021

either wait for release copy or clone my branch then add src ref

@sczhh
Copy link
Author

sczhh commented Aug 31, 2021

Is the old "ReadNamespacedPodLogAsync" method unavailable?

@tg123
Copy link
Member

tg123 commented Aug 31, 2021

yes api does not get changed

@sczhh
Copy link
Author

sczhh commented Aug 31, 2021

Hope to post soon because I am using it.

@stefanloerwald
Copy link

I'm affected by the same issue. Trying to instantiate a StreamReader with a log stream created by ReadNamespacedPodLogAsync results in error Stream was not readable.:

var log_stream = await kubernetes_client.ReadNamespacedPodLogAsync(pod_name, "default", container: "foo", follow: true, cancellationToken: cancellation_token);
using var sr = new StreamReader(log_stream);

Works fine with V5.0.20, but not with V6.0.1.

@sczhh sczhh closed this as completed Sep 1, 2021
@sczhh sczhh reopened this Sep 1, 2021
@tg123
Copy link
Member

tg123 commented Sep 14, 2021

fixed by #681

@tg123 tg123 closed this as completed Sep 14, 2021
@stefanloerwald
Copy link

I now get a different error for reading logs:

Cannot access a disposed object.
Object name: 'Http2ReadStream'.
   at System.Net.Http.Http2Connection.Http2Stream.Http2ReadStream.Read(Span`1 destination)
   at System.Net.Http.HttpBaseStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.StreamReader.ReadBuffer()
   at System.IO.StreamReader.get_EndOfStream()

My code is:

var log_stream = await kubernetes_client.ReadNamespacedPodLogAsync(pod_name, "default", container: "foo", follow: true, cancellationToken: cancellation_token);
using var sr = new StreamReader(log_stream);
while (!sr.EndOfStream) // exception thrown here
{
   var line = await sr.ReadLineAsync();
}

@stefanloerwald
Copy link

@tg123 would you like me to open a new issue for this or should we just re-open this one?

@tg123 tg123 reopened this Sep 17, 2021
@tg123
Copy link
Member

tg123 commented Sep 17, 2021

dup #704

@tg123
Copy link
Member

tg123 commented Sep 17, 2021

please use ReadNamespacedPodLogWithHttpMessagesAsync as a temp workaround, fix is on the way

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

Successfully merging a pull request may close this issue.

3 participants