ElektraInitiative / libelektra

Elektra serves as a universal and secure framework to access configuration settings in a global, hierarchical key database.
https://www.libelektra.org
BSD 3-Clause "New" or "Revised" License
208 stars 123 forks source link

Convert with plugin augeas lens Hosts.lns to dump #1192

Closed markus2330 closed 7 years ago

markus2330 commented 7 years ago

I tried to convert a snippet on the website, but got the error: CONVERT_UNABLE_TO_PARSE_SNIPPET ## Used plugins Input: - Plugin: augeas lens Hosts.lns - Format: none Output: - Plugin: dump - Format: dump ## Input configuration 192.168.1.5 markusbyte ## Last output configuration ## Additional information

markus2330 commented 7 years ago

Seems like the "report github issue" has a regression with #1187

And it seems like a valid host file could not be parsed by augeas?

Namoshek commented 7 years ago

Yes, I wonder about it too. I traced it already quite a bit, but I don't seem to get an idea why augeas does fail on imports. This requires some more investigation.

Seems like the "report github issue" has a regression with #1187

Why? Because newlines were missing in your post? They are there if I use it... maybe browser dependent issue. What browser are you using?

But I should add the additional config to the output.

markus2330 commented 7 years ago

Why? Because newlines were missing in your post?

Exactly, the newlines and spaces were prettier before.

It would also be good to have the configuration files in fences.

What browser are you using?

Mozilla Firefox 45.5.1

But I should add the additional config to the output.

Yes please.

Namoshek commented 7 years ago

It would also be good to have the configuration files in fences.

This must be an issue on your side, because newlines and fences are there. Firefox 50.0.2 on windows produces the correct output and so does 45.4.0 on my debian VM.

Btw. can you try an import with augeas for your hosts snippet? Just to make sure it is an issue with the rest backend!

On my debian VM neither of these work:

$> kdb import -c lens=Properties.lns dir/test/augeas/import augeas << EOF
$> someprop=value
$> moreprop=another
$> EOF
$> kdb import -c lens=Hosts.lns dir/test/augeas/import augeas << EOF
$> 127.0.0.1 localhost
$> 192.168.0.1 gateway
$> EOF
markus2330 commented 7 years ago

This must be an issue on your side, because newlines and fences are there. Firefox 50.0.2 on windows produces the correct output and so does 45.4.0 on my debian VM.

NoScript thinks it is a XSS attack.

Btw. can you try an import with augeas for your hosts snippet? Just to make sure it is an issue with the rest backend!

Now there are connection issues. It would be nice if one could press convert again after connection issues. Currently you need to do pointless changes ;)

Namoshek commented 7 years ago

NoScript thinks it is a XSS attack.

Oh, ok. But there is no other way to do it, so we have to live with it.

It would be nice if one could press convert again after connection issues. Currently you need to do pointless changes

Well that is intentional because you shouldn't bomb the API with useless equal conversions. It sucks when trying to test, but I think it is useful in production.

markus2330 commented 7 years ago

Is the connection issues a crash of the backend? If so, import seems to not work, too.

Namoshek commented 7 years ago

Import uses the exact same function than conversion, so you can also stick to conversion... it is easier to test. And yes, connection issues means server crash (or internal 500, you can check that by monitoring the network requests in firefox). But at least the backend restarts properly, if it is really crashes.

Edit: It really crashes according to cppcms log 2016-12-13 18:38:50; cppcms, critical: Chaild killed by 11 (service.cpp:670). We should disable variants of augeas that have an issue with arbitrary input data (btw. we can only disable variants, not lenses).

markus2330 commented 7 years ago

But at least the backend restarts properly, if it is really crashes.

Yes, one barely notices. Unfortunately every connection gets killed on such events.

We should disable variants of augeas that have an issue with arbitrary input data

It might be fixed already in 8a3f665c3113d530230c39f37a8b96a1c7980a98, augeas sometimes delivers only parts of the error message and this was not handled properly

We should disable variants of augeas that have an issue with arbitrary input data

It even seems to have problem with proper input data? Maybe @fberlakovich has an idea.

(btw. we can only disable variants, not lenses).

There is also another issue: There are simply too many variants which makes the selection hard.

Namoshek commented 7 years ago

There is also another issue: There are simply too many variants which makes the selection hard.

We should should disable all except for a handy selection of good/useful lenses (i.e. disable lenses we have as native plugins).

It might be fixed already in 8a3f665, augeas sometimes delivers only parts of the error message and this was not handled properly

I'll rebase quickly!

markus2330 commented 7 years ago

We should should disable all except for a handy selection of good/useful lenses

Good idea!

(i.e. disable lenses we have as native plugins).

I think they are of particular interest to compare the difference. So we should better have them.

markus2330 commented 7 years ago

Thanks, works fine now!