footclient: failed to read from configuration: Transport endpoint is not connected #1107

Closed
opened 5 months ago by VannTen · 5 comments

Hi,

Juste encountered an error message (no other problems), when using foot --server and foot client.

config: failed to read from configuration: Transport endpoint is not connected

The error message appear on every instance of footclient (would not have notice otherwise), before the first prompt of my shell. Here is the log output from the foot --server itself :

Jul 12 14:47:55 work-laptop-max systemd[669]: Started Foot terminal server mode for WAYLAND_DISPLAY=wayland-1.
Jul 12 14:47:55 work-laptop-max foot[4459]: main: version: 1.12.1 +pgo +ime +graphemes -assertions
Jul 12 14:47:55 work-laptop-max foot[4459]: main: arch: Linux x86_64/64-bit
Jul 12 14:47:55 work-laptop-max foot[4459]: main: locale: en_US.UTF-8
Jul 12 14:47:55 work-laptop-max foot[4459]: config: loading configuration from /home/max/.config/foot/foot.ini
Jul 12 14:47:55 work-laptop-max foot[4459]: config: imported sub-configuration from /usr/share/foot/themes/solarized-dark
Jul 12 14:47:55 work-laptop-max foot[4459]: config: failed to read from configuration: Transport endpoint is not connected
Jul 12 14:47:55 work-laptop-max foot[4459]: fcft: fcft: 3.1.2 +graphemes +runs +svg(nanosvg) -assertions
Jul 12 14:47:55 work-laptop-max foot[4459]: fcft: fontconfig: 2.14.0, freetype: 2.12.1, harfbuzz: 4.4.1, utf8proc: 2.7.0 (Unicode 14.0.0)
Jul 12 14:47:55 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-Regular.ttf: size=8.00pt/8px, dpi=75.00
Jul 12 14:47:55 work-laptop-max foot[4459]: wayland: eDP-1: 1920x1200+1920x0@60Hz 0x1404 13.98" scale=1 PPI=174x171 (physical) PPI=174x171 (logical), DPI=161.95
Jul 12 14:47:55 work-laptop-max foot[4459]: wayland: DP-7: 1920x1080+0x0@60Hz DELL U2414H 23.98" scale=1 PPI=96x98 (physical) PPI=96x98 (logical), DPI=91.88
Jul 12 14:47:55 work-laptop-max foot[4459]: server: accepting connections on socket provided through socket activation
Jul 12 14:47:55 work-laptop-max foot[4459]: main: running as server; launch terminals by running footclient
Jul 12 14:48:01 work-laptop-max foot[4459]: wayland: requesting SSD decorations
Jul 12 14:48:01 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf: size=12.00pt/16px, dpi=96.00
Jul 12 14:48:01 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-Bold.ttf: size=12.00pt/16px, dpi=96.00
Jul 12 14:48:01 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-Italic.ttf: size=12.00pt/16px, dpi=96.00
Jul 12 14:48:01 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-Regular.ttf: size=12.00pt/16px, dpi=96.00
Jul 12 14:48:01 work-laptop-max foot[4459]: terminal: cell width=10, height=19
Jul 12 14:48:01 work-laptop-max foot[4459]: terminal: using 8 rendering threads
Jul 12 14:48:01 work-laptop-max foot[4459]: wayland: using SSD decorations
Jul 12 14:48:29 work-laptop-max foot[4459]: wayland: cursor theme: (null), size: 24, scale: 1

foot version: foot version: 1.12.1 +pgo +ime +graphemes -assertions
Distribution: Archlinux
Kernel: 5.18.10-arch1-1

No message at all when running foot not in server mode.

Hi, Juste encountered an error message (no other problems), when using `foot --server` and foot client. `config: failed to read from configuration: Transport endpoint is not connected` The error message appear on every instance of footclient (would not have notice otherwise), before the first prompt of my shell. Here is the log output from the `foot --server` itself : ``` Jul 12 14:47:55 work-laptop-max systemd[669]: Started Foot terminal server mode for WAYLAND_DISPLAY=wayland-1. Jul 12 14:47:55 work-laptop-max foot[4459]: main: version: 1.12.1 +pgo +ime +graphemes -assertions Jul 12 14:47:55 work-laptop-max foot[4459]: main: arch: Linux x86_64/64-bit Jul 12 14:47:55 work-laptop-max foot[4459]: main: locale: en_US.UTF-8 Jul 12 14:47:55 work-laptop-max foot[4459]: config: loading configuration from /home/max/.config/foot/foot.ini Jul 12 14:47:55 work-laptop-max foot[4459]: config: imported sub-configuration from /usr/share/foot/themes/solarized-dark Jul 12 14:47:55 work-laptop-max foot[4459]: config: failed to read from configuration: Transport endpoint is not connected Jul 12 14:47:55 work-laptop-max foot[4459]: fcft: fcft: 3.1.2 +graphemes +runs +svg(nanosvg) -assertions Jul 12 14:47:55 work-laptop-max foot[4459]: fcft: fontconfig: 2.14.0, freetype: 2.12.1, harfbuzz: 4.4.1, utf8proc: 2.7.0 (Unicode 14.0.0) Jul 12 14:47:55 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-Regular.ttf: size=8.00pt/8px, dpi=75.00 Jul 12 14:47:55 work-laptop-max foot[4459]: wayland: eDP-1: 1920x1200+1920x0@60Hz 0x1404 13.98" scale=1 PPI=174x171 (physical) PPI=174x171 (logical), DPI=161.95 Jul 12 14:47:55 work-laptop-max foot[4459]: wayland: DP-7: 1920x1080+0x0@60Hz DELL U2414H 23.98" scale=1 PPI=96x98 (physical) PPI=96x98 (logical), DPI=91.88 Jul 12 14:47:55 work-laptop-max foot[4459]: server: accepting connections on socket provided through socket activation Jul 12 14:47:55 work-laptop-max foot[4459]: main: running as server; launch terminals by running footclient Jul 12 14:48:01 work-laptop-max foot[4459]: wayland: requesting SSD decorations Jul 12 14:48:01 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf: size=12.00pt/16px, dpi=96.00 Jul 12 14:48:01 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-Bold.ttf: size=12.00pt/16px, dpi=96.00 Jul 12 14:48:01 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-Italic.ttf: size=12.00pt/16px, dpi=96.00 Jul 12 14:48:01 work-laptop-max foot[4459]: fcft: /usr/share/fonts/liberation/LiberationMono-Regular.ttf: size=12.00pt/16px, dpi=96.00 Jul 12 14:48:01 work-laptop-max foot[4459]: terminal: cell width=10, height=19 Jul 12 14:48:01 work-laptop-max foot[4459]: terminal: using 8 rendering threads Jul 12 14:48:01 work-laptop-max foot[4459]: wayland: using SSD decorations Jul 12 14:48:29 work-laptop-max foot[4459]: wayland: cursor theme: (null), size: 24, scale: 1 ``` foot version: foot version: 1.12.1 +pgo +ime +graphemes -assertions Distribution: Archlinux Kernel: 5.18.10-arch1-1 No message at all when running foot not in server mode.
Owner

It's probably a bogus error. Before we read the configuration, we set errno = 0. And afterwards, we check if errno is set, and if so print that error message.

Either errno is set by something else, and we're breaking out of the config read loop in a way that I didn't anticipate, or your system actually sets this particular errno when getline() reaches EOF.

It's probably a bogus error. Before we read the configuration, we set `errno = 0`. And afterwards, we check if `errno` is set, and if so print that error message. Either `errno` is set by something else, and we're breaking out of the config read loop in a way that I didn't anticipate, or your system actually sets this particular `errno` when `getline()` reaches EOF.
Owner

No message at all when running foot not in server mode.

This is weird, because there shouldn't be any difference between server and non-server mode. May be related to socket activation, perhaps.

> No message at all when running foot not in server mode. This is weird, because there shouldn't be any difference between server and non-server mode. _May_ be related to socket activation, perhaps.
Owner

Can you try this patch?

diff --git a/config.c b/config.c
index ce0e27b8..d2edd219 100644
--- a/config.c
+++ b/config.c
@@ -2609,6 +2609,9 @@ parse_config_file(FILE *f, struct config *conf, const char *path, bool errors_ar
 
         if (!section_parser(ctx))
             error_or_continue();
+
+        /* For next iteration of getline() */
+        errno = 0;
     }
 
     if (errno != 0) {
Can you try this patch? ```diff diff --git a/config.c b/config.c index ce0e27b8..d2edd219 100644 --- a/config.c +++ b/config.c @@ -2609,6 +2609,9 @@ parse_config_file(FILE *f, struct config *conf, const char *path, bool errors_ar if (!section_parser(ctx)) error_or_continue(); + + /* For next iteration of getline() */ + errno = 0; } if (errno != 0) { ```
dnkl added the
bug
label 4 months ago
Poster

Sorry for the time I took to answer, lots of stuff.

So your patch work.

I also took some time to investigate.

TL;DR: the error message comes from the logging, and the root cause is that
systemd duplicate the socket fd to stdout and stderr. When foot tries to log it
hits an error somewhere in _log, so that sets errno and triggers the error message.

So the systemd service file is wrong (sorry).

Unfortunately this was/still is not correctly documented
(https://github.com/systemd/systemd/issues/2114), but apparently it match the
behavior of inetd (but I never used inetd, that's my excuse !).

I'll open a PR using --server=3 instead of playing with StandardInput since we
only pass one. And I did'nt read the documentation carefully enough but the fds will always start at 3, and we don't care about the order since there is only one.

Sorry for the time I took to answer, lots of stuff. So your patch work. I also took some time to investigate. TL;DR: the error message comes from the logging, and the root cause is that systemd duplicate the socket fd to stdout and stderr. When foot tries to log it hits an error somewhere in `_log`, so that sets errno and triggers the error message. So the systemd service file is wrong (sorry). Unfortunately this was/still is not correctly documented (https://github.com/systemd/systemd/issues/2114), but apparently it match the behavior of inetd (but I never used inetd, that's my excuse !). I'll open a PR using --server=3 instead of playing with StandardInput since we only pass one. And I did'nt read the documentation carefully enough but the fds will always start at 3, and we don't care about the order since there is only one.
Owner

Thanks, I appreciate you taking the time to get to the bottom of this!

Thanks, I appreciate you taking the time to get to the bottom of this!
dnkl closed this issue 4 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: dnkl/foot#1107
Loading…
There is no content yet.