Opensearch Dashboards Branding was not found or invalid

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Server OS: Ubuntu-20-04
Browser: Chrome
Dashboard Version: 2.5.0

Running inside of a K8S cluster.

Describe the issue:
I am trying to use custom branding in Opensearch Dashboards, but whenever I access the UI, I am met with the following error in the logs:

As per the documentation I have created a very small webserver pod called opensearch-logos in my Kubernetes that exposes an image in its endpoint.

Configuration:

The following is my values.yaml file for opensearch-dashboards helm chart which has an embedded opensearch-dashboards.yaml file.

image:
  repository: opensearch-dashboards
  pullPolicy: Never
  tag: latest

opensearch:
  username: admin
  password: admin
  client_secret: ""
  openid_connect_url: ""
  url: ""


config:
  opensearch_dashboards.yml: |
    opensearch.hosts: [http://opensearch-master-cluster:9200]
    opensearch.ssl.verificationMode: none
    opensearch.username: {{ .Values.opensearch.username }}
    opensearch.password: {{ .Values.opensearch.password }}
    opensearch.requestHeadersWhitelist: [Authorization, securitytenant]
    
    server.ssl.enabled: false

    opensearch_security.openid.base_redirect_url: "https://{{ .Values.opensearch.url }}/os/"
    opensearch_security.auth.type: "openid"
    opensearch_security.openid.connect_url: "https://{{ .Values.opensearch.openid_connect_url }}/realms/opensearch/.well-known/openid-configuration"
    opensearch_security.openid.client_id: "opensearch"
    opensearch_security.openid.client_secret: {{ .Values.opensearch.client_secret }}
    opensearch_security.openid.scope: openid profile email
    opensearch_security.openid.header: "Authorization"

    opensearch_security.multitenancy.enable_filter: false
    opensearch_security.multitenancy.enabled: true
    opensearch_security.multitenancy.tenants.enable_global: true
    opensearch_security.multitenancy.tenants.enable_private: true

    opensearch_security.multitenancy.tenants.preferred: [Private, Global]
    opensearch_security.readonly_mode.roles: [kibana_read_only]

    opensearch_security.cookie.secure: true

    server.basePath: '/os'
    server.rewriteBasePath: false
    server.host: "https://{{ .Values.opensearch.url }}/os/"
  

    opensearchDashboards.branding:
      logo:
        defaultUrl: "opensearch-logos:5000/kmd"
        darkModeUrl: "opensearch-logos:5000/kmd"
      mark:
        defaultUrl: "opensearch-logos:5000/kmd"
        darkModeUrl: "opensearch-logos:5000/kmd"
      loadingLogo:
        defaultUrl: "opensearch-logos:5000/kmd"
        darkModeUrl: "opensearch-logos:5000/kmd"
      faviconUrl: "opensearch-logos:5000/kmd"
      applicationTitle: "Audit"
majorVersion: latest

I have also tried to use the file protocol with the png image mounted directly in opensearch-dashboards with the following addition to my values.yaml file:


extraVolumes:
  - name: logos
    configMap: 
      name: opensearch-logos-configmap

extraVolumeMounts:
  - name: logos
    mountPath: /usr/share/opensearch-dashboards/assets
apiVersion: v1
binaryData:
  kmd.png: A Lot of Data
kind: ConfigMap
metadata:
  name: opensearch-logos-configmap

and then replacing the urls with:

file:///usr/share/opensearch-dashboards/assets/kmd.png

But it results in the same error. I even tried using the url http://localhost:5601/ui/assets/kmd.png, but am once again met with the same error. (Accessing this URL in the Chrome produces the png as expected without any issues).

Any help would be appreciated.

So the issue is that I had to use the FQDN of my loadbalancer. So in my case I needed to use https://DOMAIN-NAME/os/ui/assets/kmd.png.

1 Like