No reviews displayed (ValueError: time data ... does not match format)

Bug #1268250 reported by Matthew Palermo
60
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Ratings and Reviews server
Fix Released
High
Michael Nelson
software-center (Ubuntu)
Invalid
High
Unassigned
Nominated for Precise by Thomas Ward

Bug Description

Software-center stopped displaying reviews around the 10th of January 2014.
This happens for all apps (so far) in the software center.
A message saying "No network connection, Connect to the internet to see more reviews." is shown in place of the reviews.
The computer does have access to the internet.
A useful traceback is printed in the stderr which should be in the information collected from the ubuntu-bug program.

Traceback (most recent call last):
  File "/usr/share/software-center/softwarecenter/backend/reviews/rnr.py", line 129, in _on_reviews_helper_data
    callback(app, self._reviews[app])
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/appdetailsview.py", line 1050, in _reviews_ready_callback
    self.reviews.configure_reviews_ui()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/widgets/reviews.py", line 284, in configure_reviews_ui
    self._fill()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/widgets/reviews.py", line 208, in _fill
    self.useful_votes, is_first_for_version)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/widgets/reviews.py", line 467, in __init__
    useful_votes)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/widgets/reviews.py", line 615, in _build
    cur_t = self._get_datetime_from_review_date(review_data.date_created)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/widgets/reviews.py", line 539, in _get_datetime_from_review_date
    return datetime.datetime.strptime(raw_date_str, '%Y-%m-%d %H:%M:%S')
  File "/usr/lib/python2.7/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data '2012-08-25T06:16:42.749Z' does not match format '%Y-%m-%d %H:%M:%S'

It seems that the review date string sent from the reviews server is not in the expected format of the datetime.datetime.strptime function.
I have re-installed software-center with the --purge option.
The environment variable "SOFTWARE_CENTER_REVIEWS_HOST" is not set.

I have managed to do a bodgy fix on /usr/share/software-center/softwarecenter/ui/gtk3/widgets/reviews.py by inserting
raw_date_str = raw_date_str[:10] + " " + raw_date_str[11:19]
after line 538.

This fix is not ideal but it works. Perhaps someone with better knowledge in programming and this program in specific could find a more elegant fix. I have made a comment in the code describing the additional line.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: software-center 5.2.10
ProcVersionSignature: Ubuntu 3.8.0-35.50~precise1-generic 3.8.13.13
Uname: Linux 3.8.0-35-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: amd64
Date: Sun Jan 12 11:04:40 2014
ExecutablePath: /usr/share/software-center/software-center
InstallationMedia: This
InterpreterPath: /usr/bin/python2.7
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_AU.UTF-8
 LANGUAGE=en_AU:en
SourcePackage: software-center
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Matthew Palermo (mattpalermo) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "A bodgy fix to change the raw_datetime_str to the right format." seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Thomas Ward (teward) wrote :

I see you say "A useful tracepack is printed in the stderr". Are you able to attach that stacktrace here as part of the bug?

Revision history for this message
Matthew Palermo (mattpalermo) wrote :

Bug description has been updated with traceback, sorry thought Apport might have collected it. (First ubuntu bug report :) )

description: updated
Revision history for this message
Thomas Ward (teward) wrote :

The requested traceback was added into the description for the bug.

This traceback is shown in my crash as well when I attempted to test this on 12.04, so I am marking this as "Confirmed" and nominating this for Precise.

This should be tested on Quantal and later to determine if any other versions of software-center are affected, or this bug should be marked as a duplicate of another bug if a bug for this already exists.

Changed in software-center (Ubuntu):
status: New → Confirmed
Revision history for this message
Allard Pruim (allardpruim) wrote :

The fix from Matthew Palermo works for me on Ubuntu 12.04 Precise.

Changed in software-center (Ubuntu):
importance: Undecided → High
summary: - software-center fails to display reviews
+ No reviews displayed (ValueError: time data ... does not match format)
Changed in rnr-server:
assignee: nobody → Michael Nelson (michael.nelson)
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Matthew Palermo, thanks for this excellent debut report.

This seems like a breakage on the ratings+reviews server, which was recently upgraded. If so, changing the server to revert to the previous timestamp format might be much simpler than issuing updates for USC in every supported Ubuntu version.

Changed in rnr-server:
importance: Undecided → High
Changed in rnr-server:
status: New → In Progress
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Confirmed - it was a result of the upgrade to Django 1.5, the work for which was done over 6 months ago, but it was only deployed last Friday. Fixing now and will get deployed asap.

Changed in rnr-server:
status: In Progress → Fix Committed
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Fixed released and verified. Thanks everyone for all the info, sorry for the disruption to reviews.

Before deploy: http://paste.ubuntu.com/6745216/
After deploy: http://paste.ubuntu.com/6749235/
Verified with USC on saucy that searching for skype and viewing details displays the reviews.

Changed in rnr-server:
status: Fix Committed → Fix Released
Changed in software-center (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.