https://issues.rudder.io/https://issues.rudder.io/themes/rudder7/favicon/favicon.ico?17096450182017-03-02T16:06:40ZIssue TrackerRudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=720742017-03-02T16:06:40ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>4.1.0~rc1</i> to <i>4.1.0</i></li></ul> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=726792017-03-06T14:05:15ZBenoît PECCATTEbenoit.peccatte@rudder.io
<ul></ul><p>The destination must be the absolute file path, not the destination directory.<br />If you say /tmp, /tmp is considered to be the destination "file".</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=727372017-03-07T00:55:45ZHamlyn Mootoo
<ul></ul><p>While I understand this now, it is very easy to misinterpret, and getting /tmp renamed was not fun. As a suggestion I would change the wording of the this field to something like "Full path of destination file". This would be somewhat symmetrical with the "Path of file to be copied" field. I understand there is some help text when the mouse hovers over the question mark, but if other sys admins are anything like me, when we read "destination" for a file, we think "directory location" not full path, and would not think help is needed. The reason for this is that when copying a file from one place to another, unless you're renaming the file, not many admins would put in the full path for the destination. For example:</p>
<p>cp /etc/hosts /tmp <br />NOT cp /etc/hosts /tmp/hosts</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=727382017-03-07T00:59:36ZHamlyn Mootoo
<ul></ul><p>Also, when a trailing slash was put in (clearly indicating the intent to put the file into a directory), it behaved the same way, namely overwriting (but luckily renaming first) the directory.</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=727492017-03-07T11:11:21ZJonathan CLARKEjonathan.clarke@normation.com
<ul><li><strong>Tracker</strong> changed from <i>User story</i> to <i>Bug</i></li><li><strong>Target version</strong> changed from <i>4.1.0</i> to <i>3.1.19</i></li><li><strong>Reproduced</strong> set to <i>No</i></li></ul><p>I agree with you 100%, Hamlyn. This is misleading, and you're not the first person to misunderstand this, far from it. Worse than misleading, this could cause data loss (if it wasn't /tmp but /etc, and the .cfsaved backup ended up getting removed... the consequences could be disastrous).</p>
<p>This needs to be reworked. I'm requalifying this as a bug - it needs fixing, at least by clearer wording, and better still by figuring out we probably don't ever want to replace a directory with a single file (for example).</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=727502017-03-07T11:11:32ZJonathan CLARKEjonathan.clarke@normation.com
<ul><li><strong>Category</strong> changed from <i>Agent</i> to <i>Techniques</i></li></ul> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=727592017-03-07T11:31:10ZFrançois ARMANDfrancois.armand@rudder.io
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-16 priority-default closed" href="/issues/10214">User story #10214</a>: More consistant naming of techniques</i> added</li></ul> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729082017-03-08T11:05:31ZJonathan CLARKEjonathan.clarke@normation.com
<ul><li><strong>Severity</strong> set to <i>Critical - prevents main use of Rudder | no workaround | data loss | security</i></li></ul> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729212017-03-08T13:06:57ZAlexis Moussetalexis.mousset@rudder.io
<ul><li><strong>Category</strong> changed from <i>Techniques</i> to <i>Agent</i></li><li><strong>Assignee</strong> set to <i>Alexis Mousset</i></li></ul><p>Besides the documentation issue, it seems to be a bug in CFEngine. We do not use move_obstructions in this technique, so we should not replace a link or a directory by a file. Furthermore, the behavior seems different according to the file comparison method.</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729222017-03-08T13:08:24ZAlexis Moussetalexis.mousset@rudder.io
<ul></ul><p>May be linked to <a class="external" href="https://tracker.mender.io/browse/CFE-1811">https://tracker.mender.io/browse/CFE-1811</a>.</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729232017-03-08T13:14:22ZAlexis Moussetalexis.mousset@rudder.io
<ul></ul><p>When the <code>dir</code> directory exists on the destination:</p>
<table>
<tr>
<th>Source</th>
<th>Destination</th>
<th>Comparison</th>
<th>Purge</th>
<th>Recursion</th>
<th>Outcome</th>
</tr>
<tr>
<td>file</td>
<td>dir</td>
<td>digest</td>
<td>*</td>
<td>*</td>
<td>Does nothing, returns success or replaces the directory, depending on ctime!</td>
</tr>
<tr>
<td>file</td>
<td>dir/</td>
<td>digest</td>
<td>*</td>
<td>*</td>
<td>Does nothing, returns success or fails and does not replace the directory, depending on ctime!</td>
</tr>
<tr>
<td>file</td>
<td>dir</td>
<td>mtime</td>
<td>*</td>
<td>*</td>
<td>Replaces the directory</td>
</tr>
<tr>
<td>file</td>
<td>dir/</td>
<td>mtime</td>
<td>*</td>
<td>*</td>
<td>Creates dir.cfnew but fails and does no replace the directory</td>
</tr>
</table>
<p>The issue with checksum is:</p>
<pre>
verbose: Checksum comparison replaced by ctime: files not regular
</pre>
<p>With mtime:</p>
<pre>
verbose: File '/tmp/dir' copy_from '/tmp/file'
verbose: Destination file '/tmp/dir' already exists
verbose: Image file '/tmp/dir' out of date, should be copy of '/tmp/file'
verbose: Copy of regular file succeeded '/tmp/file' to '/tmp/dir.cfnew'
verbose: No depth search when copying '/tmp/dir.cfsaved' so purging does not apply
info: Cannot move a directory to repository, leaving at '/tmp/dir.cfsaved'
info: Updated '/tmp/dir' from source '/tmp/file' on 'localhost'
</pre> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729242017-03-08T13:44:10ZAlexis Moussetalexis.mousset@rudder.io
<ul></ul><p>From move_obstruction doc:</p>
<pre>
If we have promised to make file X a link, but it already exists as a file, or vice-versa, or if a file is blocking the creation of a directory, then normally CFEngine will report an error.
</pre> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729312017-03-08T16:23:01ZAlexis Moussetalexis.mousset@rudder.io
<ul></ul><p>We can:</p>
<ul>
<li>If (the destination exists and is a directory) and (the destination does not end with a "/") => Add a "/" at the end of destination.</li>
</ul>
<p>This allows to fail is the source is a file, and avoid removing the destination.</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729322017-03-08T16:24:48ZAlexis Moussetalexis.mousset@rudder.io
<ul><li><strong>Category</strong> changed from <i>Agent</i> to <i>Techniques</i></li></ul> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729332017-03-08T16:50:19ZAlexis Moussetalexis.mousset@rudder.io
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In progress</i></li></ul> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729342017-03-08T17:01:45ZAlexis Moussetalexis.mousset@rudder.io
<ul><li><strong>Status</strong> changed from <i>In progress</i> to <i>Pending technical review</i></li><li><strong>Assignee</strong> changed from <i>Alexis Mousset</i> to <i>Nicolas CHARLES</i></li><li><strong>Pull Request</strong> set to <i>https://github.com/Normation/rudder-techniques/pull/1124</i></li></ul><p>PR <a class="external" href="https://github.com/Normation/rudder-techniques/pull/1124">https://github.com/Normation/rudder-techniques/pull/1124</a></p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729362017-03-08T17:07:05ZAlexis Moussetalexis.mousset@rudder.io
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-1 priority-16 priority-default" href="/issues/10377">Bug #10377</a>: When copying files, digest comparison uses ctime when types are different.</i> added</li></ul> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=729562017-03-09T09:46:11ZAlexis Moussetalexis.mousset@rudder.io
<ul></ul><p>The only case where a directory got replaced by a file in my tests were when the destination did not end with a "/".</p>
<p>The proposed fix is, when the target is an existing directory on the managed node, to enforce that the destination in the directive ends by a "/". This way, the directory will not be replaced, and an error will be reported.</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=732672017-03-16T09:50:26ZAlexis Moussetalexis.mousset@rudder.io
<ul><li><strong>Status</strong> changed from <i>Pending technical review</i> to <i>Pending release</i></li></ul><p>Applied in changeset <a class="changeset" title="Fixes #10312: \"Download files from the shared folder\" behaving badly?" href="https://issues.rudder.io/projects/rudder/repository/rudder-techniques/revisions/4fb58eb68699892f9821c0c1ef37980d0212286d">rudder-techniques|4fb58eb68699892f9821c0c1ef37980d0212286d</a>.</p> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=743322017-03-30T10:10:34ZFrançois ARMANDfrancois.armand@rudder.io
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-6 priority-16 priority-default closed" href="/issues/4334">Bug #4334</a>: Technique "Download From A Shared Folder": copy files to directory destination doesn't work</i> added</li></ul> Rudder - Bug #10312: "Download files from the shared folder" behaving badly?https://issues.rudder.io/issues/10312?journal_id=753612017-04-19T10:12:39ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Status</strong> changed from <i>Pending release</i> to <i>Released</i></li><li><strong>Priority</strong> set to <i>0</i></li></ul><p>This bug has been fixed in Rudder 3.1.19, 4.0.4 and 4.1.1 which were released today.</p>
<ul>
<li>3.1.19: <a href="http://www.rudder-project.org/pipermail/rudder-announce/2017-April/thread.html000227.html" class="external">Announce</a> <a href="http://www.rudder-project.org/changelog-3.1#3.1.19" class="external">Changelog</a></li>
<li>4.0.4: <a href="http://www.rudder-project.org/pipermail/rudder-announce/2017-April/thread.html000226.html" class="external">Announce</a> <a href="http://www.rudder-project.org/changelog-4.0#4.0.4" class="external">Changelog</a></li>
<li>4.1.1: <a href="http://www.rudder-project.org/pipermail/rudder-announce/2017-April/thread.html000228.html" class="external">Announce</a> <a href="http://www.rudder-project.org/changelog-4.1#4.1.1" class="external">Changelog</a></li>
<li>Download: <a class="external" href="https://www.rudder-project.org/site/get-rudder/downloads/">https://www.rudder-project.org/site/get-rudder/downloads/</a></li>
</ul>