Based on forum activity, it looks like this is a very common error with many causes and essentially no clues logged as to what really caused it. By trial and error I was able to find the cause. This is the culprit:
arcpy.env.workspace = arcpy.env.scratchWorkspace
Once I removed it (it wasn't really needed as it turns out) the publish worked. It sure seems like ESRI could do a better job logging exactly what triggers errors like this. I spend untold hours trying to comply with the directions in the help page (none of which helped) and crawling through forums and documentation looking for a clue. The good news is that the fix was easy...
Solved! Go to Solution.
Closing
Closing