PreserveJobHistory and PreserveJobLog do not respect numeric input as outlined in the docs

Bug #1747765 reported by Bo Kersey on 2018-02-06
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Medium
Unassigned
Xenial
Medium
Unassigned
Bionic
Medium
Unassigned
Cosmic
Medium
Unassigned
Disco
Medium
Unassigned

Bug Description

[Impact]

 The documentation allows the following types of arguments for the PreserveJobHistory parameter:
PreserveJobHistory Yes
PreserveJobHistory No
PreserveJobHistory seconds

The value in seconds is treated in the same as 'No' resulting in immediate removing of jobs from history, while it is supposed to save it for <seconds>.

[Test Case]

 1. Set PreserveJobHistory to 30. Set LogLevel to debug.
 2. Schedule a job for printing.
 3. Check the error_log.
 4. Set PreserveJobHistory to No. Repeat 2-3.
 5. Set PreserveJobHistory to Yes. Repeat 2-3.

Expected result (for PreserveJobHistory values):
30: Job is save for at least 30 seconds.
No: Job is removed right after processing.
Yes: Job is never removed.

Actual results (for PreserveJobHistory values):
30: Job is immediately removed from history.
No: Job is removed right after processing.
Yes: Job is never removed.

[Regression Potential]

 * With the fix the jobs will be saved longer than before, so in tight conditions (low disk space) and heavy workload it may affect memory/disk space consumption and lead to running out of free space in worst case.

[Other Info]

 * Original bug description:

1) Ubuntu Release
Description: Ubuntu 16.04.3 LTS
Release: 16.04

2) Version of the package
cups:
  Installed: 2.1.3-4ubuntu0.3
  Candidate: 2.1.3-4ubuntu0.3
  Version table:
 *** 2.1.3-4ubuntu0.3 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages

3) What I expected to happen:
from man cupsd.conf

      PreserveJobFiles Yes

       PreserveJobFiles No

       PreserveJobFiles seconds
            Specifies whether job files (documents) are preserved after a job is printed. If a numeric value is specified, job files are preserved
            for the indicated number of seconds after printing. The default is "86400" (preserve 1 day).

       PreserveJobHistory Yes

       PreserveJobHistory No

       PreserveJobHistory seconds
            Specifies whether the job history is preserved after a job is printed. If a numeric value is specified, the job history is preserved for
            the indicated number of seconds after printing. If "Yes", the job history is preserved until the MaxJobs limit is reached. The default
            is "Yes".

4) What happens instead....

If I put the following directives in cupsd.conf the job files and history are deleted immediately.

PreserveJobFiles 604800
PreserveJobHistory 604800

Debug log showing history being purged:
d [06/Feb/2018:15:11:59 -0600] cupsdCheckJobs: 0 active jobs, sleeping=0, ac-power=-1, reload=0, curtime=1517951519
d [06/Feb/2018:15:11:59 -0600] cupsdCleanJobs: MaxJobs=100, JobHistory=604800, JobFiles=604800
D [06/Feb/2018:15:11:59 -0600] [Job 106] Removing from history.
D [06/Feb/2018:15:11:59 -0600] [Job 106] Unloading...

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cups (Ubuntu):
status: New → Confirmed
Dariusz Gadomski (dgadomski) wrote :

This has been fixed in 19.10 for cups 2.2.10-6 (backport from upstream).

Changed in cups (Ubuntu):
status: Confirmed → Fix Released
description: updated
Changed in cups (Ubuntu):
importance: Undecided → Medium
Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Disco

Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Bionic

Dariusz Gadomski (dgadomski) wrote :

@sponsors: Eoan already has the fix from Debian.

Dariusz Gadomski (dgadomski) wrote :

The patch doesn't apply cleanly to Xenial, working on backport.

Changed in cups (Ubuntu Xenial):
assignee: nobody → Dariusz Gadomski (dgadomski)
importance: Undecided → Medium
Changed in cups (Ubuntu Bionic):
importance: Undecided → Medium
Changed in cups (Ubuntu Disco):
importance: Undecided → Medium
Till Kamppeter (till-kamppeter) wrote :

Sponsored SRUs for Bionic and Disco.

Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Xenial.

Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Cosmic.

I have sponsored the Xenial SRU now, but the one for Cosmic is missing the addition of the patch to debian/patches/series.

Dariusz Gadomski (dgadomski) wrote :

Thanks Till. I've fixed cosmic debdiff, sorry about the mistake.

Changed in cups (Ubuntu Xenial):
assignee: Dariusz Gadomski (dgadomski) → nobody
Changed in cups (Ubuntu Cosmic):
importance: Undecided → Medium

SRU for Cosmic sponsored, thanks.

Changed in cups (Ubuntu Xenial):
status: New → In Progress
Changed in cups (Ubuntu Bionic):
status: New → In Progress
Changed in cups (Ubuntu Cosmic):
status: New → In Progress
Changed in cups (Ubuntu Disco):
status: New → In Progress
Dan Streetman (ddstreet) on 2019-05-31
tags: added: sts
Changed in cups (Ubuntu Disco):
assignee: nobody → Dariusz Gadomski (dgadomski)
Łukasz Zemczak (sil2100) wrote :

Thanks for the SRU! The upload looks good, but could I request that the new packages are tested against the PreserveJobHistory Yes/No values additionally to the 'seconds' case? As an additional safety check.

I will accept this upload but please include those 2 additional tests in the Test Case.

Changed in cups (Ubuntu Disco):
status: In Progress → Fix Committed

Hello Bo, or anyone else affected,

Accepted cups into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cups/2.2.10-4ubuntu2 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-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-disco
Łukasz Zemczak (sil2100) wrote :

Hello Bo, or anyone else affected,

