Answer
Several situations can result in the Spatial Analyst Extract by Mask tool returing Error 999999. Among the most common reasons why the tool might return this error message are:
- The input data is from a map service, not a feature service or image service. A map service can contain multiple layers of different data types. and the Extract by Mask tool is unable to pick apart the specific raster that is the target of the tool.
- There may not be enough space in the output location for the output raster to be written.
- The tool may be pointing the output data to a folder, which will write an ArcInfo GRID by default. A GRID cannot be written to a location with a space in the path name. More reliable results will be obtained writing the output to a file geodabase raster.
- The user experiencing the error may not have write permission to the selected output location.
- Using the tool against an image service that may have export limits.
Error 999999 may be returned for other reasons, but these are the most common.