AttributeError: type object 'datetime.datetime' has no attribute 'datetime' in FailureLineViewSet.update

RESOLVED FIXED

Status

Tree Management
Treeherder: API
P1
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: emorley, Assigned: jgraham)

Tracking

(Blocks: 1 bug)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
https://rpm.newrelic.com/accounts/677903/applications/4180461/traced_errors/53eba4c1-5310-11e6-9e2c-c81f66b8ceca_5210_10380

For PUT to:
/api/failure-line/5302627/

Traceback (most recent call last):
...
File "/data/www/treeherder.mozilla.org/treeherder-service/treeherder/webapp/api/failureline.py", line 99, in update
File "/data/www/treeherder.mozilla.org/venv/lib/python2.7/site-packages/django/utils/decorators.py", line 145, in inner
File "/data/www/treeherder.mozilla.org/treeherder-service/treeherder/webapp/api/failureline.py", line 81, in _update
File "/data/www/treeherder.mozilla.org/treeherder-service/treeherder/model/derived/jobs.py", line 451, in update_after_verification
File "/data/www/treeherder.mozilla.org/treeherder-service/treeherder/model/derived/jobs.py", line 528, in insert_autoclassify_job_note
 exceptions:AttributeError: type object 'datetime.datetime' has no attribute 'datetime' 

https://github.com/mozilla/treeherder/blame/5be1ce99a9c32246c412852738c93dad70ee2e02/treeherder/model/derived/jobs.py#L528
Flags: needinfo?(wlachance)
(Reporter)

Comment 1

a year ago
Also occurs during:

FailureLineViewSet.update_many
https://rpm.newrelic.com/accounts/677903/applications/4180461/traced_errors/82451733-5330-11e6-9e2c-c81f66b8ceca_0_5173

TextLogSummaryLineViewSet.update_many
https://rpm.newrelic.com/accounts/677903/applications/4180461/traced_errors/7e0a8222-532e-11e6-9e2c-c81f66b8ceca_0_5094

Yey for the datetime module having a daft naming scheme, making it easy to do `from datetime import datetime` and then from a later `datetime.datetime` without realising :-/

The fix here will be easy, but we should also add some more tests :-)
(Reporter)

Updated

a year ago
Blocks: 1289406

Comment 2

a year ago
Created attachment 8774742 [details] [review]
[treeherder] mozilla:autoclassify_bug_job_map > mozilla:master
(Assignee)

Updated

a year ago
Attachment #8774742 - Flags: review?(wlachance)
Comment on attachment 8774742 [details] [review]
[treeherder] mozilla:autoclassify_bug_job_map > mozilla:master

Excellent. On inspection it should, but just double checking: did you make sure the unit test now fails if you take your patch out?
Flags: needinfo?(wlachance)
Attachment #8774742 - Flags: review?(wlachance) → review+

Comment 4

a year ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/82918ec4235f8e0b55c839f141822a93cb09bda5
Bug 1289354 - Fix regression creating job bug associations after verifying classifications. (#1728)

This regressed with the move away from datasource.
(Reporter)

Updated

a year ago
Assignee: nobody → james
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.