Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • Locking 16380 files ...
  • Translation of file content failed near line 1
  • Submit aborted -- fix problems then use 'p4 submit -c 5851'.
  • Some file(s) could not be transferred from client.

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.

like image 226
James Sutherland Avatar asked May 20 '09 09:05

James Sutherland


3 Answers

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.

like image 83
James Sutherland Avatar answered Sep 24 '22 08:09

James Sutherland


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.

like image 42
amir Avatar answered Sep 26 '22 08:09

amir


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

like image 45
Wen Avatar answered Sep 25 '22 08:09

Wen