I was getting the same error and none of the above answers worked for me. I referenced This blog and copied my provisioning profiles from the ~/Library/MobileDevice/Provisioning Profiles/ directory to the /Library/Server/Xcode/Data/ProvisioningProfiles directory and I still got the same error.
So I opened Xcode and synchronized my profiles with the provisioning portal. If you are unfamiliar, go to Preferences -> Accounts -> , highlight the developer team and click "View Details". Then highlight the distribution code signing identity in "Signing Identities" and click on the refresh button in the bottom left corner. I did this from the server, however, I'm sure you could refresh your provisioning profiles on your development mac and then copy them to the server.
This process refreshes the provisioning profiles in the ~/Library/MobileDevice/Provisioning Profiles/ directory. I then reattempted the copy process to /Library/Server/Xcode/Data/ProvisioningProfiles from ~/Library/MobileDevice/Provisioning Profiles/ and the Xcode bot successfully found the provisioning profile during the next integration.
As a note, I tried signing out of the Xcode service's developer team and signing back in and that peculiarly did not work for me. Theoretically that should accomplish the same thing.
Like others have mentioned, I would copy all of the profiles rather than finding only the Ad Hoc profile you are looking for. The reason is that maybe, like in my case, the Xcode bot was attempting to archive with the development profile and "Development Profile" is much easier to debug than "4F96F173-7EBE-4892-B283-52489DE2F409".
If this still does not work, I suggest following the link above and go through the certificate process; you take the certificate from your developer computer and copy it into the system folder of the Keychain Access application on your server.
Just to add a note since this also gave me a big headache, the simulator for Xcode bots may be located at /var/_xcstest/Library/Application Support/iPhone Simulator/. That is where I found it on our server but I doubt it would be different for others. I had to find it because the Localizable.strings file was not being updated in the simulator and tests were failing. Hope this helps.