Area: UI Issues
Sub-Area: Platform Logo Rendering / Browser Security Restrictions
Applies to: OSS + Cloud
Issue
You set a custom logoUrl in the dataPlatformInfo aspect of a data platform. The logo shows in Safari but not in Chrome. The image lives on an internal network host, such as an internal GitHub instance or an internal image service.
The DataHub UI doesn't proxy or cache platform logos. It puts the logoUrl value straight into an <img> element, so your browser fetches the image itself. Every browser network rule applies to that fetch.
You Might Be Asking
- Why do my platform logos show in Safari but not in Chrome?
- Can I keep logo images on an internal server?
- How do I change
logoUrlon a platform without breaking it?
Cause
Chrome's Local Network Access checks cover requests from a page on the public internet to a host on a private network address or on the user's own machine. This includes subresources such as images. Chrome asks the user for permission before it makes such a request. If the user denies it, the request fails. When your DataHub page loads from a public address and the logo lives on an internal host, the logo request falls under these checks. Local Network Access is a Chrome feature, so the same logo can still render in Safari.
To confirm, open Chrome DevTools on a DataHub page that shows the platform. Look in the Console and Network tabs for a blocked request to the logo URL. If the same URL renders when you open it directly in a Chrome tab but fails inside DataHub, the cross-origin request from DataHub is what's blocked, not the logoUrl value.
Solution
Pick one of these options. Options 1 and 3 work for DataHub Cloud and self-hosted DataHub. Option 2 works only for self-hosted DataHub.
Option 1: Store the logo as a data URL
A data URL puts the image bytes in the logoUrl string itself, so the browser makes no network request. DataHub stores logoUrl as a plain string, so it accepts a data URL. Keep the image small, such as a small PNG or SVG icon, because DataHub stores and returns the full string with the platform.
This script reads the current dataPlatformInfo aspect, changes only logoUrl, and writes it back. Emitting the aspect replaces the whole aspect, so reading it first keeps the other fields. type and datasetNameDelimiter are required fields, and name can be at most 15 characters, so the script fills them in only if the platform has no dataPlatformInfo yet.
import base64
from datahub.emitter.mce_builder import make_data_platform_urn
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.ingestion.graph.client import DataHubGraph
from datahub.ingestion.graph.config import DatahubClientConfig
from datahub.metadata.schema_classes import DataPlatformInfoClass, PlatformTypeClass
graph = DataHubGraph(
DatahubClientConfig(server="<your-gms-url>", token="<your-access-token>")
)
platform_urn = make_data_platform_urn("<platform-name>")
with open("mylogo.png", "rb") as f:
encoded = base64.b64encode(f.read()).decode("utf-8")
logo_url = f"data:image/png;base64,{encoded}"
info = graph.get_aspect(platform_urn, DataPlatformInfoClass)
if info is None:
info = DataPlatformInfoClass(
name="<platform-name>",
displayName="<Platform Display Name>",
type=PlatformTypeClass.OTHERS,
datasetNameDelimiter=".",
)
info.logoUrl = logo_url
graph.emit_mcp(MetadataChangeProposalWrapper(entityUrn=platform_urn, aspect=info))
Use data:image/svg+xml;base64, instead of data:image/png;base64, for an SVG file. For more on the Python SDK, see Python Emitter.
Option 2: Serve logos from the DataHub host (self-hosted only)
If you run DataHub yourself and control the reverse proxy in front of the DataHub frontend, add a path on that proxy that serves your logo files. Then set logoUrl to that same host, for example https://<your-datahub-host>/custom-logos/<platform-name>.png. The browser loads the logo from the same origin as the DataHub page, so no cross-origin request leaves the page.
Use a path of your own. The frontend's built-in /assets/platforms/ logos ship inside the frontend image, so you can't add files there without rebuilding it. DataHub Cloud customers can't add paths to the DataHub host; use Option 1 or Option 3.
Set the value with the same script as Option 1, with logo_url = "https://<your-datahub-host>/custom-logos/<platform-name>.png".
Option 3: Host logos on a public bucket or CDN
Upload the logos to a public location, such as an S3, Google Cloud Storage or Azure Blob Storage bucket, or a CDN. A public host isn't on your private network, so Chrome doesn't apply Local Network Access checks to it.
Allow your DataHub origin in the bucket's CORS rules. Some DataHub views request the logo in CORS mode (crossOrigin="anonymous") first, and fall back to a plain request only when that fails. Example S3 CORS configuration:
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET"],
"AllowedOrigins": ["https://<your-datahub-host>"],
"ExposeHeaders": []
}
]
Then set logoUrl to the public URL of each image with the script from Option 1.
Notes
- The image request carries no DataHub credentials. If your image host needs a login or a token, the logo won't load from it. Use Option 1, 2 or 3.
- DataHub has no GraphQL mutation or UI setting for a platform's
logoUrl. You change it by writing thedataPlatformInfoaspect. - The UI picks up the new
logoUrlthe next time it loads the platform. Refresh the page after you emit the change.