saltstack / saltstack/salt

timezone.system fails on Debian when /etc/localtime is missing (3006.26–3006.27)

Open
#69,803 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

timezone.system fails when /etc/localtime does not exist, even though
timedatectl reports the correct timezone. Affects Debian 12 (bookworm) on arm64.
Related: #65719 (fix appears to be in 3008.x only, not backported to 3006 LTS)

Setup
  • OS: Debian 12 bookworm, arm64
  • Salt: 3006.26 / 3006.27 (all reproduce)
  • State:
  Europe/Zurich:
    timezone.system
Steps to reproduce
sudo rm -f /etc/localtime
timedatectl show -p Timezone --value   # still prints Europe/Zurich
sudo salt-call state.sls timezone pillar='{"timezone":"Europe/Zurich"}'
Expected

State succeeds and creates/updates /etc/localtime (or uses timedatectl as source of truth).

Actual
Unable to compare desired timezone 'Europe/Zurich' to system timezone:
Failed to read /etc/localtime to determine current timezone: No such file or directory

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 timezone.system state and reproduce the failure on Debian 12 after removing /etc/localtime; compare its behavior with timedatectl and review related issue #65719. Done means the state succeeds when /etc/localtime is absent and creates or updates it for the requested Europe/Zurich timezone.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, linux, python
Domain
devops, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.