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

Terminal crashes if startup script output contains text that cannot be parsed as UTF-8 #208

Closed
fstachura opened this issue Mar 26, 2023 · 3 comments
Assignees
Milestone

Comments

@fstachura
Copy link

fstachura commented Mar 26, 2023

Describe the bug
Kathara terminal crashes if startup script output contains text that cannot be parsed as UTF-8

To Reproduce
Steps to reproduce the behavior:

  1. Create directory structure as shown in below
  2. Run kathara lstart
  3. pc1 terminal should show up and immediately crash with an error shown on screenshot below.

$ tree:

.
├── lab.conf
├── pc1/
│   └── a
├── pc1.startup
└── shared/

pc1/a:

test ó

lab.conf:

pc1[0]=A

pc1.startup:

cat /hostlab/pc1/a

Note that contents of pc1/a are not valid UTF-8:

cat pc1/a | xxd:

00000000: 7465 7374 20f3 0a                        test ..

file -i pc1/a

pc1/a: text/plain; charset=iso-8859-1

iconv -t utf-8 pc1/a

test iconv: illegal input sequence at position 5

Expected behavior
Kathara terminal renders text from pc1/a, starts the shell and stays open.

Screenshots

Error (visible for <1 second):

error
windows-error

"check" Command Output
*       Current Manager is: Docker (Kathara)
*       Manager version is: 23.0.1
*       Python version is: 3.10.7 (main, Dec 28 2022, 15:08:11) [GCC 12.2.0]
*       Kathara version is: 3.5.5
*       Operating System version is: Linux-6.1.15-1-lts-x86_64
*       Trying to run `Hello World` container...
Deploying devices...|###################################################################################################################################################################################################################################################| 1/1
*       Container run successfully.
Deleting devices...|####################################################################################################################################################################################################################################################| 1/1

Tested on Arch Linux (updated today) and Windows 10

@tcaiazzi
Copy link
Member

Hello @fstachura,

Sorry for the late reply and thanks for opening the issue. I'm happy to help you!

However, I tried to run a lab like the one you suggest, but I didn't receive any error.

image

Can you please attach a copy of your lab so that I can investigate further?

Many thanks,
Tommaso

@fstachura
Copy link
Author

Hello,
here is a copy of the lab:

lab.zip

@tcaiazzi
Copy link
Member

tcaiazzi commented Apr 3, 2023

Hi @fstachura,

Thanks for the lab. I stared to fix the problem on this branch: 209-waiting-startup-on-connect.

We have this error since the current version of Kathará manages the print of the startup logs on the terminal directly in Python and using the 'utf-8' encoding.

The new version will manage the print on the container, using its locale and preventing the terminal emulator from crashing.

Thanks for the help,
Tommaso

@tcaiazzi tcaiazzi added the Pending Fix in progress label Apr 4, 2023
@Skazza94 Skazza94 added this to the Release 3.6.5 milestone May 24, 2023
@Skazza94 Skazza94 modified the milestones: Release 3.6.2, Release 3.6.5 May 28, 2023
@Skazza94 Skazza94 self-assigned this Jul 13, 2023
Skazza94 added a commit that referenced this issue Jul 14, 2023
@Skazza94 Skazza94 removed the Pending Fix in progress label Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants