saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.14k stars 5.47k forks source link

augeas error with apache config files - unable to save to file #24274

Closed kartiksubbarao closed 1 year ago

kartiksubbarao commented 9 years ago

The following state fails with "Error: unable to save to file!":

/etc/apache2/sites-available/default-ssl.conf:
  augeas.change:
    - lens: httpd.lns
    - context: /files/etc/apache2/sites-available/default-ssl.conf/IfModule/VirtualHost
    - changes:
      - set directive[. = "SSLCertificateFile"]/arg /etc/ssl/certs/cert1.pem

If I take out - lens: httpd.lns, it works.

jfindlay commented 9 years ago

@kartiksubbarao, thanks for the report.

eseyman commented 8 years ago

Wanting to try out augeas' integration with salt, I run into this problem. After working my way up the stack, I realized that you will get this error if you try to make changes to a file that augeas can not parse.

Since there is no check prior to editing the file that augeas is able to parse it, the error message is one of not being able to save the changed file.

kartiksubbarao commented 8 years ago

As I mention above, if I take out - lens: httpd.lns, it works. The file is saved correctly. I also verified this via augtool directly:

augtool set '/files/etc/apache2/sites-available/default-ssl.conf/IfModule/VirtualHost/directive[. = "SSLCertificateFile"]/arg' /etc/ssl/certs/cert1.pem

This works as well.

Thinking about it some more, it's possible that the problem in this case may have something to do with only loading the httpd.lns lens (and not others that it may depend on?). But I have seen other salt augeas issues that don't necessarily fit into this exact pattern, so I'm not sure whether there may be multiple issues involved.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

kartiksubbarao commented 6 years ago

I cannot confirm any change to this issue. I haven't had a chance to test out the most recent version of salt, but I'd like to keep this issue open if possible until it can be confirmed that the issue has been fixed/resolved.

stale[bot] commented 6 years ago

Thank you for updating this issue. It is no longer marked as stale.

kartiksubbarao commented 6 years ago

The issue is still there in version 2017.7

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

kartiksubbarao commented 5 years ago

The issue is still there in version 2018.3

stale[bot] commented 5 years ago

Thank you for updating this issue. It is no longer marked as stale.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] commented 4 years ago

Thank you for updating this issue. It is no longer marked as stale.

Mapel88 commented 4 years ago

issue still exists. minion version 3000.3 & master 3001

twangboy commented 1 year ago

Closing this issue due to age and lack of activity. Please test this on version 3006.2 and create a new issue if the problem persists. The new issue template has more information and will allow us to track and reproduce the issue more effectively. Thanks!

kartiksubbarao commented 1 year ago

@twangboy Reopened as #65254, can you take a look?