Problem: Publishing a geoprocessing service from a Python script fails and returns error 00178


Attempts to publish a geoprocessing service from a Python script fails, returning the generic error code 00178 on a Python analyzer (such as IDLE or PythonWin). This error indicates that the script is using a system file, even when it is not.


This issue occurs when there are multiple folders registered as data source locations. For instance, a Python script and an ArcMap layout template file are located in separate folders, and registered individually as data sources.

Image of seperate root folders

For more information on error 00178, please refer to ArcGIS Help: 00178: Data: <value>; used by <value> cannot be copied to the server.

Solution or Workaround

Do not register multiple folders as the data source locations utilized by the Python script. Additionally, avoid registering folders containing system files as data source locations.

  1. Unregister all registered data source locations used by the script.
  2. Place all relevant and required files in a single folder (and sub-folders, if necessary).
  3. Register the root folder as the data source location. For example:

    Image of single location root folder
When registering a data source location, select the absolute path type if the script changes ownership frequently.

If a file is shared over a network, ensure the data source location is defined using the UNC path type.

For more information, please refer to ArcGIS Help: Paths explained: Absolute, relative, UNC, and URL.

Related Information