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

error on k8s #376

Open
boyism80 opened this issue Nov 2, 2024 · 8 comments
Open

error on k8s #376

boyism80 opened this issue Nov 2, 2024 · 8 comments

Comments

@boyism80
Copy link

boyism80 commented Nov 2, 2024

when use on k8s this error occurred

errno 25: Inappropriate ioctl for device [::ioctl(Private::in.fd(), FIONREAD, &nread)]

i guess Private::in.fd() returns invalid value in k8s.

@flagarde
Copy link
Collaborator

flagarde commented Nov 3, 2024

Hello @boyism80, Thank you for the report. It was happening to github action too. I don't know exactly why it's not working anymore. I have to do workaround for this

@flagarde
Copy link
Collaborator

flagarde commented Nov 3, 2024

@boyism80 I have made some change on the code. It seems to fix the problem on github action but I don't know how to test it on k8s

@boyism80
Copy link
Author

boyism80 commented Nov 3, 2024

@boyism80 I have made some change on the code. It seems to fix the problem on github action but I don't know how to test it on k8s

really appreciate you.
I'll apply it to my project and let you know the results.

@boyism80
Copy link
Author

boyism80 commented Nov 3, 2024

I tested your update.
No more errors occurs on k8s but text doesn't appear.
In non k8s, text appears normally.
Additionally, I tested it using std::cout instead of Term::cout and it was appeared successfully on k8s.

tested on 802d7be

@flagarde
Copy link
Collaborator

flagarde commented Nov 3, 2024

@boyism80 Thx for the update. I think the two bugs are not related. cpp-terminal open the /dev/tty by itself to be sure Term::cout is always printing to a terminal (it can't be redirected) contrary to std::cout. It seems k8s is doing some tricks like this before us so the logic in cpp-terminal fail and so redirect Term::cout to /dev/null I not sure what kubernetes is doing and so don't know exatly how to circonvoluate that. Do you have some ideas?

@boyism80
Copy link
Author

boyism80 commented Nov 3, 2024

I also don't know why k8s have different results. I thought std::cout and Term:::cout were exactly the same, but I guess that's not it. I'll look at your code a little more when I have time. Thank you.

@boyism80
Copy link
Author

boyism80 commented Nov 4, 2024

I looked into how kubernetes handles logs. I'm not sure if I understand right, but kubernetes redirects stdout, stderr because even when the system shuts down, it has to keep records without removing them. I think it's not a cpp-terminal's bug. It happened because I didn't know how to log in kubernetes.
I have to approach it in a different way to use logs on Kubernetes.
Thanks for your hard work.

document : https://kubernetes.io/docs/concepts/cluster-administration/logging/

@flagarde
Copy link
Collaborator

flagarde commented Nov 5, 2024

@boyism80 Thanks for the informations. Maybe is not a bug per se but I wonder if in the case there is no /dev/tty available, Term::cout should not redirect to stdout. I will try to think about it

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

No branches or pull requests

2 participants