Skip to content
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

errors in kdbGet #1511

Closed
markus2330 opened this issue Jun 17, 2017 · 5 comments
Closed

errors in kdbGet #1511

markus2330 opened this issue Jun 17, 2017 · 5 comments
Projects
Milestone

Comments

@markus2330
Copy link
Contributor

markus2330 commented Jun 17, 2017

(this proposal is a draft)

Currently, kdbGet passes through wrong configuration settings in order to give the application any chance to correct the config. This also means that applications start up with wrong conf, which is an unwanted situation. Possible solutions:

  1. Remove offending keys (and add warning)
  2. Hide offending keys (and add warning)
  3. Make higher-level API responsible to quit application on such problematic warnings

see also #1291

@markus2330 markus2330 self-assigned this Jun 17, 2017
@markus2330 markus2330 removed their assignment Nov 17, 2018
@markus2330 markus2330 added this to the 0.9.* milestone Oct 29, 2019
@markus2330 markus2330 added this to To Do in 1.0 Nov 13, 2019
@markus2330 markus2330 moved this from Unclear to Trash in 1.0 Nov 24, 2019
@stale
Copy link

stale bot commented Oct 28, 2020

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot added the stale label Oct 28, 2020
@stale
Copy link

stale bot commented Nov 11, 2020

I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot closed this as completed Nov 11, 2020
@markus2330
Copy link
Contributor Author

markus2330 commented Dec 7, 2020

keyAddName (k, elektraNi_GetName (current, NULL));

@kodebach wrote in #3529: In this case [failing] is the correct option. If the file contains invalid key names, you either edited the file manually (in which case you can do that again to fix the problem) or the plugin is completely broken and actually produced the invalid key name (in which case there is no chance of fixing the key name anyway).

It could be also a corruption of some other kind, e.g. some script did a wrong change or even a hard disc failure. I wouldn't go for more than a warning, as not starting the application for a maybe irrelevant option can be a very severe problem.

Applications can always decide to exit on warnings (and normal applications probably should do that) but in some situations there might be no way to let applications start with a present error, e.g. if the error is already within kdbOpen, applications would not not even get the KDB handle.

@kodebach
Copy link
Member

kodebach commented Dec 8, 2020

But the question is, what would the ni plugin return, if it encouters an invalid key name? In any case, at least this one key will be lost.

To me a warning is something that "should ideally be fixed", but "can also be safely ignored". So IMO ignoring a warning should never lead to data loss.

That is actually, why we need a mode were errors are ignored. Then we can properly return errors, when something really bad happend.

@markus2330
Copy link
Contributor Author

Yes, this would basically mean we need critical and non-critical errors.

Or: we treat such things as corruption of the database and build some other tools (post 1.0) to fix such corruptions. Something like fsck? These tools obviously would not be able to use the API but they could use the plugin if the plugin would continue processing the configuration file even in the case of errors.

Or: we make it internally as warning, and the spec plugin turns it to an error if the warning is related to a specified key. If the name is invalid, it is not such a case anyway. This could be very problematic if the erroneous key is actually a typo from a name of a specified key. And this approach is probably also a too big burden for the spec plugin.

Anyway: We definitely need a consistent error concept. See also #2726.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.0
  
Trash
Development

No branches or pull requests

2 participants