You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my system, the user that runs lightningd does not have permission to write to the directory containing the config file. I tried to use setconfig to change a dynamic config setting, and CLN straight-up crashed. Not nice at all since it'll now take ~15 minutes for my node to start again! (That's another issue that needs fixing.)
For what it's worth, to a sysadmin it is very unexpected and unwelcome for a daemon to modify its own config files merely as a consequence of modifying a runtime parameter at runtime. I'm sure you thought you were being helpful by having setconfig rewrite the config file, but automatic persistence of config changes is actually contrary to the typical admin workflow of: apply config change, test outcome, commit to persistent storage if acceptable. I intentionally made my config file unwritable by my lightning user explicity to sidestep this undesired behavior, so imagine my shock when my whole node crashed just because setconfig couldn't provide a "convenience" to me.
getinfo output
This is with CLN 24.08.2. Apologies if this has already been fixed in 24.11.
The text was updated successfully, but these errors were encountered:
This is actually what most people want, though. They don't want their changes to vanish mysteriously on restart. Nor do we want config options silently overridden elsewhere because it was set using setconfig some time in the past.
Nor do we want partial failure, where we don't fully set it. Yet we have an atomicity issue, which is why we crash here.
I think the answers are:
Test for writability before activation.
setconfig option to non-persistently change config.
Prefer to add dynamic changes to a file ending in ".dynamic" to encourage grouping. Create and include this ton new install by default.
Add an option to change persistence to off by default.
There's nothing mysterious. The config file specifies how the runtime variables are to be initialized at startup. Changing those runtime variables at runtime is orthogonal to changing the config file that provides their initial values. I think what you're trying to argue is that the variables conceptually outlast any one particular session, more like the "preferences" of a graphical desktop application that are persisted at the same time as they are applied. That's possibly an okay argument, but then you shouldn't allow those preferences to be configured outside of the running application. How do you change the default paper size for Microsoft Word documents outside of a running instance of Microsoft Word? You aren't meant to. There is no user-accessible config file for Word; you use the preferences dialog box inside the application to configure it. So, what you're doing with Core Lightning is mixing metaphors: you're saying, here's this user-editable file where the user is meant to specify how they want the application to behave, but then, by the way, the application is also going to manage that same file. Now you have two head chefs in the same kitchen, and they will forever be stepping on each other's toes.
I don't see anything wrong with simply not writing the config change to disk if the file can't be written due to permissions but otherwise carrying on normally, perhaps logging a warning that the config file couldn't be written. That was certainly my expectation of what would happen.
Issue and Steps to Reproduce
On my system, the user that runs
lightningd
does not have permission to write to the directory containing the config file. I tried to usesetconfig
to change a dynamic config setting, and CLN straight-up crashed. Not nice at all since it'll now take ~15 minutes for my node to start again! (That's another issue that needs fixing.)From the log:
For what it's worth, to a sysadmin it is very unexpected and unwelcome for a daemon to modify its own config files merely as a consequence of modifying a runtime parameter at runtime. I'm sure you thought you were being helpful by having
setconfig
rewrite the config file, but automatic persistence of config changes is actually contrary to the typical admin workflow of: apply config change, test outcome, commit to persistent storage if acceptable. I intentionally made my config file unwritable by mylightning
user explicity to sidestep this undesired behavior, so imagine my shock when my whole node crashed just becausesetconfig
couldn't provide a "convenience" to me.getinfo
outputThis is with CLN 24.08.2. Apologies if this has already been fixed in 24.11.
The text was updated successfully, but these errors were encountered: