New issue
Advanced search Search tips

Issue 651164 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

commitsentry poller throwing exceptions

Project Member Reported by mmoss@chromium.org, Sep 28 2016

Issue description

I just happened across this error in the commitsentry logs:

2016-09-28 17:50:06,510 - chromium - ERROR - Uncaught Exception in <chrome.bugdroid.poller_handlers.SentryPollerHandler object at 0x7f7fc71b8990>
Traceback (most recent call last):
  File "/usr/local/google/home/chrome-cron/src/infra/infra_internal/py_issue_tracker/chrome/bugdroid/gitiles_poller.py", line 174, in _ProcessGitLogEntry
    handler.ProcessLogEntry(log_entry)
  File "/usr/local/google/home/chrome-cron/src/infra/infra_internal/py_issue_tracker/chrome/bugdroid/poller_handlers.py", line 134, in ProcessLogEntry
    issues += self._GetIssues(self.cr_itm, cr_ids)
  File "/usr/local/google/home/chrome-cron/src/infra/infra_internal/py_issue_tracker/chrome/bugdroid/poller_handlers.py", line 154, in _GetIssues
    issues.append(itm.getIssue(i))
  File "/usr/local/google/home/chrome-cron/src/infra/infra_internal/py_issue_tracker/IssueTrackerManager2.py", line 315, in getIssue
    entry = self.client.issues().get(projectId=self.project_name, issueId=id).execute()
  File "/usr/local/google/home/chrome-cron/src/infra/infra_internal/py_issue_tracker/apiclient/discovery.py", line 621, in method
    cast_value = _cast(value, to_type)
  File "/usr/local/google/home/chrome-cron/src/infra/infra_internal/py_issue_tracker/apiclient/discovery.py", line 279, in _cast
    return str(int(value))
ValueError: invalid literal for int() with base 10: 'chromium'

I'm not sure yet exactly what's causing it, but it looks like it's been silently happening for a while now, I think since the svn-removal changes, probably:

https://chrome-internal.googlesource.com/infra/infra_internal/+/7a3a4e3dec263e228292c3e69721bd8036849c57
 

Comment 2 by agable@google.com, Sep 28 2016

I don't think this has anything to do with SVN: the surrounding code hasn't been touched by SVN removal changes, and is regarding communicating with Monorail, not with source repos.

The code is trying to call 
apiclient.discovery.build(
    api_name, api_version, discoveryServiceUrl=discovery_url, http=http
).issues().get(projectId=self.project_name, issueId=issue.id)

And the discovery-based apiclient is complaining that it is passing a string ('chromium') where it expects an int.

This suggests to me that something about the monorail API changed to expect a project's integer ID instead of its string name? Which would be a dumb change for us to make. Looking into it.

Comment 3 by mmoss@chromium.org, Sep 28 2016

Actually, looks like it goes all the way back to https://chrome-internal.googlesource.com/infra/infra_internal/+/a87fa0185df064862ad9e4448b80fe99bdd5dbff.

That changed the get_issues() return value to a dict, but SentryPollerHandler.ProcessLogEntry() still thinks it's a list of issue IDs (ints), and passes it directly to SentryPollerHandler._GetIssues() as such.

Comment 4 by agable@google.com, Sep 28 2016

The API Explorer shows[1] that we still expect the projectId to be a string. So it looks like what is actually happening is that it is trying to query for bug number "chromium", which is obviously invalid. Tracking down why it would try to do that now...


[1] https://apis-explorer.appspot.com/apis-explorer/?base=https%3A%2F%2Fmonorail-prod.appspot.com%2F_ah%2Fapi#p/monorail/v1/monorail.issues.get

Comment 5 by mmoss@chromium.org, Sep 28 2016

I think I have a fix, per #3.

Comment 6 by mmoss@chromium.org, Sep 28 2016

Owner: mmoss@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 28 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/infra/infra_internal.git/+/3692192fa86b239eda65158482faffbc57d6dc07

commit 3692192fa86b239eda65158482faffbc57d6dc07
Author: mmoss <mmoss@google.com>
Date: Wed Sep 28 20:27:40 2016

Comment 8 by mmoss@chromium.org, Sep 28 2016

Status: Fixed (was: Assigned)
I'm going to assume this fix is sufficient, since it worked when I ran locally in test mode, but we won't really know until it processes an appropriate commit. I'll keep an eye on the logs for a little while.

Sign in to add a comment