libelektra: examples/highlevel/README.md not working

Steps to Reproduce the Problem

Run commands as described in examples/highlevel/README.md

kdb stash
cd examples/highlevel
sudo kdb mount spec.ini 'spec/sw/example/highlevel/#0/current' ni
sudo kdb import spec/sw/example/highlevel/#0/current ni < spec.ini
sudo kdb spec-mount '/sw/example/highlevel/#0/current'
pkgconfig/application

Expected Result

Successful execution of application.

Actual Result

ERROR: The key '/sw/example/highlevel/#0/current/mystring' has the wrong type (expected 'string' but got '(null)').

System Information

  • Elektra Version: master

Further Log Files and Output

kdb getmeta /sw/example/highlevel/#0/current/mystring type
#> Metakey not found
kdb getmeta spec/sw/example/highlevel/#0/current/mystring type
#> string
kdb global-mount 
#>
kdb export /sw/example/highlevel/#0/current ni
;Ni1
; Generated by Nickel Plugin using Elektra (see libelektra.org).

myint = 
myfloatarray/# = 
print = 1
mystring = 
mydouble = 
 = 

[myint]
 default = 0
 type = long

[myfloatarray/#]
 default = 0.0
 type = float

[print]
 default = 0
 type = boolean

[mystring]
 default = 
 type = string

[mydouble]
 default = 0.0
 type = double

[]
 mountpoint = highlevelexamples.conf
kdb mount
#> highlevelexamples.conf on /sw/example/highlevel/#0/current with name /sw/example/highlevel/#0/current
#> spec.ini on spec/sw/example/highlevel/#0/current with name spec/sw/example/highlevel/#0/current

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

I created some issues… I will fix the ERROR messages together with #2381

Is it also shown if logging is turned off?

The example uses a custom fatal error handler and prints the error description to stderr:

static void onFatalError (ElektraError * error)
{
	fprintf (stderr, "ERROR: %s\n", elektraErrorDescription (error));
	exit (EXIT_FAILURE);
}

in “ERROR: The value ‘abc’ could not be converted to type ‘long’.” it is not known which key is the problem

That’s true we should fix that…

Which plugins did you have in mind?

Done properly we should check if the keys present in spec/ is a superset of the defaults keyset passed in elektraOpen. And based on this information, we would know which plugins should be present. Unfortunately, the spec-mount logic is in C++ and we should not pull this dependency in (or only optional). We also have the same problem (deps to C++) with 3-way merge.

elektraGet*

Yes, there should be no check in elektraGet* as every specified elektraGet* is supposed to always succeed.