Bug #5538

internal server error (UnicodeDecodeError) during rhodecode-index request

Added by lee loucks over 3 years ago. Updated over 3 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Commit Number:
Affected Version:


When attempting to request a rhodecode-index an Internal server error is reported. There is no exception logged in the Exceptions Tracker but in the community-1.log

2019-02-20 05:45:37.976 [10647] ERROR [rhodecode.api] Unhandled exception occurred on api call: <function get_repos at 0x7fef6f506c08>
Traceback (most recent call last):
  File "/opt/rhodecode/store/vn3vc3y4l7a19yriazpwpmnas8iijqcw-python2.7-rhodecode-enterprise-ce-4.15.1/lib/python2.7/site-packages/rhodecode/api/", line 290, in request_view
    return jsonrpc_response(request, ret_value)
  File "/opt/rhodecode/store/vn3vc3y4l7a19yriazpwpmnas8iijqcw-python2.7-rhodecode-enterprise-ce-4.15.1/lib/python2.7/site-packages/rhodecode/api/", line 114, in jsonrpc_response
    raw_body = render(DEFAULT_RENDERER, ret_value, request=request)
  File "/opt/rhodecode/store/9xq7fihpsz8cgkwyx6savnarbhsjhqz5-python2.7-simplejson-3.11.1/lib/python2.7/site-packages/simplejson/", line 602, in _iterencode_dict
    yield _encoder(value)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xef in position 0: invalid continuation byte

adding a "* = 1" to the EXCLUDE section of the search_mapping.ini and only including one repo in the INCLUDE section but the same behavior.


Exception_140666329137872.txt (0 Bytes) Exception_140666329137872.txt lee loucks, 20.02.2019 14:25
Exception_140666329137872.txt (6.15 KB) Exception_140666329137872.txt lee loucks, 20.02.2019 14:36

Updated by lee loucks over 3 years ago

Seems simliar to #4195


Updated by lee loucks over 3 years ago

Same error during a

rhodecode-api --instance-name=community-1 get_repos



Updated by lee loucks over 3 years ago

using a shell script iterating through rhodecode-api get_repo repoid:xyz calls I identified a repo that seems to have an issue. Browsing to it via the web interface results in the attached exception being tracked captured in the Exceptions Tracker


Updated by Marcin Kuzminski [CTO] over 3 years ago

the attachment has 0 bytes, can you post it again?

Also similarly to #4195 can you identify non-ascii characters stored in this repository ?


Updated by lee loucks over 3 years ago

Something was wrong with the data in the RC db. I moved the offending repo out of the repository directory and requested a rescan with destroy old data selected. RC reported that it removed said repo as expected. I moved the formerly offending repo back into the repository directory, rescanned and get_repos and rhodecode-index runs successfully now.


Updated by Marcin Kuzminski [CTO] over 3 years ago

Based on the exception this error was caused by encryption problem. The clone_url are encrypted using a key stored in rhodecode.ini if that key changes sometimes decrypted data cannot be read properly. This could be caused by migration from old instance for example.

The encryption key used defaults to beaker.session.secret if
rhodecode.encrypted_values.secret = is not set.


Updated by lee loucks over 3 years ago

Thanks Marcin, you can close this ticket.

Also available in: Atom PDF