Unable to create report definition when using IPv6 network

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.14.0

Describe the issue: Error is thrown when attempting to create report definition when on IPv6 network. We see this in the logs:

{
   "type":"log",
   "@timestamp":"2024-10-01T10:33:12Z",
   "tags":[
      "error",
      "plugins",
      "reportsDashboards"
   ],
   "pid":1,
   "message":"Failed input validation for create report definition ValidationError: [report_params.core_params.origin]: value must be a valid URI (see RFC 3986)."
}

I am not sure what this error is refering to as when I investigate the request in the browser, I dont see an “report_params.core_params.origin” field

{
   "report_params":{
      "report_name":"test1",
      "report_source":"Saved search",
      "description":"",
      "core_params":{
         "base_url":"/app/discover#/view/27895720-8f5f-11ec-b2f5-09d48915cf9c",
         "report_format":"csv",
         "time_duration":"PT30M",
         "saved_search_id":"27895720-8f5f-11ec-b2f5-09d48915cf9c",
         "limit":10000,
         "excel":true
      }
   },
   "delivery":{
      "configIds":[
         
      ],
      "title":"",
      "textDescription":"",
      "htmlDescription":""
   },
   "trigger":{
      "trigger_type":"On demand"
   }
}

The response in the logs seems to have correct formatted IPv6 addresses:

{
   "type":"response",
   "@timestamp":"2024-10-01T10:33:12Z",
   "tags":[
      
   ],
   "pid":1,
   "method":"post",
   "statusCode":400,
   "req":{
      "url":"/api/reporting/reportDefinition",
      "method":"post",
      "headers":{
         "host":"[330b:c0e0:101:5459:6936:2:1e0b:20d]",
         "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0",
         "accept":"*/*",
         "accept-language":"en-US,en;q=0.5",
         "accept-encoding":"gzip, deflate, br, zstd",
         "referer":"https://[330b:c0e0:101:5459:6936:2:1e0b:20d]/app/reports-dashboards",
         "content-type":"application/json",
         "osd-version":"2.14.0",
         "osd-xsrf":"osd-fetch",
         "content-length":"368",
         "origin":"https://[330b:c0e0:101:5459:6936:2:1e0b:20d]",
         "connection":"keep-alive",
         "sec-fetch-dest":"empty",
         "sec-fetch-mode":"cors",
         "sec-fetch-site":"same-origin",
         "priority":"u=0"
      },
      "remoteAddress":"330b:c0e0:101:5ec9:b433:2:c:0",
      "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0",
      "referer":"https://[330b:c0e0:101:5459:6936:2:1e0b:20d]/app/reports-dashboards"
   },
   "res":{
      "statusCode":400,
      "responseTime":5,
      "contentLength":9
   },
   "message":"POST /api/reporting/reportDefinition 400 5ms - 9.0B"
}

This seems like a defect but wanted to reach out here first to see if there was any consideration we might have missed. Generating report definition works fine in IPv4 network.

Configuration:
In opensearch_dashboards.yml, we have server.host defined as “::” to accept all IPv6 addresses

UPDATE 10/7/24
I have updated this slightly as the issue is actually with generating a report definition and not necessarilty when attempting to download the report.

Relevant Logs or Screenshots:

Hi @jpelletier_2023 ,

Have you tried adding server.host 0.0.0.0 ? Can you share please your opensearch_dashboards.yml ? Do you generate a report using CLI or OpenSearch Dashboards ?

We are using OpenSearch Dashboards GUI to attempt this. This is an IPv6 network so defining server.host as “0.0.0.0” wont work right? That IP is for IPv4 networks. Here is opensearch_dashboards.yml:

opensearch:
  hosts:
  -  https://app-service.svc.cluster.local:9200

  username: "user"
  password: "password"

  ssl:
    certificateAuthorities: [ "/secure/App/oauth-ca/oauth-ca.crt" ]
    
  requestHeadersAllowlist:
  - Authorization
  - securitytenant
  # Including old header name for backwards compatability
  - security_tenant

server:
  host: "::"

  ssl:
    enabled: true
    certificate: /secure/App/cert/cert
    key: /secure/App/cert/key

opensearch_security:
  auth:
    type: openid
  cookie:
    secure: true
    password: "secret"

  openid:
    connect_url: "https://oauth-service.svc.cluster.local/realms/App/.well-known/openid-configuration/"
    client_secret: "secret"
    client_id: "telemetry"
    root_ca: /secure/App/oauth-ca/oauth-ca.crt
    base_redirect_url: https://[330b:c0e0:101:5459:6936:2:1e0b:020d]/

  readonly_mode:
    roles:
    - kibana_read_only

  multitenancy:
    enabled: false

# Increase autocomplete timeout and terminate after so controls visualizations
# are as complete as possible
opensearchDashboards:
  autocompleteTimeout: 100000
  autocompleteTerminateAfter: 10000000
  branding:
    logo:
      defaultUrl: "https://[330b:c0e0:101:5459:6936:2:1e0b:020d]/ui/favicons/solidBackgroundLogo.png"
    mark:
      defaultUrl: "https://[330b:c0e0:101:5459:6936:2:1e0b:020d]/ui/favicons/transparentBackgroundLogo.png"
    loadingLogo:
      defaultUrl: "https://[330b:c0e0:101:5459:6936:2:1e0b:020d]/ui/favicons/transparentBackgroundLogo.png"
    faviconUrl: "https://[330b:c0e0:101:5459:6936:2:1e0b:020d]/ui/favicons/transparentBackgroundLogo.png"
    applicationTitle: "Application Telemetry"

Hi @jpelletier_2023,

I received the same error message in my lab for both version 2.14 and the latest version. To report this bug, please create an issue on GitHub:

@Eugene7 Yes I opened an issue here Unable to create report definition when using IPv6 network · Issue #1042 · opensearch-project/reporting · GitHub