Description
After deleting a service from ArcGIS Online, publishing a new service with the same name as the deleted service fails with the following error:
Error:
ERROR 001398: Service name <service_name> already exists.
Cause
The error occurs when attempting to publish a service with the same partial name of an existing service.
Solution or Workaround
To publish the service, export the service definition file from ArcMap and add as an item to ArcGIS Online. The instructions provided describe how to publish a new service with the same partial name as an existing service.
- In ArcMap, click File > Share As > Service.
- Select the Save a service definition file option, and click Next.
- Select the Choose a connection option, and select an existing connection from the drop-down list.
- Enter a service name, and click Next.
- Select a location to save the service definition file, and click Continue. The Service Editor dialog box appears.
- Set the service definition properties, and click Analyze. Warnings and error messages are displayed in the Prepare window.
- Fix any errors in the Prepare window, and click Stage. For more information on creating and saving a service definition file, refer to Create a service definition in ArcMap.
- Sign in to ArcGIS Online.
- Navigate to My Content > Add Item > From my computer to add the service definition file.
- Select the service definition file, check Publish this file as a layer, and add tags to describe the file.
- Click Add Item, and the added file appears in My Content.