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
toml plugin in 0.9.6 eats the first character of each key #3896
Comments
Thank you so much for reporting! I can reproduce the bug. The problem seems to be specific to the mountpoint kdb mount default.toml / toml
kdb set user:/test/abcdef 1
#> Create a new key user:/test/abcdef with string "1"
cat `kdb file user:/test`
est.abcdef = 1
kdb get user:/test
#> Did not find key 'user:/test'
kdb get user:/est/abcdef
#> 1
kdb rm user:/est/abcdef
kdb umount / but with another mountpoint the problem does not occur: kdb mount test.toml /test/toml toml
kdb set user:/test/toml/test/abcdef 1
#> Create a new key user:/test/toml/test/abcdef with string "1"
cat `kdb file user:/test/toml/test/abcdef`
#> test.abcdef = 1
kdb rm user:/test/toml/test/abcdef kdb umount /test/tom My guess is that it is either a problem introduced in #3555 (keyname overhaul by @kodebach) or this case was simply never tested as toml is not yet being tested as default backend (#2330 @bauhaus93). Can you both take a look please? |
Thanks for your confirmation and details. I'm happy to use any other storage plugin as default for openwrt, but ini has already been removed and toml was recommended. The criteria for a default backend are:
|
This certainly could be an error caused by #3555. Other plugins (e.g. @markus2330 are you sure it is just caused by
You could try |
When writing the initial package for OpenWRT we decided against dump as default storage on purpose: Aside from the human-friendlyness it actually has a dependency besides libc - libstdcpp. |
Ah yes, I forgot about that. The C++ dependency is of course not ideal for embedded systems. |
I'm now 99% certain this issue is caused only by root-level keys. We should probably add a version of Maybe we should change the (un)escaping again so that |
#3478 would give certainty.
Yes, I agree. Very possible that other storage plugins face the same issue. Can you create an issue or PR for this?
Yes, very good idea. I also don't like the special handling of / keys. Can you create an issue or PR for this? |
I'm closing this, since the original issue is fixed. I created #3910 for any future issues that prevent TOML from being used as the default storage plugin. |
In updating the openwrt package to 0.9.6 I noticed that the ini-plugin has been removed and toml is recommended instead. However it seems each time the toml plugin writes to the file it eats the first character of each key:
Steps to Reproduce the Problem
If your key database (KDB) might influence the outcome, please use
kdb stash
to temporarily have an empty KDB. (Restore instructions are printed.)
Expected Result
The keys should remain stable across any calls to
kdb set
Actual Result
Every time I use
kdb set
all keys got shorter by one character.System Information
The text was updated successfully, but these errors were encountered: