saltstack / saltstack/salt

[BUG] Missing log dir is no longer created in Salt 3005+ on Windows as it was in 3000.

Open
#65,595 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
Missing log dir is no longer created in Salt 3005+ on Windows as it was in 3000, most likely broken by https://github.com/saltstack/salt/commit/a9d5e75b528b711412b8fa30eb61c54413a254e9. Missing log dir creation used to work in Salt 3000, where that dir was created in salt\log\setup setup.py_logfile_handler() function. The aforementioned patch moved that code to salt_logging\impl.py while @s0undt3ch probably did not realise that salt.utils.verify.verify_log_files() function which in turn calls salt.utils.verify.verify_files() function does next to nothing on Windows (returns True if salt.utils.platform.is_windows()).

Setup
Any Windows Salt minion 3005+ setup.

Steps to Reproduce the behavior
Stop the minion service, remove the log dir and see it not re-created after starting the service. The minion will not log anything.

Expected behavior
Missing log dir created as it was at least in any version up to 3000 (possibly some versions in between that one and 3005 too).

Screenshots
N/A

Versions Report
Salt 3005.3, the code tweaked here and there but surely nowhere that could break this feature that's already broken based on verifying the current code and comparing with 3000.

N/A

Additional context
N/A

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 comparing salt_logging/impl.py with the older salt/log/setup.py implementation, then trace salt.utils.verify.verify_log_files() and verify_files() on Windows. Reproduce the issue by removing the minion log directory and restarting the service; done means the directory is recreated and the minion writes logs again.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.