Skip to content

[Slack Sink] KRR scan reports fail to send to Slack with PDF generation error #2005

@caroldelwing

Description

@caroldelwing

Describe the bug
Hey there. I got an issue where the KRR scan report fails to send to the configured Slack sink with a TypeError when attempting to generate PDFs. The scan completes successfully, but cannot be processed due to this error, and it leaves scans stuck forever in "in progress" state in the Robusta UI.

To Reproduce
Steps to reproduce the behavior:

  1. Add a scheduled KRR scan playbook with the Slack sink configured:
customPlaybooks:
    - triggers:
        - on_schedule:
            fixed_delay_repeat:
              repeat: -1
              seconds_delay: 604800
      actions:
        - krr_scan:
            krr_args: "--allow-hpa --job-grouping-labels krr.robusta.dev/group"
      sinks:
        - "main_slack_sink"

  sinksConfig:
    - slack_sink:
        name: main_slack_sink
        slack_channel: "krr-channel"
        api_key: "{{ env.SLACK_API_KEY }}"
  1. Deploy the changes and wait for the scan to complete
  2. Observe the error in robusta-runner logs

Expected behavior
KRR scan should complete successfully and send results to the configured Slack channel. The scan should be marked as "complete" in the Robusta UI. I know the sink is working because I'm seeing cluster alerts; it is just the KRR scan part.

Screenshots
If applicable, add screenshots to help explain your problem.
Here are the logs from the runner.

│ 2026-01-30 13:25:58.123 INFO     running scheduled job ***************                                                                                              
│ 2026-01-30 13:25:58.871 INFO     krr command 'python krr.py simple --publish_scan_url=http://robusta-runner.robusta.svc.cluster.local/api/trigger --scan_id=************* │
│ 2026-01-30 13:30:16.386 INFO     Received process_scan request for scan *************                                                                         
│ 2026-01-30 13:30:16.924 ERROR    Failed to send finding KrrReport to sink main_slack_sink                                                                                            
│ Traceback (most recent call last):                                                                                                                                                   
│   File "/app/src/robusta/core/playbooks/playbooks_event_handler_impl.py", line 318, in __handle_findings                                                                             
│     sink.write_finding(finding_copy, self.registry.get_sinks().platform_enabled)                                                                                                     
│   File "/app/src/robusta/core/sinks/slack/slack_sink.py", line 33, in write_finding                                                                                                  
│     self.slack_sender.send_finding_to_slack(finding, self.params, platform_enabled)                                                                                                  
│   File "/app/src/robusta/integrations/slack/sender.py", line 677, in send_finding_to_slack                                                                                           
│     return self.__send_finding_to_slack(                                                                                                                                             
│            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                             
│   File "/app/src/robusta/integrations/slack/sender.py", line 741, in __send_finding_to_slack                                                                                         
│     enrichment.blocks = [Transformer.scanReportBlock_to_fileblock(b) for b in enrichment.blocks]                                                                                     
│                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                     
│   File "/app/src/robusta/integrations/slack/sender.py", line 741, in <listcomp>                                                                                                      
│     enrichment.blocks = [Transformer.scanReportBlock_to_fileblock(b) for b in enrichment.blocks]                                                                                     
│                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                 
│   File "/app/src/robusta/core/sinks/transformer.py", line 299, in scanReportBlock_to_fileblock                                                                                       
│     return FileBlock(f"{title}.pdf", pdf.output("", "S"))                                                                                                                            
│                                      ^^^^^^^^^^^^^^^^^^^                                                                                                                             
│   File "/venv/lib/python3.11/site-packages/fpdf/deprecation.py", line 57, in wrapper                                                                                                 
│     return fn(*args, **kwargs)                                                                                                                                                       
│            ^^^^^^^^^^^^^^^^^^^                                                                                                                                                       
│ TypeError: FPDF.output() takes from 1 to 2 positional arguments but 3 were given

Desktop (please complete the following information):

  • Robusta Version: 0.32.0 (Helm chart)

Additional context
The problem appears to be in /app/src/robusta/core/sinks/transformer.py:299 where the code calls pdf.output("", "S") with the old fpdf library. The "new" fpdf2 library has changed the method signature and only accepts 1-2 args instead of 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions