Log shows empty when I try to modify it

community.log:
File “/opt/rhodecode/store/wrn4w4gzarahd4k877nxa8cz1a5ifz91-python2.7-rhodecode-enterprise-ce-4.17.3/lib/python2.7/site-packages/rhodecode/tweens.py”, line 49, in vcs_detection_tween
return handler(request)
File “/opt/rhodecode/store/wrn4w4gzarahd4k877nxa8cz1a5ifz91-python2.7-rhodecode-enterprise-ce-4.17.3/lib/python2.7/site-packages/rhodecode/lib/middleware/request_wrapper.py”, line 43, in call
response = self.handler(request)
File “/opt/rhodecode/store/p3adn3yl7ni8wg3d1556z2wrqw1mfbxb-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/tweens.py”, line 43, in excview_tween
response = _error_handler(request, exc)
File “/opt/rhodecode/store/p3adn3yl7ni8wg3d1556z2wrqw1mfbxb-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/tweens.py”, line 13, in _error_handler
response = request.invoke_exception_view(exc_info)
File “/opt/rhodecode/store/p3adn3yl7ni8wg3d1556z2wrqw1mfbxb-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/view.py”, line 767, in invoke_exception_view
request_iface=request_iface.combined,
File “/opt/rhodecode/store/p3adn3yl7ni8wg3d1556z2wrqw1mfbxb-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/view.py”, line 667, in _call_view
response = view_callable(context, request)
File “/opt/rhodecode/store/p3adn3yl7ni8wg3d1556z2wrqw1mfbxb-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/config/views.py”, line 169, in call
return view(context, request)
File “/opt/rhodecode/store/p3adn3yl7ni8wg3d1556z2wrqw1mfbxb-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/viewderivers.py”, line 401, in viewresult_to_response
result = view(context, request)
File “/opt/rhodecode/store/p3adn3yl7ni8wg3d1556z2wrqw1mfbxb-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/viewderivers.py”, line 144, in _requestonly_view
response = view(request)
File “/opt/rhodecode/store/wrn4w4gzarahd4k877nxa8cz1a5ifz91-python2.7-rhodecode-enterprise-ce-4.17.3/lib/python2.7/site-packages/rhodecode/config/middleware.py”, line 146, in not_found_view
return wsgiapp(vcs_app)(None, request)
File “/opt/rhodecode/store/p3adn3yl7ni8wg3d1556z2wrqw1mfbxb-python2.7-pyramid-1.10.4/lib/python2.7/site-packages/pyramid/wsgi.py”, line 38, in decorator
return request.get_response(wrapped)
File “/opt/rhodecode/store/p05sclzmx9zbmciggm367lfz8wrmh1h5-python2.7-webob-1.8.5/lib/python2.7/site-packages/webob/request.py”, line 1314, in send
application, catch_exc_info=False)
File “/opt/rhodecode/store/p05sclzmx9zbmciggm367lfz8wrmh1h5-python2.7-webob-1.8.5/lib/python2.7/site-packages/webob/request.py”, line 1281, in call_application
output.extend(app_iter)
File “/opt/rhodecode/store/wrn4w4gzarahd4k877nxa8cz1a5ifz91-python2.7-rhodecode-enterprise-ce-4.17.3/lib/python2.7/site-packages/rhodecode/lib/middleware/simplevcs.py”, line 615, in _generate_vcs_response
response = app(environ, start_response)
File “/opt/rhodecode/store/wrn4w4gzarahd4k877nxa8cz1a5ifz91-python2.7-rhodecode-enterprise-ce-4.17.3/lib/python2.7/site-packages/rhodecode/lib/middleware/simplesvn.py”, line 101, in call
text = ‘\n{}’.format(response.text) if response.text else ‘’
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\xed’ in position 398: ordinal not in range(128)
[04/Sep/2019:18:01:02 +0200] GNCRN <25234> 127.0.0.1 rqt:0.085351 500 3404 "PROPFIND:/TIC/tic_audiovisuales/!svn/rev/7 " usr:admin “-” “SVN/1.12.2 (x64-microsoft-windows) serf/1.3.9 TortoiseSVN-1.12.2.28653”

Is this a problem of python? Mysql? Apache2?
This problem has appeared when I have upgraded Rhodecode from 4.15 to 4.17, this week.
Thanks in advance.

Can you describe what operation are you doing ? It looks like the problem is the non-ascii character in that commit message.

Hi Marcin:
Good morning.
Svn Tortoise client.
When we try to modify an old log.
If the log has only one Word, no problema.
If log has two or more words, it shows an empty window. We can modify the log but we loose the previous log in case you wan to keep it.

