Error: Service contains unsafe html content - [Description]
Creating a New Hosted Feature Layer from My Content using the option for From URL fails and results in the following error. This error is typically seen when entering the URL of a feature service that has been published from ArcGIS Pro.
Error: Service contains unsafe html content - [Description].
This error occurs if text has been entered in the Description field of the Metadata tab within the Map or Layer properties in ArcGIS Pro when the feature service is published to ArcGIS Online. During the publishing process, inline HTML elements are added to the Description text and stored in the JSON of the feature service. This syntax can be seen through the JSON view of the REST endpoint, after the service has been published. This example below shows how the Description is altered during the publishing process:
\u003cDIV STYLE=\"text-align:Left;font-size:12pt\"\u003e\u003cDIV\u003e\u003cDIV\u003e\u003cP\u003e\u003cSPAN\Description of the feature service...\
Note: To view the REST endpoint of a service in JSON format, browse to the REST endpoint and click 'JSON' at the top of the page.The following workflows for publishing from ArcGIS Pro show this error:
- The Map is published as a Web Layer and there is text in the Description of the Map.
- The Layer is published as a Web Layer and there is text in the Description of the Layer.
This is a known issue. The irregular HTML formatting is not recognized as valid JSON content and therefore is considered unsafe. As a result, the error message displays when ArcGIS Online attempts to publish the feature service.
Solution or Workaround
As a workaround, remove the text from the Description field in ArcGIS Pro before publishing the map or layer to ArcGIS Online. Instead, add the Description in the Item Details page of the published service in ArcGIS Online.
To access the Description in ArcGIS Pro, right-click the map or layer in the Contents pane, and select Properties. When the Layer Properties window displays, select Metadata.
- ArcGIS Pro: View and edit metadata
- ArcGIS Pro: Web feature layer
- ArcGIS Online: Publish an empty hosted feature layer
- GeoNet: Error: Service contains unsafe html content - [Description].