[Buildbot-commits] [Buildbot] #2054: buildbot/github post-receive URL timestamp problem

Buildbot trac trac at buildbot.net
Mon Mar 10 22:10:20 UTC 2014


#2054: buildbot/github post-receive URL timestamp problem
---------------------+-----------------------
Reporter:  mmorse    |       Owner:
    Type:  defect    |      Status:  reopened
Priority:  critical  |   Milestone:  0.8.5
 Version:  0.8.4p1   |  Resolution:
Keywords:  git       |
---------------------+-----------------------

Old description:

> I'm trying to trigger a buildbot run whenever there's a change to a
> github repo. I've added a post-receive URL service hook to the repo, and
> verified that the POST is making it back to my buildmaster. However, an
> exception is raised when that POST is processed:
>
> {{{
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] Attempting to load
> module buildbot.status.web.hooks.github
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] in process_change
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]
> ERROR:root:Encountered an exception:
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]
> ERROR:root:Traceback (most recent call last):
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File
> "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py",
> line 100, in getChanges
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]     changes =
> process_change(payload, user, repo, repo_url, project)
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File
> "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py",
> line 139, in process_change
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]     when =
> convertTime( commit['timestamp'])
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File
> "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py",
> line 63, in convertTime
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]
> result.groups()
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]
> ERROR:root:AttributeError: 'NoneType' object has no attribute 'groups'
> 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] Got the following
> changes None
> }}}
>
> From what I can determine, the problem is that the timestamp coming from
> the github repo looks like this:
>
> {{{
> "timestamp":"2011-07-12T18:32:05Z"
> }}}
>
> ...but module buildbot.status.web.hooks.github is looking for something
> in the format:
>
> {{{
> "timestamp":"1970-01-01T00:00:00+00:00"
> }}}
> Here's the code
> (http://buildbot.net/buildbot/docs/0.8.3/reference/buildbot.status.web.hooks
> .github-pysrc.html):
>
> {{{
> 59 def convertTime(myTestTimestamp):
> 60      #"1970-01-01T00:00:00+00:00"
> 61      matcher =
> re.compile(r'(dddd)-(dd)-(dd)T(dd):(dd):(dd)([-+])(dd):(dd)')
> 62      result  = matcher.match(myTestTimestamp)
> 63      (year, month, day, hour, minute, second, offsetsign, houroffset,
> minoffset) =
> 64          result.groups()
> }}}
>

> Here's the configuration of the build master
> {{{
> System Version: Mac OS X Server 10.6.8 (10K540)
>   Server Configuration: Advanced
>   Kernel Version:       Darwin 10.8.0
>   Boot Volume:  SnowLeopardServer
>   Boot Mode:    Normal
>   Computer Name:        DevPubsContinuousIntegration
>   User Name:    BuildMaster (buildmaster)
>   Secure Virtual Memory:        Not Enabled
>   64-bit Kernel and Extensions: No
>   Time since boot:      1 day6:37
>
> Buildbot version: 0.8.4p1
> Twisted version: 11.0.0
>
> }}}

New description:

 I'm trying to trigger a buildbot run whenever there's a change to a github
 repo. I've added a post-receive URL service hook to the repo, and verified
 that the POST is making it back to my buildmaster. However, an exception
 is raised when that POST is processed:

 {{{
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] Attempting to load
 module buildbot.status.web.hooks.github
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] in process_change
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]
 ERROR:root:Encountered an exception:
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]
 ERROR:root:Traceback (most recent call last):
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File
 "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py",
 line 100, in getChanges
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]     changes =
 process_change(payload, user, repo, repo_url, project)
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File
 "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py",
 line 139, in process_change
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]     when =
 convertTime( commit['timestamp'])
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File
 "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py",
 line 63, in convertTime
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]     result.groups()
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60]
 ERROR:root:AttributeError: 'NoneType' object has no attribute 'groups'
 2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] Got the following
 changes None
 }}}

 From what I can determine, the problem is that the timestamp coming from
 the github repo looks like this:

 {{{
 "timestamp":"2011-07-12T18:32:05Z"
 }}}

 ...but module buildbot.status.web.hooks.github is looking for something in
 the format:

 {{{
 "timestamp":"1970-01-01T00:00:00+00:00"
 }}}
 Here's the code
 (http://buildbot.net/buildbot/docs/0.8.3/reference/buildbot.status.web.hooks
 .github-pysrc.html):

 {{{
 59 def convertTime(myTestTimestamp):
 60      #"1970-01-01T00:00:00+00:00"
 61      matcher =
 re.compile(r'(dddd)-(dd)-(dd)T(dd):(dd):(dd)([-+])(dd):(dd)')
 62      result  = matcher.match(myTestTimestamp)
 63      (year, month, day, hour, minute, second, offsetsign, houroffset,
 minoffset) =
 64          result.groups()
 }}}


 Here's the configuration of the build master
 {{{
 System Version: Mac OS X Server 10.6.8 (10K540)
   Server Configuration: Advanced
   Kernel Version:       Darwin 10.8.0
   Boot Volume:  SnowLeopardServer
   Boot Mode:    Normal
   Computer Name:        DevPubsContinuousIntegration
   User Name:    BuildMaster (buildmaster)
   Secure Virtual Memory:        Not Enabled
   64-bit Kernel and Extensions: No
   Time since boot:      1 day6:37

 Buildbot version: 0.8.4p1
 Twisted version: 11.0.0

 }}}

--

Comment (by dustin):

 Any idea what the payload was in that case?

 Newer code uses dateutil's dateparse, which might be more effective.  If
 you can't get a copy of the payload that causes this, then maybe applying
 https://github.com/buildbot/buildbot/commit/30ed6549 would help?

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2054#comment:6>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list