Error coomunity.log:
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\ ……… etc.

I send you a video showing an example.
https://we.tl/t-e0zF57vzJL

Thanks for your quick answer, as usual.

Could you open this file and find the

text = '\n{}'.format(response.text) if response.text else ''

and change it to:

from rhodecode.lib.utils2 import safe_str
text = '\n{}'.format(safe_str(response.text)) if response.text else ''

restart RhodeCode and check again ?

Hi Marcin:
I’m sorry but that string doesn’t exist inside the file. I attach you my simplesvn.py.

Thanks again.

Copy&paste problem i fixed the example it should be fine now.

Hi Marcin:
Modify for this :
if response.status_code not in [200, 401]:
text = ‘\n{}’.format(response.text) if response.text else ‘’

to this:
if response.status_code not in [200, 401]:
from rhodecode.lib.format(response.text) if response.text else ‘’
text = ‘\n{}’.format(response.text) if response.text else ‘’

Rhodecode doesn’t start:

and in community.log:
File “/opt/rhodecode/store/wrn4w4gzarahd4k877nxa8cz1a5ifz91-python2.7-rhodecode-enterprise-ce-4.17.3/lib/python2.7/site-packages/rhodecode/lib/middleware/simplesvn.py”, line 101
from rhodecode.lib.format(response.text) if response.text else ‘’
^
SyntaxError: invalid syntax
[2019-09-06 12:33:54 +0000] [1883] [INFO] Worker exiting (pid: 1883)
Traceback (most recent call last):
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/bin/.gunicorn-wrapped”, line 12, in
sys.exit(run())
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py”, line 61, in run
WSGIApplication(“%(prog)s [OPTIONS] [APP_MODULE]”).run()
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/lib/python2.7/site-packages/gunicorn/app/base.py”, line 223, in run
super(Application, self).run()
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/lib/python2.7/site-packages/gunicorn/app/base.py”, line 72, in run
Arbiter(self).run()
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/lib/python2.7/site-packages/gunicorn/arbiter.py”, line 232, in run
self.halt(reason=inst.reason, exit_status=inst.exit_status)
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/lib/python2.7/site-packages/gunicorn/arbiter.py”, line 345, in halt
self.stop()
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/lib/python2.7/site-packages/gunicorn/arbiter.py”, line 393, in stop
time.sleep(0.1)
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/lib/python2.7/site-packages/gunicorn/arbiter.py”, line 245, in handle_chld
self.reap_workers()
File “/opt/rhodecode/store/f3cphs7x07gnqgv9iiz6y2chglc63bxk-python2.7-gunicorn-19.9.0/lib/python2.7/site-packages/gunicorn/arbiter.py”, line 525, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer ‘Worker failed to boot.’ 3>
[2019-09-06 12:33:56 +0000] [1885] [INFO] Starting gunicorn 19.9.0
[2019-09-06 12:33:56 +0000] [1885] [INFO] Listening at: http://127.0.0.1:10002 (1885)
[2019-09-06 12:33:56 +0000] [1885] [INFO] Using worker: sync
[2019-09-06 12:33:56 +0000] [1885] [INFO] Server is ready. Spawning workers
[2019-09-06 12:33:56 +0000] [1895] [INFO] Booting worker with pid: 1895
[2019-09-06 12:33:56 +0000] [1895] [INFO] [<1895 >] WORKER spawned
[2019-09-06 12:33:56 +0000] [1896] [INFO] Booting worker with pid: 1896
[2019-09-06 12:33:56 +0000] [1896] [INFO] [<1896 >] WORKER spawned

Besides, we have problems with some repositories.
Some of them, with (') on the name of folders, (for example : Documentación) cann’t be downloaded the files because there is an aunthetication error.
I think that the problem is the codification of rhodecode.
Could I come back to previous version, in my case 4.15, easily?

Thank you

Hi Marcin:
Dont worry anymore about this.
Fixed.
At the beggininig of the file simplesvn.py:
from rhodecode.lib.format(response.text) if response.text else ‘’

Replaced:
text = ‘\n{}’.format(response.text) if response.text else ‘’
by
text = ‘\n{}’.format(safe_str(response.text)) if response.text else ‘’
and , surprise, everything works.
Thanks a lot.
By the way, our i+d department is thinking seriously about " Default Permissions for Branches."
I’ll talk with you about this shortly.
Thank you again.

Thanks for confirmation, we’ll include this fix in the next bugfix release.