Solved! Go to Solution.
For anybody getting the same message, make sure that you are publishing to a federated ArcGIS Server with Portal when you use the option Share >> Web Layer >> Publish Web Layer. One of our customers got this message when he tried to publish a service this way to Portal that is not federated with any Servers. Just use workflow for publishing to stand-alone ArcGIS Server.