codex-team / codex-team/hawk.workers
[Hawk] TypeError: Cannot read properties of null (reading 'find')
- Dominant language
- TypeScript
- Stars
- 8
- Forks
- 1
- Avg merge
- 12h 22m
- Merged PRs (30d)
- 2
Description
## TypeError: Cannot read properties of null (reading 'find')
- at renderBacktrace (/app/workers/slack/src/templates/event.js:15:56)
```diff
7: const { section, actions, divider, context } = slack_block_kit_1.block;
8: /**
9: * Renders backtrace overview
10: *
11: * @param event - event to render
12: */
13: function renderBacktrace(event) {
14: let code = '';
-15: const firstNotEmptyFrame = event.payload.backtrace.find(frame => !!frame.sourceCode);
16: if (!firstNotEmptyFrame) {
17: return code;
18: }
19: code = firstNotEmptyFrame.sourceCode.map(({ line, content }) => {
20: let colDelimiter = ': ';
21: if (line === firstNotEmptyFrame.line) {
22: colDelimiter = ' ->';
23: }
```
View full stack trace
- at render (/app/workers/slack/src/templates/event.js:45:27)
```diff
37: const eventURL = (0, utils_1.getEventUrl)(tplData.host, tplData.project, event);
38: const location = (0, utils_1.getEventLocation)(event);
39: const blocks = [
40: section(text(event.payload.title, slack_block_kit_1.TEXT_FORMAT_PLAIN)),
41: context([
42: text(`${location}`),
43: ]),
44: context([
-45: text(`\`\`\`${renderBacktrace(event)}\`\`\``, slack_block_kit_1.TEXT_FORMAT_MRKDWN),
46: ]),
47: context([
48: text(`*${eventInfo.newCount} new* ${event.totalCount} total`, slack_block_kit_1.TEXT_FORMAT_MRKDWN),
49: ]),
50: divider(),
51: actions([
52: button('action', 'View event', {
53: style: 'danger',
```
- at SlackProvider.render (/app/workers/slack/src/provider.js:50:16)
```diff
42: }
43: /**
44: * Render slack message template
45: *
46: * @param template - template to render
47: * @param variables - variables for template
48: */
49: async render(template, variables) {
-50: return template(variables);
51: }
52: }
53: exports.default = SlackProvider;
```
- at SlackProvider.send (/app/workers/slack/src/provider.js:40:40)
```diff
32: break;
33: case 'several-events':
34: template = templates_1.default.SeveralEventsTpl;
35: break;
36: /**
37: * @todo add assignee notification for telegram provider
38: */
39: }
-40: const webhookArgs = await this.render(template, notification.payload);
41: await this.deliverer.deliver(to, webhookArgs);
42: }
43: /**
44: * Render slack message template
45: *
46: * @param template - template to render
47: * @param variables - variables for template
48: */
```
- at SlackSenderWorker.handleEventTask (/app/workers/sender/src/index.js:153:23)
```diff
145: repetitionId: repetitionId ?? null,
146: };
147: }));
148: let notificationType = 'event';
149: if (eventsData.length > 1) {
150: notificationType = 'several-events';
151: }
152: this.logger.info(`Sending ${notificationType} notification to ${channel.endpoint}`);
-153: this.provider.send(channel.endpoint, {
154: type: notificationType,
155: payload: {
156: host: process.env.GARAGE_URL,
157: hostOfStatic: process.env.API_STATIC_URL,
158: project,
159: events: eventsData,
160: period: channel.minPeriod,
161: notificationRuleId: rule._id.toString(),
```
- at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
- at async SlackSenderWorker.processMessage (/app/lib/worker.js:270:13)
```diff
262: this.logger.verbose('Received event:\n', {
263: message: stringifiedEvent,
264: });
265: }
266: catch (error) {
267: throw new workerErrors_1.ParsingError('Worker::processMessage: Message parsing error' + error);
268: }
269: try {
-270: await this.handle(event);
271: /**
272: * Let RabbitMQ know that we processed the message
273: */
274: this.channelWithRegistry.ack(msg);
275: /**
276: * Increment counter of successfully processed messages if metrics are enabled
277: */
278: // this.metricSuccessfullyProcessedMessages?.inc();
```
| Param | Value |
| -- | :--: |
| Since | 6 Mar 2026 13:25:04 |
| Days Repeating | 96 |
| Total Occurrences | 236 |
| Users Affected | - |
View Context and Addons
### Context
```json
{}
```
### Details
[View in Hawk](https://garage.hawk.so/project/5ee7a80de6ce2b651831f26e/event/920299ec06799d92aeb70834bce1da5c9e5ad2ce660b081dddeedf072b1606c8)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.