751: Long file path results in error: Data truncated for column 'source_file' at row 1

ciao****@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Sept. 15, 2009
Creating a Review Request for a source file with a long file path results 
in error.

What's the URL of the page containing the problem?
JSON API for creating a new reviewrequest.
https://reviewboard/api/json/reviewrequests/2016/diff/new/

What steps will reproduce the problem?
1. Edit or Add a source file with a really long path:
$> p4 add foo.test
//depot/project/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/this_is_one_really_
long_directory_in_which_im_using_to_try_and_reproduce_a_reviewboard_memcach
e_bug/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/this_is_one_really_long_d
irectory_in_which_im_using_to_try_and_reproduce_a_reviewboard_memcache_bug/
foo/foo/foo/foo/foo.test#1 - opened for add

2. Now submit the file to reviewboard using JSON api (ie post-review or 
whatever tool you are using.)

You get this error:

Error: server request failed...
        uri=https://reviewboard/api/json/reviewrequests/2016/diff/new/
        stat=fail
        code=105
        msg=One or more fields had errors
Full server response:
{
  "fields" : {
    "path" : [
      "Data truncated for column 'source_file' at row 1"
    ]
  },
  "err" : {
    "msg" : "One or more fields had errors",
    "code" : 105
  },
  "stat" : "fail"
}



What is the expected output? What do you see instead?
ReviewBoard should be able to handle cases with really long paths. I do 
not know what the exact limit is, but we are reaching it. 

I found this problem trying to repro another issue with the memcache 
throwing and error that the cache key is too big (> 250 in length). i 
suspect that too is related to either the path or filename being too long 
for reviewboard/django/memcache to handle (I will post that bug once i 
track down further.)  

What operating system are you using? What browser?
CentOS 5.2

Please provide any additional information below.
#1 mats*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Any update on this one?
I'm currently running into this limitation with very long clearcase filenames.
Any workaround?
chipx86
#2 chipx86
We can bump up the max size of the field for 1.0.1. However, we have to be sane about
the lengths. I don't know that a size like what you showed here is reasonable. What's
the max size you're really dealing with?
  • +Confirmed
  • +Milestone-Release1.0.x
#3 mats*****@gmai***** (Google Code) (Is this you? Claim this profile.)
For clearcase the version is implicitly coded in the file name.
Currently the longest path I have seen is 161 characters. But I'm sure we have files
with names/version longer than 200 characters.

Is there anything I could change in my installation to try it out?
#4 ciao****@gmai***** (Google Code) (Is this you? Claim this profile.)
It's hard to guesstimate an upper limit for us as well - we also have version strings
being implicitly added. This isn't something we run into a lot.
 
I think it would help if the error returned was more clear so that general users can
understand. Something like "Error - reviewboard can only handle files of maximum 1024
characters." Also this limit could be put in the documentation or release notes.  
chipx86
#5 chipx86
Certainly. It's worth bumping the limit anyway, though.
  • +Component-Docs
chipx86
#6 chipx86
  • -Confirmed
    +Started
  • +chipx86
chipx86
#7 chipx86
Bumped the limit up to 1024.

Fixed on release-1.0.x in r324dc29
  • -Started
    +Fixed
  • -Component-Docs
    +Component-DiffViewer