libelektra: Augeas error messages do not mention used lens and are vague

Actual Outcome:

# kdb mount /etc/security/limits.conf system/limits augeas lens=Limits.lns
# cat /etc/security/limits.conf 
*               soft    core            1000000  #1GB
# kdb ls system/limits
The command ls terminated unsuccessfully with the info: 
Error (#85) occurred!
Description: an Augeas error occurred
Ingroup: plugin
Module: storage
At: /home/jenkins/workspace/workspace/elektra-git-buildpackage-wheezy/libelektra/src/plugins/augeas/augeas.c:397
Reason: Iterated lens matched less than it should
Mountpoint: system/limits
Configfile: /etc/security/limits.conf

Expected outcome: 1.) Please add path to lens for augeas related errors (ideally with full path, if available):

Reason: Iterated lens /path/to/Limits.lns matched less than it should

2.) Maybe its possible to overall improve the error messages, its not really clear to me what “Iterated lens matched less than it should” means. What exactly is iterated, which expression should match what? Or is the error message from augeas so weak?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

you seem to have provided a correct lens,…

Yep. I just repeated the steps from the issue description.

… try sudo kdb mount /etc/security/limits.conf system/tests augeas lens=NonExistingLens

I tried the commands

kdb mount /etc/security/limits.conf system/tests augeas lens=NonExistingLens
kdb ls system/limits

, which do not print any error message on my system as described here. Anyway, I am fine with the current situation. I just commented on this issue, since you requested my review in PR #3286.

I tried to reproduce the problem using the steps of the issue description. On my machine the command:

kdb ls system/limits

prints the following error message:

Sorry, module augeas issued the error C01200:
Installation: parse_failed
	position: 1:8
	message: Iterated lens matched less than it should
	lens: /usr/local/Cellar/augeas/1.12.0/share/augeas/lenses/dist/limits.aug:66.17-.40:

. As you can see the error message does includes the location of the lens now 👍. There are two minor details we still could improve in my opinion.

  1. The error message contains an empty line at the end.
  2. The location data :66.17-.40: is a little bit confusing. Why is there a colon at the end? Usually I would expect either nothing or a dot at the end of the message.

Compared to the version of April, 2015 the message itself was already improved. This section did not provide all the information and now does provide the necessary information.

It should state: Insufficient permissions to open configuration file for reading. (It tried to open with “r”)

Also the permission error has been improved.

This ticket can be closed