Project

General

Profile

Actions

Bug #5410

open

After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)

Added by Brad Silva about 7 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
08.12.2017
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:
Affected Version:

Description

When clicking on the name of some repos, the error: "500 Internal Server Error | The server has either erred or is incapable of performing the requested operation." is returned by the browser. In the logs, the below error occurs. We are running CE 4.9.0.

We can still clone the repos and do other code operations from the command line or other tools. This seems to only affect the Rhodecode Web UI (which make sense looking at the error).

The problem appears to be that these repos have non-ASCII characters that Rhodecode is trying to interpret as ASCII when preparing the web page for display.

Thanks,
Brad


2017-12-08 10:35:43.983 ERROR [rhodecode.config.middleware] error occurred handling this request for path: /***Redacted*********
Traceback (most recent call last):
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween
response = handler(request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/router.py", line 158, in handle_request
view_name
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/view.py", line 547, in call_view
response = view_callable(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 393, in attr_view
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 371, in predicate_wrapper
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 465, in rendered_view
request, result, view_inst, context)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 432, in render_view
return self.render_to_response(response, system, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 455, in render_to_response
result = self.render(value, system_values, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 451, in render
result = renderer(value, system_values)
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/
init.py", line 156, in __call_
reraise(MakoRenderingException(errtext), None, exc_info[2])
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*
kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
callable
(context, *args, **kwargs)
File "_base_root_mako", line 85, in render_body
File "_base_base_mako", line 51, in render_body
File "_summary_base_mako", line 112, in render_main
File "rhodecode_templates_summary_summary_mako", line 52, in render_main
File "_base_base_mako", line 690, in render_repo_page_title
MakoRenderingException:

Traceback (most recent call last):
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*
kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
callable
(context, *args, **kwargs)
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/root.mako", line 155, in render_body
${_('Please enable JavaScript to use RhodeCode Enterprise')}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/base.mako", line 21, in render_body
${self.menu_bar_subnav()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/base.mako", line 28, in render_main
${next.main()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 13, in render_main
${self.repo_page_title(c.rhodecode_db_repo)}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 105, in render_repo_page_title
%if show_items:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 1: ordinal not in range(128)


Files

Screen Shot 2018-01-12 at 15.36.16.png (148 KB) Screen Shot 2018-01-12 at 15.36.16.png Marcin Kuzminski [CTO], 12.01.2018 15:40
Actions #1

Updated by Marcin Kuzminski [CTO] about 7 years ago

Hi Brad,

This is odd this code is shared between CE and EE edition.

Maybe during conversion of EE/CE some custom setting was change in you .ini file. Do you have old one for reference ?

Actions #2

Updated by Brad Silva about 7 years ago

It is possible that this issue existing before the conversion or between the upgrade to 4.9.0 and the conversion. Our engineers usually do most of their work with the CLI, using the web mostly for some management tasks or to look at some history, so they may not have seen this issue for quite a while (so far we only know of two repos with the issue and we have over a hundred).

I'm going to have IT restore a copy of the old .ini file for me and I'll take a look. This was a couple of months ago, so it'll probably take a few days to retrieve the tape.

Brad


From: redmine@rhodecode.com redmine@rhodecode.com
Sent: Friday, December 8, 2017 3:23:40 PM
To: Brad Silva
Subject: [RhodeCode CE/EE - Bug #5410] After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)

Issue #5410 has been updated by Marcin Kuzminski [staff].

Hi Brad,

This is odd this code is shared between CE and EE edition.

Maybe during conversion of EE/CE some custom setting was change in you .ini file. Do you have old one for reference ?


Bug #5410: After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)https://issues.rhodecode.com/issues/5410#change-25397

  • Author: Brad Silva
  • Status: New
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • Sorting:
  • Commit Number:
  • Affected Version:

When clicking on the name of some repos, the error: "500 Internal Server Error | The server has either erred or is incapable of performing the requested operation." is returned by the browser. In the logs, the below error occurs. We are running CE 4.9.0.

We can still clone the repos and do other code operations from the command line or other tools. This seems to only affect the Rhodecode Web UI (which make sense looking at the error).

The problem appears to be that these repos have non-ASCII characters that Rhodecode is trying to interpret as ASCII when preparing the web page for display.

Thanks,
Brad


2017-12-08 10:35:43.983 ERROR [rhodecode.config.middleware] error occurred handling this request for path: /Redacted******
Traceback (most recent call last):
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween
response = handler(request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/router.py", line 158, in handle_request
view_name
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/view.py", line 547, in call_view
response = view_callable(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 393, in attr_view
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 371, in predicate_wrapper
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 465, in rendered_view
request, result, view_inst, context)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 432, in render_view
return self.render_to_response(response, system, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 455, in render_to_response
result = self.render(value, system_values, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 451, in render
result = renderer(value, system_values)
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramidmako/init.py", line 156, in call
reraise(MakoRenderingException(errtext), None, exc_info[2])
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "base_root_mako", line 85, in render_body
File "base_base_mako", line 51, in render_body
File "_summarybase_mako", line 112, in render_main
File "rhodecodetemplates_summary_summary_mako", line 52, in render_main
File "base_base_mako", line 690, in render_repopage_title
MakoRenderingException:

Traceback (most recent call last):
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/root.mako", line 155, in render_body
${('Please enable JavaScript to use RhodeCode Enterprise')}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/base.mako", line 21, in render_body
${self.menu_bar_subnav()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/base.mako", line 28, in render_main
${next.main()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 13, in rendermain
${self.repo_page_title(c.rhodecode_db_repo)}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 105, in render_repo_page_title
%if show_items:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 1: ordinal not in range(128)


You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: https://issues.rhodecode.com/my/account

Actions #3

Updated by Brad Silva about 7 years ago

Turns out I hadn't yet deleted my local backup I made before the conversion. I have both the old and new rhodecode.ini files, the default_encoding for both is UTF-8.

What would you like me to look for?

Brad


From: Brad Silva
Sent: Friday, December 8, 2017 4:33:58 PM
To: redmine@rhodecode.com
Subject: Re: [RhodeCode CE/EE - Bug #5410] After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)

It is possible that this issue existing before the conversion or between the upgrade to 4.9.0 and the conversion. Our engineers usually do most of their work with the CLI, using the web mostly for some management tasks or to look at some history, so they may not have seen this issue for quite a while (so far we only know of two repos with the issue and we have over a hundred).

I'm going to have IT restore a copy of the old .ini file for me and I'll take a look. This was a couple of months ago, so it'll probably take a few days to retrieve the tape.

Brad


From: redmine@rhodecode.com redmine@rhodecode.com
Sent: Friday, December 8, 2017 3:23:40 PM
To: Brad Silva
Subject: [RhodeCode CE/EE - Bug #5410] After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)

Issue #5410 has been updated by Marcin Kuzminski [staff].

Hi Brad,

This is odd this code is shared between CE and EE edition.

Maybe during conversion of EE/CE some custom setting was change in you .ini file. Do you have old one for reference ?


Bug #5410: After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)https://issues.rhodecode.com/issues/5410#change-25397

  • Author: Brad Silva
  • Status: New
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • Sorting:
  • Commit Number:
  • Affected Version:

When clicking on the name of some repos, the error: "500 Internal Server Error | The server has either erred or is incapable of performing the requested operation." is returned by the browser. In the logs, the below error occurs. We are running CE 4.9.0.

We can still clone the repos and do other code operations from the command line or other tools. This seems to only affect the Rhodecode Web UI (which make sense looking at the error).

The problem appears to be that these repos have non-ASCII characters that Rhodecode is trying to interpret as ASCII when preparing the web page for display.

Thanks,
Brad


2017-12-08 10:35:43.983 ERROR [rhodecode.config.middleware] error occurred handling this request for path: /Redacted******
Traceback (most recent call last):
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween
response = handler(request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/router.py", line 158, in handle_request
view_name
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/view.py", line 547, in call_view
response = view_callable(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 393, in attr_view
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 371, in predicate_wrapper
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 465, in rendered_view
request, result, view_inst, context)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 432, in render_view
return self.render_to_response(response, system, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 455, in render_to_response
result = self.render(value, system_values, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 451, in render
result = renderer(value, system_values)
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramidmako/init.py", line 156, in call
reraise(MakoRenderingException(errtext), None, exc_info[2])
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "base_root_mako", line 85, in render_body
File "base_base_mako", line 51, in render_body
File "_summarybase_mako", line 112, in render_main
File "rhodecodetemplates_summary_summary_mako", line 52, in render_main
File "base_base_mako", line 690, in render_repopage_title
MakoRenderingException:

Traceback (most recent call last):
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/root.mako", line 155, in render_body
${('Please enable JavaScript to use RhodeCode Enterprise')}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/base.mako", line 21, in render_body
${self.menu_bar_subnav()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/base.mako", line 28, in render_main
${next.main()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 13, in rendermain
${self.repo_page_title(c.rhodecode_db_repo)}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 105, in render_repo_page_title
%if show_items:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 1: ordinal not in range(128)


You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: https://issues.rhodecode.com/my/account

Actions #4

Updated by Marcin Kuzminski [CTO] about 7 years ago

It could be also problem with database encoding, please make sure it's at utf8.

Also make sure you update to at least 4.9.1 or 4.10.5 because of known security weaknesses in previous releases.

Best,

Actions #5

Updated by Brad Silva about 7 years ago

I dug into the database and all of the tables are 'utf8', however are you aware that utf8 on MySQL is not what everyone else on the planet considers utf8? MySQL's utf8 only works with utf8 characters that fit in three bytes (the BMP subset). To be able to store the full utf8 character set, you need to use utf8mb4 as the charset.

Although I don't think that's the problem in this case.

I dove into trying to determine what data is causing the issue and by three avenues came up with the clone_uri field in the repositories table. Unfortunately, I can't get any further as the field appears to be encrypted. At least I'm assuming that's why the field data starts with "enc$aes$".

Almost any of the URLs for this repo trigger the error, with the exception of this one:

http://rhodecode:5000/xxxxxxx/xxxxxxxx/summary-commits?size=10&page=2

The only reason this one succeeds is that it doesn't draw the whole page.

The error is slightly different on some of the pages, but they all are Unicode/ASCII decode errors and all refer to the clone_uri field.

An example of the error from a different page:

File "/var/rhodecodelocal/.rccontrol/community-1/data/templates/base/base.mako.py", line 525, in render_repo_page_title
__M_writer(escape(h.url(h.safe_str(h.hide_credentials(repo_instance.clone_uri)))))

If I clone the repo that causes the issue and look at the repo name, there doesn't appear to be anything other than ASCII characters in the name. I don't think it's anything in the commit messages, since I can look at any of the commits using the above URL, also the other links don't have the commit messages.

Not sure where to go next.

Brad


From: redmine@rhodecode.com redmine@rhodecode.com
Sent: Saturday, December 9, 2017 10:54:04 AM
To: Brad Silva
Subject: [RhodeCode CE/EE - Bug #5410] After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)

Issue #5410 has been updated by Marcin Kuzminski [staff].

It could be also problem with database encoding, please make sure it's at utf8.

Also make sure you update to at least 4.9.1 or 4.10.5 because of known security weaknesses in previous releases.

Best,


Bug #5410: After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)https://issues.rhodecode.com/issues/5410#change-25400

  • Author: Brad Silva
  • Status: New
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • Sorting:
  • Commit Number:
  • Affected Version:

When clicking on the name of some repos, the error: "500 Internal Server Error | The server has either erred or is incapable of performing the requested operation." is returned by the browser. In the logs, the below error occurs. We are running CE 4.9.0.

We can still clone the repos and do other code operations from the command line or other tools. This seems to only affect the Rhodecode Web UI (which make sense looking at the error).

The problem appears to be that these repos have non-ASCII characters that Rhodecode is trying to interpret as ASCII when preparing the web page for display.

Thanks,
Brad


2017-12-08 10:35:43.983 ERROR [rhodecode.config.middleware] error occurred handling this request for path: /Redacted******
Traceback (most recent call last):
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween
response = handler(request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/router.py", line 158, in handle_request
view_name
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/view.py", line 547, in call_view
response = view_callable(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 393, in attr_view
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 371, in predicate_wrapper
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 465, in rendered_view
request, result, view_inst, context)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 432, in render_view
return self.render_to_response(response, system, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 455, in render_to_response
result = self.render(value, system_values, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 451, in render
result = renderer(value, system_values)
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramidmako/init.py", line 156, in call
reraise(MakoRenderingException(errtext), None, exc_info[2])
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "base_root_mako", line 85, in render_body
File "base_base_mako", line 51, in render_body
File "_summarybase_mako", line 112, in render_main
File "rhodecodetemplates_summary_summary_mako", line 52, in render_main
File "base_base_mako", line 690, in render_repopage_title
MakoRenderingException:

Traceback (most recent call last):
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/root.mako", line 155, in render_body
${('Please enable JavaScript to use RhodeCode Enterprise')}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/base.mako", line 21, in render_body
${self.menu_bar_subnav()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/base.mako", line 28, in render_main
${next.main()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 13, in rendermain
${self.repo_page_title(c.rhodecode_db_repo)}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 105, in render_repo_page_title
%if show_items:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 1: ordinal not in range(128)


You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: https://issues.rhodecode.com/my/account

Actions #6

Updated by Marcin Kuzminski [CTO] about 7 years ago

Hi Brad,

Thank you for your message and detailed description. This actually helped us to figure out a possible reason. THe clone_url fields are encrypted in database. The encryption key is stored inside the .ini file. A wrong one, that might be generated on conversion could potentially lead to such errors when showing summary page.

beaker.session.secret = OLD_VALUE_HERE

So please copy the old value of this setting into your new rhodecode.ini and we think this will fix your problem.

Actions #7

Updated by Brad Silva about 7 years ago

I don't think this is it, as most of the repos are accessible. If this were the case, wouldn't all of them have this issue?

Is there a function where I can easily decrypt the string?

Or, I could send you the encrypted string outside the bug system.

Thanks,
Brad

Actions #8

Updated by Marcin Kuzminski [CTO] about 7 years ago

Brad-

I think not all your repositories have the remote clone_url set. So this case would be only for repositories that were either imported from external location, or had added the remote_url after creation.

The decryption is not possible in other way that setting the original key, but you should have this as a backup of old .ini somewhere ? If you don't i can tell you how to reset those to empty values.

Actions #9

Updated by Brad Silva about 7 years ago

I have the .ini file. I probably won't be able to work on this until Tuesday, but I'll try to get it before then.

Thanks!
Brad

Actions #10

Updated by Brad Silva about 7 years ago

Okay.... So now I'm even more confused.

The value in beaker.session.secret in the rhodecode.ini file did change during the upgrade/conversion.

However, some of the repos that have the clone_uri field set work just fine. Others do fail with this issue.

When is the value of the clone_uri field set?

Is it possible that some have this value set after the conversion and that's why they work?

Thanks,

Brad

Actions #11

Updated by Marcin Kuzminski [CTO] about 7 years ago

Hi Brad,

Yes it's possible someone still edited those and the encrypted values got updated with new key. Afair editing should be possible without that errors, and then you can re-enter the cone url.

So probably you'd have to get to single key, and update the values either via direct /settings url (e.g server.com/REPO_NAME/settings), or via API

Actions #12

Updated by Brad Silva almost 7 years ago

Can you give me a better idea of what's stored in this field?

Why's it encrypted?

What would be the result of just wiping this field for all of the repos?

Thanks,

Brad


From: redmine@rhodecode.com redmine@rhodecode.com
Sent: Monday, December 25, 2017 4:37:16 AM
To: Brad Silva
Subject: [RhodeCode CE/EE - Bug #5410] After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)

Issue #5410 has been updated by Marcin Kuzminski [staff].

Hi Brad,

Yes it's possible someone still edited those and the encrypted values got updated with new key. Afair editing should be possible without that errors, and then you can re-enter the cone url.

So probably you'd have to get to single key, and update the values either via direct /settings url (e.g server.com/REPO_NAME/settings), or via API


Bug #5410: After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)https://issues.rhodecode.com/issues/5410#change-25452

  • Author: Brad Silva
  • Status: New
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • Sorting:
  • Commit Number:
  • Affected Version:

When clicking on the name of some repos, the error: "500 Internal Server Error | The server has either erred or is incapable of performing the requested operation." is returned by the browser. In the logs, the below error occurs. We are running CE 4.9.0.

We can still clone the repos and do other code operations from the command line or other tools. This seems to only affect the Rhodecode Web UI (which make sense looking at the error).

The problem appears to be that these repos have non-ASCII characters that Rhodecode is trying to interpret as ASCII when preparing the web page for display.

Thanks,
Brad


2017-12-08 10:35:43.983 ERROR [rhodecode.config.middleware] error occurred handling this request for path: /Redacted******
Traceback (most recent call last):
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween
response = handler(request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/router.py", line 158, in handle_request
view_name
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/view.py", line 547, in call_view
response = view_callable(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 393, in attr_view
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 371, in predicate_wrapper
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 465, in rendered_view
request, result, view_inst, context)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 432, in render_view
return self.render_to_response(response, system, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 455, in render_to_response
result = self.render(value, system_values, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 451, in render
result = renderer(value, system_values)
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramidmako/init.py", line 156, in call
reraise(MakoRenderingException(errtext), None, exc_info[2])
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "base_root_mako", line 85, in render_body
File "base_base_mako", line 51, in render_body
File "_summarybase_mako", line 112, in render_main
File "rhodecodetemplates_summary_summary_mako", line 52, in render_main
File "base_base_mako", line 690, in render_repopage_title
MakoRenderingException:

Traceback (most recent call last):
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/root.mako", line 155, in render_body
${('Please enable JavaScript to use RhodeCode Enterprise')}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/base.mako", line 21, in render_body
${self.menu_bar_subnav()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/base.mako", line 28, in render_main
${next.main()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 13, in rendermain
${self.repo_page_title(c.rhodecode_db_repo)}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 105, in render_repo_page_title
%if show_items:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 1: ordinal not in range(128)


You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: https://issues.rhodecode.com/my/account

Actions #13

Updated by Marcin Kuzminski [CTO] almost 7 years ago

Hi Brad,

We store the remote clone url inside this field. In the example screen attached it's the whole value of https://www.mercurial-scm.org/repo/hg-all

It's encrypted because you can put credentials inside there.

Actions #14

Updated by Brad Silva almost 7 years ago

Problem fixed. Quick summary of fix steps below.

I got the old encryption key from a backup of the rhodecode.ini file. (the Beaker Secret)

I dumped the list of repos using this query: "select repo_name from rhodecode.repositories;"

I used this script to determine which repos were encrypted with the old key and which had valid data in the "clone_uri" field:

for a in cat repo-names.out
do
echo
echo "___ $a ___"
curl http://rhodecode:5000/_admin/api -X POST -H 'content-type:text/plain' --data-binary '{"id": 1, "auth_token": "USER TOKEN", "method":"get_repo", "args":{"repoid":'\"$a\"}}
done
(Yeah, it's ugly, I didn't have much time)

Replace the "USER TOKEN" with a token that has the necessary privs.

For repos where the "clone_uri" field is encrypted with the old key, you'll get "Internal server error". For the others, record any repos where "clone_uri" contains valid data. In most cases it will probably be blank. You'll need to manually put this data back in the field after the fix.

Shutdown Rhodecode and MySQL. Backup MySQL (because stuff happens).

Start MySQL

Wipe the fields encrypted with the new key by running this query on each repo that is not-bad and has a non-blank "clone_uri" field.

update repositories set clone_uri = '' where repo_name ='myRepoName';

Replace the Beaker Secret key in the rhodecode.ini file with the old key.

Start Rhodecode.

You should no longer have the 500 error, although you may still need to replace the values of the "clone_uri" field that you recorded earlier.

Busy with other projects, so didn't have the time for a proper write-up, but if any one has this problem and has questions, please tell me (I think you can do that through this ticket).

Brad


From: redmine@rhodecode.com redmine@rhodecode.com
Sent: Friday, January 12, 2018 6:40:35 AM
To: Brad Silva
Subject: [RhodeCode CE/EE - Bug #5410] After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)

Issue #5410 has been updated by Marcin Kuzminski [staff].

Hi Brad,

We store the remote clone url inside this field. In the example screen attached it's the whole value of https://www.mercurial-scm.org/repo/hg-all

It's encrypted because you can put credentials inside there.


Bug #5410: After converting to CE, we get the following error when trying to view some repos in the UI: "UnicodeDecodeError: 'ascii' codec can't decode byte" (full error in Description)https://issues.rhodecode.com/issues/5410#change-25472

  • Author: Brad Silva
  • Status: New
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • Sorting:
  • Commit Number:
  • Affected Version:

When clicking on the name of some repos, the error: "500 Internal Server Error | The server has either erred or is incapable of performing the requested operation." is returned by the browser. In the logs, the below error occurs. We are running CE 4.9.0.

We can still clone the repos and do other code operations from the command line or other tools. This seems to only affect the Rhodecode Web UI (which make sense looking at the error).

The problem appears to be that these repos have non-ASCII characters that Rhodecode is trying to interpret as ASCII when preparing the web page for display.

Thanks,
Brad


2017-12-08 10:35:43.983 ERROR [rhodecode.config.middleware] error occurred handling this request for path: /Redacted******
Traceback (most recent call last):
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween
response = handler(request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/router.py", line 158, in handle_request
view_name
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/view.py", line 547, in call_view
response = view_callable(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 393, in attr_view
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 371, in predicate_wrapper
return view(context, request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/viewderivers.py", line 465, in rendered_view
request, result, view_inst, context)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 432, in render_view
return self.render_to_response(response, system, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 455, in render_to_response
result = self.render(value, system_values, request=request)
File "/opt/rhodecode/store/w6kjp4h2szaa42f7yksgi3lqnpp2ax51-python2.7-pyramid-1.7.4/lib/python2.7/site-packages/pyramid/renderers.py", line 451, in render
result = renderer(value, system_values)
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramidmako/init.py", line 156, in call
reraise(MakoRenderingException(errtext), None, exc_info[2])
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "base_root_mako", line 85, in render_body
File "base_base_mako", line 51, in render_body
File "_summarybase_mako", line 112, in render_main
File "rhodecodetemplates_summary_summary_mako", line 52, in render_main
File "base_base_mako", line 690, in render_repopage_title
MakoRenderingException:

Traceback (most recent call last):
File "/opt/rhodecode/store/i429qpprvnq5h4kfz7dq1pybqs73x68s-python2.7-pyramid-mako-1.0.2/lib/python2.7/site-packages/pyramid_mako/init.py", line 148, in call
result = template.render_unicode(*system)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
*kwargs_for_callable(callable, data))
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 873, in render_context
exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/rhodecode/store/wq83njhgkwcf0cl6623jzv69gj8v6y3i-python2.7-Mako-1.0.6/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exectemplate
callable(context, *args, **kwargs)
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/root.mako", line 155, in render_body
${('Please enable JavaScript to use RhodeCode Enterprise')}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/base/base.mako", line 21, in render_body
${self.menu_bar_subnav()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/base.mako", line 28, in render_main
${next.main()}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 13, in rendermain
${self.repo_page_title(c.rhodecode_db_repo)}
File "/opt/rhodecode/store/6b1a7rcpl0vy12imy67f8chqpm1649p3-python2.7-rhodecode-enterprise-ce-4.9.0/lib/python2.7/site-packages/rhodecode/templates/summary/summary.mako", line 105, in render_repo_page_title
%if show_items:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 1: ordinal not in range(128)

Files
Screen Shot 2018-01-12 at 15.36.16.pnghttps://issues.rhodecode.com/attachments/download/2884/Screen%20Shot%202018-01-12%20at%2015.36.16.png (148 KB)


You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: https://issues.rhodecode.com/my/account

Actions

Also available in: Atom PDF