Search code examples
jenkinsunicodejenkins-pluginsperforceperforce-client-spec

Jenkins P4 Plugin: p4sync failing to sync Unicode files


I'm having trouble with using p4sync in a Jenkins build system.

Specifically, our P4 server is unicode-enabled. This is all fine and good, and when I call p4sync in my Jenkinsfile, I make sure to specify that the server is, in fact, a utf8 (UTF-8 No BOM) server. However, when I actually sync, the sync appears to hitch when syncing files that are marked as type unicode in the depot, causing the sync (and build) to fail with the extremely unhelpful error message ERROR: P4: Task Exception: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s): Unknown client error. This issue only occurs when syncing through the Jenkins p4plugin, as well; I cannot replicate this behavior when syncing through the p4 CLI nor P4V.

I can manually go into the depot and change the filetype from unicode to utf8 and that appears to fix the issue, but I would prefer not to have to manually resolve this issue in the depot whenever it comes up, or whenever someone happens to submit a unicode-enabled file with the wrong encoding.


Solution

  • What we ended up doing to resolve this was manually convert all files marked unicode in the depot to utf8, then set up a Perforce submission trigger to disallow submission of changelists containing files marked unicode. Thus, the depot is never in a state whereby the p4sync step fails.