Skip to content

Reporting network policy violation should not cause unhandled promise rejection #71481

@legrego

Description

@legrego

This error currently causes an unhandled promise rejection, which crashes Kibana when running in dev mode. This should be addressed so that the error is caught and handled correctly:

Steps to reproduce:

  1. Constrain the network policy. Here is an example policy which restricts access to via.placeholder.com:
xpack.reporting.capture.networkPolicy.rules: [
   { allow: true, protocol: 'http:' },
   { allow: false, host: via.placeholder.com },
   { allow: true, protocol: 'https:' },
   { allow: false },
]
  1. Create a Canvas workpad (this is just easy to embed an image), which embeds an image to via.placeholder.com:
image 
  dataurl="https://via.placeholder.com/728x90.png?text=test+external+image" mode="contain"
| render
  1. Generate PDF Report of this workpad via the "Share" button:
    image

The report will correctly fail, due to the network policy violation. However, when running in dev mode, this causes the Kibana server to crash, because the error thrown by the code above is not handled by the calling code.

I would expect this error to be caught and logged, rather than being uncaught and relying on the Kibana runtime to handle this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions