Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Exception ignored in: <io.TexIOWrapper name='<stdout>' mode='w'> in the tty logi (Read 5076 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Exception ignored in: <io.TexIOWrapper name='<stdout>' mode='w'> in the tty logi

Hello everyone, I write this because I started to see some errors from Friday and the only difference were the s6-scripts upgrades but I am not so sure.

So, I started to see some error in the boot but I don't know how to catch them and I don't know if those error are located in something like /var/log/boot. I would like to provide more information but I just can't. If you know how can I get the boot messages from s6 I will appreciate it. I searched in the web but I haven't found anything.

On the other hand, when the system boot I always get this message:

Exception ignored in: <io.TexIOWrapper name='<stdout>' mode='w'>

I searched in the web and it seems it's related to a script:

https://unix.stackexchange.com/questions/621794/exception-ignored-in-io-textiowrapper-name-stdout-mode-w-encoding-utf

This is the output from the command "ls /etc/s6/sv"

Code: [Select]
ls /etc/s6/sv/
agetty-serial  agetty-tty6     console-setup  dmesg-srv          logind         mount-filesystems  network             rc-local      syncthing-log   udev
agetty-tty1    binfmt          cronie         getty              misc           mount-net          NetworkManager-log  remount-root  syncthing-srv   udevadm
agetty-tty2    bluetoothd-log  dbus-log       hostname           modules        mount-procfs       NetworkManager-srv  seatd-log     sysctl          udevd-log
agetty-tty3    bluetoothd-srv  dbus-srv       hwclock            mount          mount-sysfs        pcscd-log           seatd-srv     sysusers        udevd-srv
agetty-tty4    boot            default        kmod-static-nodes  mount-cgroups  mount-tmpfs        pcscd-srv           setup         tmpfiles-dev    ufw
agetty-tty5    cleanup         dmesg-log      locale             mount-devfs    net-lo             random-seed         swap          tmpfiles-setup

The only service that is not provided by official repos is "pscd-srv", it's a package from AUR and I made the script but it does not contains anything special.  Basically it's a copy from many of the official services. This is the content if I can help:

Code: [Select]
cat pcscd-srv/run
#!/usr/bin/execlineb -P
fdmove -c 2 1
exec /usr/bin/pcscd -f -i

Code: [Select]
 cat pcscd-log/run
#!/usr/bin/execlineb -P
envfile /etc/s6/config/pcscd.conf
importas -sCiu DIRECTIVES DIRECTIVES
ifelse { test -w /var/log } {
foreground { install -d -o s6log -g s6log /var/log/pcscd }
s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /var/log/pcscd
}
foreground { install -d -o s6log -g s6log /run/log/pcscd }
s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /run/log/pcscd

Could you tell me what can I do to debug more properly this issue?

Best regards.
Artix Linux Colombia

Re: Exception ignored in: <io.TexIOWrapper name='<stdout>' mode='w'> in the tty logi

Reply #1
Hmm this is a tougher one. The "io.TexIOWrapper" is a python message. If you could figure out which of your services use python, it should be one of those that's causing that message.

Re: Exception ignored in: <io.TexIOWrapper name='<stdout>' mode='w'> in the tty logi

Reply #2
Hello thank you for clarify me. I could find the problematic service. It's "ufw".

It's the only one I have which use python and I also tested it running the execlineb script manually.

Code: [Select]
cat up
#!/bin/execlineb -P
envfile /etc/s6/config/ufw.conf
importas -uD "n3 s2000000 T" DIRECTIVES DIRECTIVES
foreground { if -nt { test -d /var/log/ufw } install -dm755 -o s6log -g s6log /var/log/ufw }
pipeline { ufw enable } s6-setuidgid s6log exec -c s6-log -b -- ${DIRECTIVES} /var/log/ufw

Code: [Select]
# execlineb -P up
s6-log: fatal: unrecognized directive: n3 s2000000 T
# Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

I am not sure if is a problem from UFW or a script problem.

Best regards.
Artix Linux Colombia

Re: Exception ignored in: <io.TexIOWrapper name='<stdout>' mode='w'> in the tty logi

Reply #3
Oops, that is definitely a script issue. That should be importas -sCuD. I have fixed it and pushed a new version into the repos. Once you get it, it should work normally again. Thanks for reporting!

Re: Exception ignored in: <io.TexIOWrapper name='<stdout>' mode='w'> in the tty logi

Reply #4
Come to think of it, most Artix logger scripts could be rewritten as calls to a /usr/share/rc/s6-logger wrapper since they're so formulaic.

Re: Exception ignored in: <io.TexIOWrapper name='<stdout>' mode='w'> in the tty logi

Reply #5
Yeah definitely. That's a project to do. ufw is one of the few more unique ones.