Time measurement in telemetry can be negative

Bug #1771966 reported by Didier Roche on 2018-05-18
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
High
Didier Roche
Bionic
High
Didier Roche

Bug Description

[Impact]

 * Telemetry was relaying on time.time() to report duration of installation and various step. This system clock though can be reset by the installer, loading to negative time report.

[Test Case]

 * Start an 18.04 live session and install ubiquity
 * Start ubiquity
 * Change the timezone to one "in the past" compared to your location
 * Complete the installation and close ubiquity without rebooting the session
 * Check that no values of the "Stages" hashmap in /target/var/log/installer/telemetry is negative

[Regression Potential]

 * We are using /proc/upstime as a reference and it's not affected by the system clock.
 * The worst case is that we still report negative telemetry data for time.

-----

time.time() is sensitive to system clock change after NTP sync.

We should rather use /proc/uptime as a reference and test it's not affected by system clock (it shouldn't).

Related branches

tags: added: rls-bb-incoming
Changed in ubiquity (Ubuntu):
importance: Undecided → High
status: New → Triaged
milestone: none → ubuntu-18.04.1
Didier Roche (didrocks) on 2018-05-28
Changed in ubiquity (Ubuntu Bionic):
status: New → Triaged
importance: Undecided → High
milestone: none → ubuntu-18.04.1
Changed in ubiquity (Ubuntu):
milestone: ubuntu-18.04.1 → none
Didier Roche (didrocks) on 2018-05-29
description: updated
Didier Roche (didrocks) on 2018-05-29
Changed in ubiquity (Ubuntu):
assignee: nobody → Didier Roche (didrocks)
Changed in ubiquity (Ubuntu Bionic):
assignee: nobody → Didier Roche (didrocks)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 18.10.3

---------------
ubiquity (18.10.3) cosmic; urgency=medium

  * Don't record telemetry data when doing stage 2 (user mode) as it keeps an
    unused /target directory (LP: #1773321) Also, record OEM types
    (LP: #1765693)
  * Switch to use uptime instead of time.time() which is sensitive to
    BIOS time reset after NTP sync, leading to negative values.
    (LP: #1771966)
  * Ignore .git file from built package and remove .bzr artefacts
  * update manifest

 -- Didier Roche <email address hidden> Mon, 28 May 2018 16:02:33 +0200

Changed in ubiquity (Ubuntu):
status: Triaged → Fix Released

Hello Didier, or anyone else affected,

Accepted ubiquity into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubiquity/18.04.14.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in ubiquity (Ubuntu Bionic):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-bionic
Jean-Baptiste Lallement (jibel) wrote :

SRU verification for Bionic:
I have reproduced the problem with ubiquity 18.04.14.1 in bionic-updates and have verified that the version of ubiquity 18.04.14.2 in -proposed fixes the issue.

Marking as verification-done

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 18.04.14.2

---------------
ubiquity (18.04.14.2) bionic; urgency=medium

  * Switch to use uptime instead of time.time() which is sensitive to
    BIOS time reset after NTP sync, leading to negative values.
    (LP: #1771966)
  * Don't record telemetry data when doing stage 2 (user mode) as it keeps an
    unused /target directory (LP: #1773321) Also, record OEM types
    (LP: #1765693)
  * Ignore .git file from built package and remove .bzr artefacts

 -- Didier Roche <email address hidden> Mon, 28 May 2018 16:08:48 +0200

Changed in ubiquity (Ubuntu Bionic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for ubiquity has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers