lightninglabs/pool

Logs missing crucial information

C-Otto opened this issue · 4 comments

C-Otto commented

I'm using pool 0.6.4-beta. When I start poold via systemd, it fails after a second or so. The logs don't indicate anything useful:

2023-06-17 10:35:17.439 [INF] RPCS: Starting trader server
2023-06-17 10:35:17.522 [INF] RPCS: Connected to lnd node c-otto.de with pubkey 027ce055380348d7812d2ae7745701c9f93e70c1adeb2657f053f91df4f2843c71
2023-06-17 10:35:17.980 [INF] AUCT: Shutting down auctioneer client

However, when I start poold manually, I get this:

unable to start server: unable to start account manager: unable to resume account xxx: rpc error: code = Unknown desc = transaction rejected: output already spent

Please consider showing important information like this in the logs.

@C-Otto thanks for the report. Do you know if systemd captures stderr? Because if there is an error before poold has set up the logging system (e.g. configuration file cannot be parsed), then we now log to stderr (see #459) instead of stdout.

C-Otto commented

I'm pretty sure systemctl is able to capture stderr, but in this case (copied over from my lnd setup) I disabled capturing output as I already have the log file. If errors like this aren't supposed to end up in the log file, I might have to tweak my setup. Otherwise, I'd like this message to appear in the log file (additionally to stderr).

I added the startup errors to the logs, that was actually missing. But if an error happens before we set up the logger (during config parsing/validating), then that can still not go into any log file. But it goes to stderr now instead of stdout, so maybe it's easier to detect?

C-Otto commented

Sounds good to me! It's not too hard to check stdout/stderr, especially if the logs are empty.