mozilla-services / updatebot

Automation for updating third party libraries for Firefox
Mozilla Public License 2.0
8 stars 5 forks source link

Sentry doesn't catch exception from `bugzilla_api.py` #378

Open maltejur opened 2 months ago

maltejur commented 2 months ago

Sentry didn't seem to have caught the exception from #374, only the Handled a Job with unexpected CREATED status in _process_existing_job exception from the next run.

tomrittervg commented 2 months ago

The logs show

[task 2024-09-02T18:27:05.321Z] [Debug]  (CommandProvider aom job_id=552) ----------------------------------------------
[task 2024-09-02T18:27:05.321Z] [Debug]  (CommandProvider aom job_id=552) ----------------------------------------------
[task 2024-09-02T18:27:05.321Z] [Info]   (CommandProvider aom job_id=552) Running ['hg', 'update', 'a283127a5d0aa005c54d339e8ca27414b55f079b']
[task 2024-09-02T18:27:05.706Z] [Info]   (CommandProvider aom job_id=552) Return: 0 Runtime (s): 0
[task 2024-09-02T18:27:05.706Z] [Debug]  (CommandProvider aom job_id=552) -------
[task 2024-09-02T18:27:05.706Z] [Debug]  (CommandProvider aom job_id=552) stdout:
[task 2024-09-02T18:27:05.706Z] [Debug]  (CommandProvider aom job_id=552) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[task 2024-09-02T18:27:05.706Z] 
[task 2024-09-02T18:27:05.706Z] [Debug]  (CommandProvider aom job_id=552) -------
[task 2024-09-02T18:27:05.706Z] [Debug]  (CommandProvider aom job_id=552) stderr:
[task 2024-09-02T18:27:05.706Z] [Debug]  (CommandProvider aom job_id=552) Traceback (most recent call last):
[task 2024-09-02T18:27:05.706Z]   File "/usr/lib/python3/dist-packages/mercurial/extensions.py", line 255, in _runuisetup
[task 2024-09-02T18:27:05.706Z]     uisetup(ui)
[task 2024-09-02T18:27:05.706Z]   File "/builds/worker/.mozbuild/evolve/hgext3rd/evolve/exthelper.py", line 149, in finaluisetup
[task 2024-09-02T18:27:05.706Z]     c(ui)
[task 2024-09-02T18:27:05.706Z]   File "/builds/worker/.mozbuild/evolve/hgext3rd/evolve/headchecking.py", line 28, in uisetup
[task 2024-09-02T18:27:05.706Z]     code = scmutil.filteredhash.__code__
[task 2024-09-02T18:27:05.706Z]            ^^^^^^^^^^^^^^^^^^^^
[task 2024-09-02T18:27:05.706Z] AttributeError: module 'mercurial.scmutil' has no attribute 'filteredhash'
[task 2024-09-02T18:27:05.706Z] *** failed to set up extension evolve: module 'mercurial.scmutil' has no attribute 'filteredhash'
[task 2024-09-02T18:27:05.706Z] 
[task 2024-09-02T18:27:05.706Z] [Debug]  (CommandProvider aom job_id=552) ----------------------------------------------
[task 2024-09-02T18:27:05.706Z] [Error]  (None aom job_id=552) Caught an exception while processing library aom task type vendoring
[task 2024-09-02T18:27:05.707Z] Traceback (most recent call last):
[task 2024-09-02T18:27:05.707Z]   File "/builds/worker/updatebot/./automation.py", line 233, in run
[task 2024-09-02T18:27:05.707Z]     taskRunner.process_task(lib, task)
[task 2024-09-02T18:27:05.707Z]   File "/builds/worker/updatebot/tasktypes/vendoring.py", line 77, in process_task
[task 2024-09-02T18:27:05.707Z]     self._process_new_job(library, task, new_version, timestamp, most_recent_job)
[task 2024-09-02T18:27:05.707Z]   File "/builds/worker/updatebot/components/logging.py", line 38, in func_wrapper
[task 2024-09-02T18:27:05.707Z]     ret = func(*args, **kwargs)
[task 2024-09-02T18:27:05.707Z]           ^^^^^^^^^^^^^^^^^^^^^
[task 2024-09-02T18:27:05.707Z]   File "/builds/worker/updatebot/tasktypes/vendoring.py", line 135, in _process_new_job
[task 2024-09-02T18:27:05.707Z]     created_job.bugzilla_id = self.bugzillaProvider.file_bug(library, CommentTemplates.UPDATE_SUMMARY(library, new_version, timestamp), CommentTemplates.UPDATE_DETAILS(len(all_upstream_commits), len(unseen_upstream_commits), commit_stats, commit_details), task.cc, blocks=task.blocking)
[task 2024-09-02T18:27:05.707Z]                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[task 2024-09-02T18:27:05.707Z]   File "/builds/worker/updatebot/components/logging.py", line 38, in func_wrapper
[task 2024-09-02T18:27:05.707Z]     ret = func(*args, **kwargs)
[task 2024-09-02T18:27:05.707Z]           ^^^^^^^^^^^^^^^^^^^^^
[task 2024-09-02T18:27:05.707Z]   File "/builds/worker/updatebot/components/bugzilla.py", line 206, in file_bug
[task 2024-09-02T18:27:05.707Z]     raise e
[task 2024-09-02T18:27:05.707Z]   File "/builds/worker/updatebot/components/bugzilla.py", line 198, in file_bug
[task 2024-09-02T18:27:05.707Z]     bugID = fileBug(self.config['url'], self.config['apikey'], self.config['General']['ff-version'],
[task 2024-09-02T18:27:05.707Z]             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[task 2024-09-02T18:27:05.707Z]   File "/builds/worker/updatebot/apis/bugzilla_api.py", line 83, in fileBug
[task 2024-09-02T18:27:05.707Z]     raise Exception(j)
[task 2024-09-02T18:27:05.707Z] Exception: {'documentation': 'https://bmo.readthedocs.io/en/latest/api/', 'message': 'Comments cannot be longer than 65535 characters.', 'error': True, 'code': 114}
[task 2024-09-02T18:27:05.707Z] 
[task 2024-09-02T18:27:05.816Z] [Debug]  (MySQLDatabase irregexp) ================================================
[task 2024-09-02T18:27:05.816Z] [Info]   (MySQLDatabase irregexp) Beginning MySQLDatabase.get_all_jobs_for_library
[task 2024-09-02T18:27:05.816Z] [Debug]  (MySQLDatabase irregexp)  Arguments: (<components.db.MySQLDatabase object at 0x7f0dd9d84490>, {{ irregexp  Core  JavaScript Engine  72678618db88d6b27e86b0b01e271b166d8f6b8b  https://chromium.googlesource.com/v8/v8.git  False  regular  iireland@mozilla.com  iain  sm-shell  None  None  js/src/irregexp/moz.yaml [{vendoring True None [] [] 1 week linux None None None }] }}) {}
[task 2024-09-02T18:27:05.851Z] [Debug]  (MySQLDatabase irregexp) Function returned a list of 73 objects
[task 2024-09-02T18:27:05.851Z] [Info]   (MySQLDatabase irregexp) Ending MySQLDatabase.get_all_jobs_for_library
[task 2024-09-02T18:27:05.851Z] [Debug]  (BugzillaProvider irregexp) ================================================
[task 2024-09-02T18:27:05.851Z] [Info]   (BugzillaProvider irregexp) Beginning BugzillaProvider.find_open_bugs
[task 2024-09-02T18:27:05.851Z] [Debug]  (BugzillaProvider irregexp)  Arguments: (<components.bugzilla.BugzillaProvider object at 0x7f0dd9cb5350>, [1913912, 1912925, 1911728, 1910536, 1909012, 1907634, 1906440, 1905269, 1903964, 1902544, 1895871, 1894663, 1893380, 1892130, 1890833, 1889449, 1888122, 1886341, 1885058, 1882696, 1881424, 1880393, 1879225, 1877785, 1876272, 1875051, 1873890, 1872798, 1871997, 1870907, 1869375, 1868193, 1866849, 1865622, 1864377, 1863253, 1861893, 1860461, 1859197, 1857816, 1856229, 1854828, 1853538, 1852403, 1851324, 1850224, 1849441, 1848480, 1847344, 1846106, 1841990, 1840992, 1839777, 1838553, 1837311, 1836120, 1833557, 1831446, 1826625, 1824263, 1822882, 1821312, 1816491, 1812487, 1806927, 1805798, 1804509, 1803348, 1802121, 1800815, 1799788, 1798540, 1797296]) {}
[task 2024-09-02T18:27:06.179Z] [Debug]  (BugzillaProvider irregexp) Function returned a list of 0 objects
[task 2024-09-02T18:27:06.179Z] [Info]   (BugzillaProvider irregexp) Ending BugzillaProvider.find_open_bugs
[task 2024-09-02T18:27:06.180Z] [Debug]  (VendorProvider irregexp) ================================================
[task 2024-09-02T18:27:06.180Z] [Info]   (VendorProvider irregexp) Beginning VendorProvider.check_for_update
[task 2024-09-02T18:27:06.180Z] [Debug]  (VendorProvider irregexp)  Arguments: (<components.mach_vendor.VendorProvider object at 0x7f0dda308b10>, {{ irregexp  Core  JavaScript Engine  72678618db88d6b27e86b0b01e271b166d8f6b8b  https://chromium.googlesource.com/v8/v8.git  False  regular  iireland@mozilla.com  iain  sm-shell  None  None  js/src/irregexp/moz.yaml [{vendoring True None [] [] 1 week linux None None None }] }}) {}
[task 2024-09-02T18:27:06.180Z] [Debug]  (CommandProvider irregexp) ----------------------------------------------
[task 2024-09-02T18:27:06.180Z] [Info]   (CommandProvider irregexp) Running ['./mach', 'vendor', '--check-for-update', 'js/src/irregexp/moz.yaml']
[task 2024-09-02T18:27:07.123Z] [Info]   (CommandProvider irregexp) Return: 0 Runtime (s): 0
[task 2024-09-02T18:27:07.123Z] [Debug]  (CommandProvider irregexp) -------
[task 2024-09-02T18:27:07.123Z] [Debug]  (CommandProvider irregexp) stdout:
[task 2024-09-02T18:27:07.123Z] [Debug]  (CommandProvider irregexp) 214915d798de861c7ab1b7f27a5de19ba9d26007 Mon Sep 02 18:25:34 2024
[task 2024-09-02T18:27:07.123Z] 
[task 2024-09-02T18:27:07.123Z] [Debug]  (CommandProvider irregexp) -------
[task 2024-09-02T18:27:07.123Z] [Debug]  (CommandProvider irregexp) stderr:
[task 2024-09-02T18:27:07.123Z] [Debug]  (CommandProvider irregexp) 
[task 2024-09-02T18:27:07.123Z] [Debug]  (CommandProvider irregexp) ----------------------------------------------
[task 2024-09-02T18:27:07.123Z] [Debug]  (VendorProvider irregexp) Function returned ('214915d798de861c7ab1b7f27a5de19ba9d26007', '2024-09-02 00:00:00')
[task 2024-09-02T18:27:07.123Z] [Info]   (VendorProvider irregexp) Ending VendorProvider.check_for_update
[task 2024-09-02T18:27:07.123Z] [Info]   (VendorTaskRunner irregexp) Processing irregexp for a new upstream revision 214915d798de861c7ab1b7f27a5de19ba9d26007, the most recent job is 542.

We can see the code here being hit. We're calling capture_exception(e) from Sentry explicitly,

We don't do this very often, only in a few places. It makes me wonder if that's not working.