Skip to content

Add issue and repair for NTP sync failure#165463

Draft
sairon wants to merge 1 commit intodevfrom
hassio-ntp-sync-fail-repair
Draft

Add issue and repair for NTP sync failure#165463
sairon wants to merge 1 commit intodevfrom
hassio-ntp-sync-fail-repair

Conversation

@sairon
Copy link
Member

@sairon sairon commented Mar 13, 2026

Proposed change

Notify user about NTP sync failures and create repair for issue/suggestion added in home-assistant/supervisor#6625.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @home-assistant/supervisor, mind taking a look at this pull request as it has been labeled with an integration (hassio) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of hassio can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign hassio Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

@sairon
Copy link
Member Author

sairon commented Mar 13, 2026

Keeping in draft until client library with home-assistant-libs/python-supervisor-client#282 is released for the new constants used in tests.

@sairon
Copy link
Member Author

sairon commented Mar 14, 2026

Can be made ready for merge after this is merged:

Notify user about NTP sync failures and create repair for issue/suggestion
added in home-assistant/supervisor#6625.
@sairon sairon force-pushed the hassio-ntp-sync-fail-repair branch from 351ac66 to 6365a0f Compare March 16, 2026 12:15
@sairon sairon marked this pull request as ready for review March 16, 2026 12:15
Copilot AI review requested due to automatic review settings March 16, 2026 12:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a repair flow for NTP sync failure issues reported by the Supervisor, notifying users when NTP time servers are unreachable and the system clock was corrected.

Changes:

  • Added NTP sync failed issue key to the set of known supervisor issues
  • Added user-facing strings for the NTP repair flow (title, description, abort message)
  • Added tests for the NTP repair flow (success, error, and issue creation paths)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
homeassistant/components/hassio/issues.py Registers issue_system_ntp_sync_failed as a known issue key
homeassistant/components/hassio/strings.json Adds repair flow strings (title, step description, abort message)
tests/components/hassio/test_repairs.py Tests for NTP repair flow success and error paths
tests/components/hassio/test_issues.py Test for NTP sync failed issue creation via supervisor event

You can also share your feedback on Copilot code review. Take the survey.

},
"step": {
"system_enable_ntp": {
"description": "NTP time servers were unreachable and the system clock was found to be more than 1 hour off. The time has been corrected and the NTP service was temporarily disabled to allow this adjustment.\n\nCheck the **Host logs** to investigate why NTP servers could not be reached. Once resolved, select **Submit** to re-enable the NTP service."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. time servers were unreachable .. The time has been corrected

This seems contradicting, immediately begs the question how time sync has been made then :)

How about something more elaborate:

Suggested change
"description": "NTP time servers were unreachable and the system clock was found to be more than 1 hour off. The time has been corrected and the NTP service was temporarily disabled to allow this adjustment.\n\nCheck the **Host logs** to investigate why NTP servers could not be reached. Once resolved, select **Submit** to re-enable the NTP service."
"description": "The device could not contact its configured time servers (NTP). Using a secondary online time check, we detected that the system clock was more than 1 hour incorrect. The time has been corrected and the NTP service was temporarily disabled so the correction could be applied. To keep the system time accurate, we recommend fixing the issue preventing access to the NTP servers.\n\nCheck the **Host logs** to investigate why NTP servers could not be reached. Once resolved, select **Submit** to re-enable the NTP service."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe display the time servers? 🤔 I think not, but maybe we could wire this up relatively quickly?

}
}
},
"title": "NTP sync failed - system time was corrected"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"title": "NTP sync failed - system time was corrected"
"title": "Time synchronization issue detected"

Or maybe

Suggested change
"title": "NTP sync failed - system time was corrected"
"title": "Time synchronization issue detected - system time was corrected"

@home-assistant home-assistant bot marked this pull request as draft March 16, 2026 14:48
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants