Bug 695234 - Incorrect end date displayed in the subscription manager
Summary: Incorrect end date displayed in the subscription manager
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.7
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 5.7
Assignee: John Sefler
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 675214 699442
TreeView+ depends on / blocked
 
Reported: 2011-04-11 06:20 UTC by Kenji Nanamiya
Modified: 2011-07-21 12:30 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 699442 (view as bug list)
Environment:
Last Closed: 2011-07-21 08:46:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
This is a Customer Portal view in which we can see the correct end date. Date format is MM/DD/YYYY. (112.97 KB, image/png)
2011-04-11 06:20 UTC, Kenji Nanamiya
no flags Details
wrong end date displayed on the top left corner (4 Jan 2012) and in the middle (3 Jan 2012). (377.58 KB, image/png)
2011-04-11 06:21 UTC, Kenji Nanamiya
no flags Details
four day discrepancy in end dates - got to see it to believe it! (221.72 KB, image/png)
2011-04-12 19:48 UTC, John Sefler
no flags Details
Software entitlements valid through <date> (47.37 KB, image/png)
2011-04-12 19:58 UTC, John Sefler
no flags Details
circled end dates in green are now formatted in the client system's local time zone (757.62 KB, image/png)
2011-05-21 04:38 UTC, John Sefler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 695234 0 unspecified CLOSED Incorrect end date displayed in the subscription manager 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2011:1078 0 normal SHIPPED_LIVE new package: subscription-manager 2011-07-21 08:45:07 UTC

Internal Links: 688724 695234

Description Kenji Nanamiya 2011-04-11 06:20:50 UTC
Created attachment 491149 [details]
This is a Customer Portal view in which we can see the correct end date. Date format is MM/DD/YYYY.

Description of problem:

Subscription end date in the Subscription Manager is incorrect.


How reproducible:

Steps to Reproduce:
1. Open subscription manager
2. Register a system
3. Assign a subscription to the system
4. Click on My Subscriptions
5. Under the subscription details, we can see the wrong end date. Also we can see the wrong date on the top left corner ¨Product entitlement valid through...¨.


Expected results:
The same end date that can be seen on the customer portal will be displayed.


Additional info: 
Pls see the screenshots.
customerportal.png: correct end date displayed.
SubM.png: wrong end date displayed here.

Comment 1 Kenji Nanamiya 2011-04-11 06:21:52 UTC
Created attachment 491150 [details]
wrong end date displayed on the top left corner (4 Jan 2012) and in the middle (3 Jan 2012).

Comment 4 Kenji Nanamiya 2011-04-11 23:25:05 UTC
Comment on attachment 491149 [details]
This is a Customer Portal view in which we can see the correct end date. Date format is MM/DD/YYYY.

This is a correct end date that we can confirm on the Customer Portal page. Date format is mm/dd/yyyy.

Comment 5 Kenji Nanamiya 2011-04-11 23:30:27 UTC
Hi John,

Yes the date format is different between the customer portal and the subscription manager but what you said is correct (If this is the case, then the end dates differ by 1 day.).
Please also check the top left corner, this expiration date is added one more day.

Cheers,
Kenji

Comment 6 John Sefler 2011-04-12 14:29:01 UTC
I have not yet had the opportunity to reproduce this error, but I must agree that there is a problem somewhere in the localization of the enddate.

From my understanding of the screenshots:
1. web client tools is reporting a subscription enddate of Jan 02, 2012
2. subscription-manager-gui is reporting in the subscription details an enddate of Jan 03, 2012
3. subscription-manager-gui is reporting in the certificate status that the certificates are valid through (which to me means including) Jan 04, 2012
4. what is reported by subscription-manager list --consumed ?

There is a discrepancy of 2 days between the web client tool and subscription-manager-gui

Comment 10 John Sefler 2011-04-12 19:48:48 UTC
Created attachment 491560 [details]
four day discrepancy in end dates - got to see it to believe it!

Attached is a screenshot that shows four different end dates that supposedly represent the same date.
1. subscription-manager list --consumed
2. subscription-manager-gui My Installed Software
3. subscription-manager-gui Certificate Status
4. web client Subscriptions
5. subscription-manager-gui My Subscriptions (NOT SHOWN, BUT DISPLAYS enddate of 04/11/2012)

Version Tested: (Note this is rhel6, but also applies to rhel5.7)
[root@jsefler-betastage-server tmp]# rpm -qa | grep subscription-manager
subscription-manager-0.95.7-1.git.12.3b9a09e.el6.x86_64
subscription-manager-firstboot-0.95.7-1.git.12.3b9a09e.el6.x86_64
subscription-manager-gnome-0.95.7-1.git.12.3b9a09e.el6.x86_64


[root@jsefler-betastage-server entitlement]# date
Tue Apr 12 15:08:32 EDT 2011
[root@jsefler-betastage-server entitlement]# openssl x509 -text -in 2973020770543838983.pem | grep 1.3.6.1.4.1.2312.9.4.7 -B2 -A1
            1.3.6.1.4.1.2312.9.4.6: 
                ..2011-04-12T04:00:00Z
            1.3.6.1.4.1.2312.9.4.7: 
                ..2012-04-12T03:59:59Z

^^^^ Note from the entitlement cert, this entitlement is technically valid until the last tick of the day on April 11, 2012 in my timezone EDT.  Therefore, looking at the screenshot, the command line tool list --consumed and subscription-manager-gui My Subscriptions are the winners!  The others are wrong.


Additional Info...

Here's a look at the subscription pool:
# curl -u stage_test_12:redhat -k http://rubyvip.web.stage.ext.phx2.redhat.com:80/clonepin/candlepin/owners/6306607/pools | python -mjson.tool | grep 2280386 -A26 -B27

    {
        "accountNumber": "1444063", 
        "activeSubscription": true, 
        "attributes": [
            {
                "created": "2011-04-12T15:59:50.000+0000", 
                "id": "8a99f9812f270524012f4a70b1021b7e", 
                "name": "requires_consumer_type", 
                "updated": "2011-04-12T15:59:50.000+0000", 
                "value": "system"
            }, 
            {
                "created": "2011-04-12T15:59:50.000+0000", 
                "id": "8a99f9812f270524012f4a70b1021b7f", 
                "name": "virt_limit", 
                "updated": "2011-04-12T15:59:50.000+0000", 
                "value": "0"
            }, 
            {
                "created": "2011-04-12T15:59:50.000+0000", 
                "id": "8a99f9812f270524012f4a70b1021b80", 
                "name": "virt_only", 
                "updated": "2011-04-12T15:59:50.000+0000", 
                "value": "true"
            }
        ], 
        "consumed": 0, 
        "contractNumber": "2280386", 
        "created": "2011-04-12T15:59:50.000+0000", 
        "endDate": "2012-04-12T03:59:59.000+0000", 
        "href": "/pools/8a99f9812f270524012f4a70b1021b7d", 
        "id": "8a99f9812f270524012f4a70b1021b7d", 
        "owner": {
            "href": "/owners/6306607", 
            "id": "8a99f9812f270524012f3694dc59509e"
        }, 
        "productId": "RH0103708", 
        "productName": "Red Hat Enterprise Linux Server, Premium (8 sockets) (Up to 4 guests)", 
        "providedProducts": [
            {
                "created": "2011-04-12T15:59:50.000+0000", 
                "id": "8a99f9812f270524012f4a70b1021b81", 
                "productId": "69", 
                "productName": "Red Hat Enterprise Linux 6 Server", 
                "updated": "2011-04-12T15:59:50.000+0000"
            }
        ], 
        "quantity": 400, 
        "restrictedToUsername": null, 
        "sourceEntitlement": null, 
        "startDate": "2011-04-12T04:00:00.000+0000", 
        "subscriptionId": "2077747", 
        "updated": "2011-04-12T15:59:50.000+0000"
    }

^^^ as expected, its enddate matches the entitlement enddate of 2012-04-12T03:59:59.000+0000 which is correct

Comment 11 John Sefler 2011-04-12 19:58:19 UTC
Created attachment 491562 [details]
Software entitlements valid through <date>

Also relevant to this bug are the dates on the Subscription Assistant dialog.

I suspect the fix to correct the date rendered in the "Software entitlements valid through <date>" string displayed in the Certificate Status panel AND the Subscription Assistant is to localize the date from GMT to the local timezone.

Comment 12 John Sefler 2011-04-12 20:07:02 UTC
I'm adding Grant Gainey (developer of the web client tooling for subscriptions) as a cc on this bug list since attachment 491560 [details] shows that the end date displayed in the web client does not appear to be localized from GMT to the local timezone as detailed in comment 10.

Comment 13 Adrian Likins 2011-04-21 17:17:40 UTC
commit 73eda9ccf29a4bffba0c146250bb1046792c58cd
Author: Adrian Likins <alikins>
Date:   Mon Apr 18 14:16:43 2011 -0400

    695234: dates are being displayed incorrectly everywhere
    
    installed tab was storing a formatted date string, which
    was getting coverted to a datetime, losing it's timezone, and
    was then getting displayed incorrectly.
    
    Change all of our TreeStores to store datetime objects for
    dates instead of formatted strings, and make CellRendererDate
    do the formatting.
    
    Add parseDate to managerlib and make formatDate just format.
    parseDate expects an iso8601 style date and returns a datetime,
    while formatDate expects a datetime and returns a formatted
    string. Move LocalTz tzinfo subclass here from gui/utils.
    
    Note: for installedtab, we also changed the start/end dates
    displayed from being the _order_ start and end dates, to
    being the stand/end dates for the certificate.
    
    Try to be a little more consistent in our usage of formatDate vs strftime


(this should fix up the client side stuff)

Comment 14 John Sefler 2011-05-21 04:38:52 UTC
Created attachment 500169 [details]
circled end dates in green are now formatted in the client system's local time zone

Verifying Version...
[root@jsefler-RHEL57ServerBeta12 product]# rpm -qa | grep subscription-manager
subscription-manager-firstboot-0.95.5.18-1.el5
subscription-manager-0.95.5.18-1.el5
subscription-manager-gnome-0.95.5.18-1.el5


Viewing the attached screenshot for rhel57, you will see that the end dates for a subscription between subscription-manager-gui and subscription-manager cli circled in green now match and represent the UTC end date formatted into the local time zone (EDT) of the client system. 

The Product Entitlement certificate end date circled in red is being tracked in a separate bug #703286

The end date in the rhsm web application is also being tracked in a separate bug #703303

Comment 15 errata-xmlrpc 2011-07-21 08:46:29 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-1078.html

Comment 16 errata-xmlrpc 2011-07-21 12:30:04 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-1078.html


Note You need to log in before you can comment on or make changes to this bug.