Area: UI Issues
Sub-Area: File Upload / Links (Institutional Memory)
Applies to: OSS + Cloud
Issue
You open Add Link on an asset (for example a Domain or a Data Product), choose the Upload tab, and upload a file such as a PDF. The upload finishes, but saving the link fails with one of these errors:
Failed to add link: Illegal character in path at index N: /openapi/v1/files/product_assets/<id>__My File Name.pdfFailed to add link: Failed to change institutional memory for resource urn:li:<entity-type>:<entity-id>. URL scheme 'null' is not allowed.
The first error shows when the file name has spaces. If you rename the file to remove the spaces and upload it again, you get the second error instead.
You Might Be Asking
- Why does adding an uploaded PDF as a link fail when the file name has spaces?
- Why does it still fail after I remove the spaces from the file name?
- What does "URL scheme 'null' is not allowed" mean?
- Which version fixes this, and what can I do until I upgrade?
Cause
This is a bug in the DataHub web app. The file upload itself works. The problem is the link value that the app builds after the upload.
In affected versions, the app saved the uploaded file as a relative path, /openapi/v1/files/product_assets/<id>__<file name>, and did not URL encode the file name.
When you save the link, the server checks the URL:
- A space in the file name is not a legal URL character, so the check fails with "Illegal character in path".
- Without spaces, the path is valid but has no scheme (no
https://). The server only accepts links with thehttp,https,ftpormailtoscheme, so the check fails with "URL scheme 'null' is not allowed".
The server check is correct and stays in place. The fix is in the web app.
Solution
Upgrade to a release that has the fix:
- DataHub Cloud v2.3.0 or later
- DataHub OSS v1.8.0 or later
From these versions on, the app URL encodes the file name and saves the full address of your DataHub instance (for example https://your-instance.example.com/openapi/v1/files/product_assets/...). File names with spaces work, and the link passes the scheme check. After you upgrade, upload the file again from Add Link > Upload.
Workaround for older versions
Renaming the file does not help, because the relative path still has no scheme. Use a link to an external copy instead:
- Put the document on a file host your users can reach, such as SharePoint, Confluence or Google Drive.
- Copy its full URL. It must start with
https://orhttp://. - In DataHub, open the asset, select Add Link, and choose the URL tab.
- Paste the URL, enter a label, and save.
Example URLs that pass the check:
https://drive.google.com/file/d/<your-file-id>/view
https://your-confluence.example.com/wiki/spaces/<space>/pages/<page-id>
https://sharepoint.example.com/sites/<site>/Shared%20Documents/<document-name>.pdf
Encode any spaces in the URL as %20, as in the SharePoint example.