saltstack / saltstack/salt

[BUG] pkg.uptodate reports success when refresh=True but package database check fails

Open
#60,162 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
As title

Setup
Debian-10 master/minion set
Salt: 3003

update.sls:

update:
  pkg.uptodate:
    - refresh: True

Steps to Reproduce the behavior
Take master offline or block external access.
salt '*' state.apply update

Expected behavior
Result will show "False"
Optional - Comment may report failure to update packages

Versions Report
I'm not on that machine at present.
Fresh install of Salt 3003, but reproducible elsewhere

Additional context
pkg.uptodate returns only True or False.

The reported Result is True with comment System is already up-to-date
This is fine when refresh is False, but when user has explicitly set refresh to True, it's a reasonable assumption that the failure to refresh will be somehow reported.
See e.g. QubesOS/qubes-issues#6585

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 with the pkg.uptodate state entry point and reproduce the report using update.sls with refresh: True while the master or external access is unavailable. Compare the returned result and comment with the expected failure behavior; done means a failed database refresh is reported instead of success with "System is already up-to-date".

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.