Description
The tool could not package the data and resources required for the service.
This error can occur if the length of the path used to publish a GIS resource, or the paths for the data being copied to the server, exceeds the operating system limit and you are copying data to the ArcGIS server.
This path includes the path to the staging folder and the name of the server connection. Along with these, there is a path to the GIS resource you are publishing. For example, if you are publishing a map service, this path includes the name of the map service definition (.msd) contained in the service definition. There are also paths to each data source used by the resource. This includes paths used in a functional raster or mosaic dataset.
Solution
The resource you are publishing may contain errors. Open the GIS resource using the appropriate application (for example, if you are working with a map, open it with ArcGIS Pro), analyze the resource, and fix each error.
Tables that participate in a join must be explicitly added to the map document before they can be published.