Accepted cups into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cups/2.2.8-5ubuntu1.4 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-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in cups (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed-cosmic
Łukasz Zemczak (sil2100) wrote :

Hello Bo, or anyone else affected,

Accepted cups into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cups/2.2.7-1ubuntu2.6 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in cups (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Changed in cups (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed-xenial
Łukasz Zemczak (sil2100) wrote :

Hello Bo, or anyone else affected,

Accepted cups into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cups/2.1.3-4ubuntu0.9 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

description: updated
description: updated
description: updated
description: updated
Dariusz Gadomski (dgadomski) wrote :

Verified for bionic.
apt-cache policy cups-daemon
cups-daemon:
  Installed: 2.2.7-1ubuntu2.6

lp -d PDF /usr/share/cups/data/default.pdf

PreserveJobHistory 30:
I [04/Jun/2019:08:52:25 +0000] [Job 1] Job completed
D [04/Jun/2019:08:52:56 +0000] [Job 1] Removing from history.

PreserveJobHistory No:
I [04/Jun/2019:08:53:58 +0000] [Job 2] Job completed.
D [04/Jun/2019:08:53:58 +0000] [Job 2] Removing from history.

PreserveJobHistory Yes:
I [04/Jun/2019:08:54:55 +0000] [Job 5] Job completed.
(...)

tags: added: verification-done-bionic
removed: verification-needed-bionic
Dariusz Gadomski (dgadomski) wrote :

Verified for disco:

apt-cache policy cups-daemon
cups-daemon:
  Installed: 2.2.10-4ubuntu2

lp -d PDF /usr/share/cups/data/default.pdf

PreserveJobHistory 30:
I [04/Jun/2019:09:03:14 +0000] [Job 1] Job completed.
D [04/Jun/2019:09:03:45 +0000] [Job 2] Removing from history.

PreserveJobHistory No:
I [04/Jun/2019:09:04:06 +0000] [Job 2] Job completed.
D [04/Jun/2019:09:04:06 +0000] [Job 2] Removing from history.

PreserveJobHistory Yes:
I [04/Jun/2019:09:04:50 +0000] [Job 3] Job completed.

tags: added: verification-done-disco
removed: verification-needed-disco
Dariusz Gadomski (dgadomski) wrote :

Verified for cosmic:

apt-cache policy cups-daemon
cups-daemon:
  Installed: 2.2.8-5ubuntu1.4

lp -d PDF /usr/share/cups/data/default.pdf

PreserveJobHistory 30:
I [04/Jun/2019:09:12:13 +0000] [Job 1] Job completed.
D [04/Jun/2019:09:12:44 +0000] [Job 1] Removing from history.

PreserveJobHistory No:
I [04/Jun/2019:09:13:03 +0000] [Job 2] Job completed.
D [04/Jun/2019:09:13:03 +0000] [Job 2] Removing from history.

PreserveJobHistory Yes:
I [04/Jun/2019:09:13:30 +0000] [Job 3] Job completed.

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Changed in cups (Ubuntu Disco):
assignee: Dariusz Gadomski (dgadomski) → nobody
description: updated
Dariusz Gadomski (dgadomski) wrote :

Despite some build failures for i386 and s390 which I believe are not related to the scope of the change I have successfully verified it for amd64.

apt-cache policy cups-daemon
cups:
  Installed: 2.1.3-4ubuntu0.9

lp -d PDF /usr/share/cups/data/default.pdf

PreserveJobHistory 30:
I [04/Jun/2019:13:19:56 +0000] [Job 1] Job completed.
D [04/Jun/2019:13:20:27 +0000] [Job 1] Removing from history.

PreserveJobHistory No:
I [04/Jun/2019:13:22:32 +0000] [Job 2] Job completed.
D [04/Jun/2019:13:22:32 +0000] [Job 2] Removing from history.

PreserveJobHistory Yes:
I [04/Jun/2019:13:23:41 +0000] [Job 3] Job completed.

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
Łukasz Zemczak (sil2100) wrote :

Thank you for verifying all the test cases!

The verification of the Stable Release Update for cups 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.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 2.2.10-4ubuntu2

---------------
cups (2.2.10-4ubuntu2) disco; urgency=medium

  * d/p/0045-Fix-an-issue-with-PreserveJobHistory-and-time-values.patch
    Fix an issue with `PreserveJobHistory` and time values
    (Issue #5538, Closes: #921741, LP: #1747765)

 -- Dariusz Gadomski <email address hidden> Thu, 30 May 2019 09:51:37 +0200

Changed in cups (Ubuntu Disco):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 2.2.8-5ubuntu1.4

---------------
cups (2.2.8-5ubuntu1.4) cosmic; urgency=medium

  * d/p/0045-Fix-an-issue-with-PreserveJobHistory-and-time-values.patch
    Fix an issue with `PreserveJobHistory` and time values
    (Issue #5538, Closes: #921741, LP: #1747765)

 -- Dariusz Gadomski <email address hidden> Thu, 30 May 2019 14:11:53 +0200

Changed in cups (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 2.2.7-1ubuntu2.6

---------------
cups (2.2.7-1ubuntu2.6) bionic; urgency=medium

  * d/p/0045-Fix-an-issue-with-PreserveJobHistory-and-time-values.patch
    Fix an issue with `PreserveJobHistory` and time values
    (Issue #5538, Closes: #921741, LP: #1747765)

 -- Dariusz Gadomski <email address hidden> Thu, 30 May 2019 10:02:17 +0200

Changed in cups (Ubuntu Bionic):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 2.1.3-4ubuntu0.9

---------------
cups (2.1.3-4ubuntu0.9) xenial; urgency=medium

  * d/p/0045-Fix-an-issue-with-PreserveJobHistory-and-time-values.patch
    Fix an issue with `PreserveJobHistory` and time values
    (Issue #5538, Closes: #921741, LP: #1747765)

 -- Dariusz Gadomski <email address hidden> Thu, 30 May 2019 11:33:26 +0200

Changed in cups (Ubuntu Xenial):
status: Fix Committed → Fix Released
Bo Kersey (bo-vircio) wrote :

Thanks! I've just installed it on one of my Xenial servers for testing... I'll let you know how it goes...

Cheers!

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

Other bug subscribers