2705: Unable to attach a file or attach screen shots to a new review request

sakthik*******@vvdnte****** (Google Code) (Is this you? Claim this profile.)
Dec. 24, 2012
What version are you running?
1.6.11

What's the URL of the page containing the problem?
http://192.168.10.10/reviewboard/api/review-requests/43/file-attachments/
and
http://192.168.10.10/reviewboard/api/review-requests/43/screenshots/

What steps will reproduce the problem?
1.Create a new review request
2.Attach a file / screen shot
3.Click upload (nothing happens)
4.Click upload again, an error message occurs

What is the expected output? What do you see instead?
Expected to attach the file.
Error message seen:
Something broke! (Error 500)

It appears something broke when you tried to go to here. This is either a bug in Review Board or a server configuration error. Please report this to your administrator.

What operating system are you using? What browser?
Ubuntu, Chrome

Please provide any additional information below.
Its more of a query than info.
If we are adding a new file to SVN repo, how should the review request be created?
david
#1 david
I know it's been a while since you filed this, but if it's still reproduceable, can you check the logs to find out what error is causing that 500 response?
  • +NeedInfo
david
#2 david
  • -NeedInfo
    +Incomplete
#3 sakthik*******@vvdnte****** (Google Code) (Is this you? Claim this profile.)
The following is the mail I get from the server in which reviewboard is installed.

Subject: [Review Board] ERROR (EXTERNAL IP): Internal Server Error:
 /reviewboard/api/review-requests/213/file-attachments/

Traceback (most recent call last):

  File "/usr/lib/python2.5/site-packages/Django-1.4.1-py2.5.egg/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib/python2.5/site-packages/Django-1.4.1-py2.5.egg/django/views/decorators/cache.py", line 89, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/usr/lib/python2.5/site-packages/Django-1.4.1-py2.5.egg/django/views/decorators/vary.py", line 19, in inner_func
    response = func(*args, **kwargs)

  File "/usr/lib/python2.5/site-packages/Djblets-0.6.22-py2.5.egg/djblets/webapi/resources.py", line 397, in __call__
    result = view(request, api_format=api_format, *args, **kwargs)

  File "/usr/lib/python2.5/site-packages/Djblets-0.6.22-py2.5.egg/djblets/webapi/resources.py", line 581, in post
    return self.create(*args, **kwargs)

  File "/usr/lib/python2.5/site-packages/Djblets-0.6.22-py2.5.egg/djblets/util/decorators.py", line 75, in _call
    f = augmented_func(*args, **kwargs)

  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.6.11-py2.5.egg/reviewboard/webapi/decorators.py", line 127, in _check
    return view_func(*args, **kwargs)

  File "/usr/lib/python2.5/site-packages/Djblets-0.6.22-py2.5.egg/djblets/webapi/decorators.py", line 88, in _checklogin
    return view_func(*args, **kwargs)

  File "/usr/lib/python2.5/site-packages/Djblets-0.6.22-py2.5.egg/djblets/webapi/decorators.py", line 62, in _call
    return view_func(*args, **kwargs)

  File "/usr/lib/python2.5/site-packages/Djblets-0.6.22-py2.5.egg/djblets/webapi/decorators.py", line 231, in _validate
    return view_func(*args, **new_kwargs)

  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.6.11-py2.5.egg/reviewboard/webapi/resources.py", line 3239, in create
    file = form.create(request.FILES['path'], review_request)

  File "/usr/lib/python2.5/site-packages/ReviewBoard-1.6.11-py2.5.egg/reviewboard/attachments/forms.py", line 23, in create
    file_attachment.file.save(file.name, file, save=True)

  File "/usr/lib/python2.5/site-packages/Django-1.4.1-py2.5.egg/django/db/models/fields/files.py", line 86, in save
    self.name = self.storage.save(name, content)

  File "/usr/lib/python2.5/site-packages/Django-1.4.1-py2.5.egg/django/core/files/storage.py", line 45, in save
    name = self._save(name, content)

  File "/usr/lib/python2.5/site-packages/Django-1.4.1-py2.5.egg/django/core/files/storage.py", line 168, in _save
    os.makedirs(directory)

  File "/usr/lib64/python2.5/os.py", line 165, in makedirs
    makedirs(head, mode)

  File "/usr/lib64/python2.5/os.py", line 165, in makedirs
    makedirs(head, mode)

  File "/usr/lib64/python2.5/os.py", line 165, in makedirs
    makedirs(head, mode)

  File "/usr/lib64/python2.5/os.py", line 172, in makedirs
    mkdir(name, mode)

OSError: [Errno 13] Permission denied: '/var/www/reviewboard/htdocs/media/uploaded/files'


<WSGIRequest
path:/reviewboard/api/review-requests/213/file-attachments/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'caption': [u''], u'api_format': [u'json']}>,
COOKIES:{'rbsessionid': '5d63d223cb46e98d07b6318ba7bfd485'},
META:{'CONTENT_LENGTH': '418589',
 'CONTENT_TYPE': 'multipart/form-data; boundary=---------------------------11596252261189395267962087767',
 'DOCUMENT_ROOT': '/var/www/reviewboard/htdocs',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'rbsessionid=5d63d223cb46e98d07b6318ba7bfd485',
 'HTTP_HOST': '192.168.10.10',
 'HTTP_REFERER': 'http://192.168.10.10/reviewboard/r/213/',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:11.0) Gecko/20100101 Firefox/11.0',
 'PATH': '/sbin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin',
 'PATH_INFO': u'/reviewboard/api/review-requests/213/file-attachments/',
 'PATH_TRANSLATED': '/var/www/reviewboard/htdocs/reviewboard.wsgi/reviewboard/api/review-requests/213/file-attachments/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '192.168.10.61',
 'REMOTE_PORT': '54220',
 'REQUEST_METHOD': 'POST',
 'REQUEST_URI': '/reviewboard/api/review-requests/213/file-attachments/',
 'SCRIPT_FILENAME': '/var/www/reviewboard/htdocs/reviewboard.wsgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '192.168.10.10',
 'SERVER_ADMIN': 'root@localhost',
 'SERVER_NAME': '192.168.10.10',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '<address>Apache/2.2.9 (Fedora) Server at 192.168.10.10 Port 80</address>\n',
 'SERVER_SOFTWARE': 'Apache/2.2.9 (Fedora)',
 'mod_wsgi.application_group': '192.168.10.10|',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.listener_host': '',
 'mod_wsgi.listener_port': '80',
 'mod_wsgi.process_group': '',
 'mod_wsgi.reload_mechanism': '0',
 'mod_wsgi.script_reloading': '1',
 'wsgi.errors': <mod_wsgi.Log object at 0x7f82de2dadb0>,
 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f82de2a2d50>,
 'wsgi.input': <mod_wsgi.Input object at 0x7f82de3d6e70>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>
david
#4 david
Regarding comment #3, You need to make sure the web server has permission to write to the /var/www/reviewboard/htdocs/media/uploaded/files directory. This ought to be showing you an error when you look at any page but I guess the API is different.
#5 sakthik*******@vvdnte****** (Google Code) (Is this you? Claim this profile.)
I've added write permissions to the specified directory. Now everything seems to be working fine.

Thanks,
Sakthi