saltstack / saltstack/salt

[BUG] cp.get_file function get inconsistent results

Open
#64,475 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Hi, I use the cp.get_file job to download files, and then when I query the job results, I get different results with status code retcode=0. This confuses me in judging success, please take a look, thank you.

salt version: 3002.6
Setup

cp.get_file:
salt://basefiles/node_exporter/node_exporter_x86_64
/opt/node_exporter/node_exporter
makedirs=True

correct result:

[{"jid":"20230504101109023667","result":{"7059772291476963337":{"retcode":0,"return":"/opt/node_exporter/node_exporter","success":true}}}]

wrong result:
In fact, the file was not downloaded successfully.

[{"jid":"20230504101022930120","result":{"7059772291476963338":{"retcode":0,"return":"","success":true}}}]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the cp.get_file job with the provided Salt 3002.6 setup and compare successful and empty return values. Trace how cp.get_file reports download results and identify the relevant regression-test location. Done means a failed download is not reported with retcode=0 and success=true, with a test covering the empty-return case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.