James Sutherland
James Sutherland

Reputation: 3883

Perforce "Translation of file content failed" error

I'm trying to add a fairly large number of files to a Perforce depot. On submit, I get the following error, which I think means it's having trouble working out the file type for one of the files:

How do I get more information about this, specifically which file it's actually having trouble with? The error isn't entirely helpful when it comes to fixing the problem.

Upvotes: 7

Views: 8518

Answers (3)

Wen
Wen

Reputation: 1220

My situation was a little bit different from amir's but the solution worked. Sadly I didn't know which keyword to search in the opened file, so I eyeballed the output of "p4 submit" on console and found a c-file was opened as "unicode". After reopening the file as "text" I successfully submitted my changelist.

Next time I will try the filetype listed in p4 manual before eyeball the output, here is the list: Base filetypes

Upvotes: 1

amir
amir

Reputation: 11

I just had this issue. And yes, it is due to a file type problem. But if you have hundreds of thousands of files, it is not easy to find the offending files. "p4 opened -c pendingchangelist#" lists files (along with their file types) that are open in a pending changelist. Pipe the output to a text file. On some servers, for example, utf16 is not supported. search for 'utf16' and retype them to binary (again, for example). You can move the offending files from the pending changelist to a different pending changelist and retype the files all in one shot with "p4 reopen".Now you can resubmit the original pending changelist and next, submit the new pending changelist with file types corrected.

Upvotes: 1

James Sutherland
James Sutherland

Reputation: 3883

Typically, I found the answer 5 minutes after posting. Turns out the file log from p4v shows more information than the log window. Turn on file logging, and the log file will show you where the problem is.

Upvotes: 7

Related Questions