Bug 1575975
| Summary: | [API] Template import from local directory is throwing directory not found error | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Jitendra Yejare <jyejare> |
| Component: | Templates Plugin | Assignee: | Ondřej Pražák <oprazak> |
| Status: | CLOSED ERRATA | QA Contact: | Jitendra Yejare <jyejare> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.4 | CC: | adprice, jyejare, mhulan, oprazak |
| Target Milestone: | 6.4.0 | Keywords: | Regression, Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | tfm-rubygem-foreman_templates-6.0.2-1.el7sat | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-10-16 19:29:23 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Jitendra Yejare
2018-05-08 13:11:58 UTC
Jitendra, please try using other directories than /tmp, I have a suspicion that it does not work because of private tmp. See https://www.theforeman.org/plugins/foreman_templates/5.0/index.html#7.3.1Yousettherepoto/tmpbutdon%E2%80%99tseeanythingnewaddedevenafterexportsaysSuccess for more details, I think that should be covered in product documentation (worth of checking though). If other directories work, I think this should not be blocker and perhaps even go to backlog or be closed as wontfix. Marek,
I check that by importing from /root/testTemplate/myTemplate directory, I faced same issue:
--------------------
{
"error": {"message":"Using file-based synchronization, but couldn't find /root/testTemplate/myTemplate"}
}
--------------------
But, interestingly when I tried keeping in /usr/share/jitu/ it just worked,
--------------------
{"message":{"templates":[{"name":"jyejares provisionTemplate fake","id":511,"changed":false,"imported":true,"additional_errors":null,"exception":null,"validation_errors":{},"file":"testProviTable.erb","type":"provisioning_template","diff":null}],"repo":"/usr/share/jitu","branch":""}}
-------------------
So, I think we need to confirm whether it should be /usr/share always or its a bug ?
The fact that you were able to export to /usr/share makes me think this is a permissions issue. You probably cannot export to /root/ because the system user that runs the application is not allowed to write there. It does not have to be /usr/share always, but the directory should be writeable imho. If it is really a permission issue, we should probably improve the message to let the user know what is going on... If that's the case, this shouldn't be a blocker, Jitendra, could you please confirm? Note that the export is running under smart-proxy user and SELinux might also be blocking write access. Created redmine issue http://projects.theforeman.org/issues/23958 from this bug Upstream bug assigned to oprazak Upstream bug assigned to oprazak Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23958 has been resolved. Verified !
@ satellite 6.4 snap 11
Steps:
1. Attempt to, Import in or export templates to non /usr/share directory.
Behavior:
The correct error message is diplayed informing user about permissions.
{
"error": {"message":"Using file-based synchronization, but couldn't access /root/rootDir/impDir to export templates. Please check the access permissions/SELinux and make sure it is writable for the web application user account, typically 'satellite'."}
}
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:2927 |