moinwiki / moin

MoinMoin Wiki Development (2.0+), unstable, for production please use 1.9.x.
https://moinmo.in/
Other
299 stars 90 forks source link

Can't insert @ in code #745

Closed sanzcarlos closed 4 years ago

sanzcarlos commented 5 years ago

Hello

When we write @ in code, for example:

{{{ carlos.sanzpenas@gmail.com }}}

we push OK button and the Server return 500 Internal error:

Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

2018-10-31 14:16:07,565 ERROR flask.app:1761 Exception on /+modify/Home/Customer/Orange/OP018438/Syslog-NG [POST] Traceback (most recent call last): File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "k:\moin-master\src\moin\apps\frontend\views.py", line 721, in modify_item return _crash(item, None, None) File "k:\moin-master\src\moin\apps\frontend\views.py", line 2142, in _crash item=item, File "k:\moin-master\src\moin\themes__init.py", line 55, in render_template return render_theme_template(get_current_theme(), template, **context) File "k:\moin-master-venv-python\lib\site-packages\flask_theme\init__.py", line 470, in render_theme_template return render_template(template_name, **context) File "k:\moin-master-venv-python\lib\site-packages\flask\templating.py", line 135, in render_template context, ctx.app) File "k:\moin-master-venv-python\lib\site-packages\flask\templating.py", line 117, in _render rv = template.render(context) File "k:\moin-master-venv-python\lib\site-packages\jinja2\environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "k:\moin-master-venv-python\lib\site-packages\jinja2\environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "k:\moin-master\src\moin\templates\crash_view.html", line 5, in top-level template code {% extends theme("show.html") %} File "k:\moin-master\src\moin\themes\basic\templates\show.html", line 8, in top-level template code {% set footer_meta = snippets.footer_meta() %} File "k:\moin-master\src\moin\themes\basic\templates\layout.html", line 57, in top-level template code

In previous versions is working fine, but I don't know to begin the issue.

ThomasWaldmann commented 5 years ago

the real problem can be seen in the last line of the long traceback:

a 0xe1 character it tries to decode using the ascii decoder (which can of course only decode pure ascii).

did you put something non-ascii into footer_meta maybe?

sanzcarlos commented 5 years ago

No, but you can tell me how I can check it.

ThomasWaldmann commented 5 years ago

Well, I guess you would know if you modified the footer_meta.

IIRC we have documented how to modify some parts of the theme, like footer, logo, etc. search the docs for "snippets".

sanzcarlos commented 5 years ago

I had modify the file templates/snippets.html, but In revision (rev 7a148a4) didn't have this issue and this file was modify.

sanzcarlos commented 5 years ago

I have created a sample wiki in fresh installation.

PS K:> git clone --single-branch -b master https://github.com/moinwiki/moin.git moin-master Cloning into 'moin-master'... remote: Enumerating objects: 128, done. remote: Counting objects: 100% (128/128), done. remote: Compressing objects: 100% (72/72), done. remote: Total 32995 (delta 48), reused 95 (delta 39), pack-reused 32867 Receiving objects: 100% (32995/32995), 6.71 MiB | 1.63 MiB/s, done. Resolving deltas: 100% (24085/24085), done. PS K:> cd .\moin-master\ PS K:\moin-master> python.exe make.py quickinstall Running quickinstall.py and tox recreate virtualenvs... output messages redirected to m-quickinstall.txt Searching m-quickinstall.txt, important messages are shown below... Do "m log quickinstall" to see complete log.

4 54 Successfully installed Babel-2.6.0 Flask-1.0.2 Flask-Babel-0.12.2 Flask-Caching-1.4.0 Flask-Script-2.0.6 Flask-Theme-0.2.0 Jinja2-2.10 Markdown-3.0.1 MarkupSafe-1.0 Werkzeug-0.14.1 XStatic-1.0.2 XStatic-AnyWikiDraw-0.14.2 XStatic-Bootstrap-3.1.1.2 XStatic-CKEditor-3.6.4.0 XStatic-Font-Awesome-4.7.0.0 XStatic-JQuery.TableSorter-2.14.5.1 XStatic-Pygments-2.2.0.1 XStatic-TWikiDraw-moin-2004.10.23.2 XStatic-autosize-1.17.2.1 XStatic-jQuery-3.3.1.1 XStatic-jQuery-File-Upload-4.4.2 XStatic-svg-edit-moin-2012.11.27.1 blinker-1.4 click-7.0 docutils-0.14 emeraldtree-0.10.0 flatland-0.8 itsdangerous-1.1.0 moin passlib-1.7.1 pdfminer-20140328 pygments-2.2.0 pytz-2018.7 six-1.11.0 whoosh-2.7.4 5 61 error: src\moin\translations\pt_BR\LC_MESSAGES\messages.po:632: unknown named placeholder u'invalid_names' 6 62 error: src\moin\translations\pt_BR\LC_MESSAGES\messages.po:647: unknown named placeholder u'item_name' 7 63 error: src\moin\translations\pt_BR\LC_MESSAGES\messages.po:2232: unknown named placeholder u'item_name' 8 66 error: src\moin\translations\ru\LC_MESSAGES\messages.po:183: incompatible format for placeholder u'email': 'r' and 's' are not compatible 9 67 error: src\moin\translations\ru\LC_MESSAGES\messages.po:662: unknown named placeholder u'item_name' 10 68 error: src\moin\translations\ru\LC_MESSAGES\messages.po:1948: unknown named placeholder u'item_name' 11 69 error: src\moin\translations\ru\LC_MESSAGES\messages.po:2256: unknown named placeholder u'item_name' 12 73 Successfully created or updated venv at K:\moin-master-venv-python 50 Successfully installed Babel-2.6.0 Flask-1.0.2 Flask-Babel-0.12.2 Flask-Caching-1.4.0 Flask-Script-2.0.6 Flask-Theme-0.2.0 Jinja2-2.10 Markdown-3.0.1 MarkupSafe-1.0 Werkzeug-0.14.1 XStatic-1.0.2 XStatic-AnyWikiDraw-0.14.2 XStatic-Bootstrap-3.1.1.2 XStatic-CKEditor-3.6.4.0 XStatic-Font-Awesome-4.7.0.0 XStatic-JQuery.TableSorter-2.14.5.1 XStatic-Pygments-2.2.0.1 XStatic-TWikiDraw-moin-2004.10.23.2 XStatic-autosize-1.17.2.1 XStatic-jQuery-3.3.1.1 XStatic-jQuery-File-Upload-4.4.2 XStatic-svg-edit-moin-2012.11.27.1 blinker-1.4 click-7.0 docutils-0.14 emeraldtree-0.10.0 flatland-0.8 itsdangerous-1.1.0 moin passlib-1.7.1 pdfminer-20140328 pygments-2.2.0 pytz-2018.7 six-1.11.0 whoosh-2.7.4 57 error: src\moin\translations\pt_BR\LC_MESSAGES\messages.po:632: unknown named placeholder u'invalid_names' 58 error: src\moin\translations\pt_BR\LC_MESSAGES\messages.po:647: unknown named placeholder u'item_name' 59 error: src\moin\translations\pt_BR\LC_MESSAGES\messages.po:2232: unknown named placeholder u'item_name' 62 error: src\moin\translations\ru\LC_MESSAGES\messages.po:183: incompatible format for placeholder u'email': 'r' and 's' are not compatible 63 error: src\moin\translations\ru\LC_MESSAGES\messages.po:662: unknown named placeholder u'item_name' 64 error: src\moin\translations\ru\LC_MESSAGES\messages.po:1948: unknown named placeholder u'item_name' 65 error: src\moin\translations\ru\LC_MESSAGES\messages.po:2256: unknown named placeholder u'item_name' 69 Successfully created or updated venv at K:\moin-master-venv-python PS K:\moin-master> python.exe make.py sample Creating a new wiki populated with sample data... Output messages redirected to m-new-wiki.txt.

Success: a new wiki has been created... working... Output messages redirected to m-new-wiki.txt.

Success: the index has been created for the sample wiki... working... 29 items were added to wiki

My version of python is

PS K:\moin-master> python.exe --version Python 2.7.14

I have started the wiki:

PS K:\moin-master> python.exe make.py run --host 0.0.0.0 --port 9090 2018-11-01 08:20:39,641 INFO moin.log:153 using logging configuration read from built-in fallback in moin.log module! 2018-11-01 08:20:39,647 INFO moin.log:158 Running MoinMoin 2.0.0.dev233+g6ced8b3d code from k:\moin-master\src\moin 2018-11-01 08:20:41,963 INFO moin.utils.clock:45 timer create_app load config(0): 102.00ms 2018-11-01 08:20:42,085 INFO moin.utils.clock:45 timer create_app register(0): 122.00ms 2018-11-01 08:20:42,119 INFO moin.utils.clock:45 timer create_app flask-cache(0): 34.00ms 2018-11-01 08:20:42,250 INFO moin.utils.clock:45 timer create_app init backends(0): 131.00ms 2018-11-01 08:20:42,266 INFO moin.utils.clock:45 timer create_app flask-babel(0): 0.00ms 2018-11-01 08:20:42,266 INFO moin.utils.clock:45 timer create_app flask-theme(0): 0.00ms 2018-11-01 08:20:42,266 INFO moin.utils.clock:45 timer create_app total(0): 415.00ms

  • Serving Flask app "moin" (lazy loading)
  • Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead.
  • Debug mode: off 2018-11-01 08:20:43,253 INFO werkzeug:88 * Running on http://0.0.0.0:9090/ (Press CTRL+C to quit)

I have modify the homepage for add carlos@sanz.com and the wiki return the error:

2018-11-01 08:20:54,928 INFO moin.utils.clock:45 timer init(0): 31.00ms 2018-11-01 08:20:54,930 INFO moin.signalling.log:19 item MyMoinMoin:Home displayed 2018-11-01 08:20:55,082 INFO moin.utils.clock:45 timer conv_in_dom(0): 33.00ms 2018-11-01 08:20:55,086 INFO moin.utils.clock:45 timer nowiki(0): 2.00ms 2018-11-01 08:20:55,135 INFO moin.utils.clock:45 timer conv_in_dom(0): 4.00ms 2018-11-01 08:20:55,183 INFO moin.utils.clock:45 timer conv_in_dom(0): 3.00ms 2018-11-01 08:20:55,190 INFO moin.utils.clock:45 timer conv_include(0): 101.00ms 2018-11-01 08:20:55,196 INFO moin.utils.clock:45 timer conv_macro(0): 6.00ms 2018-11-01 08:20:55,453 INFO moin.utils.clock:45 timer conv_link(0): 255.00ms 2018-11-01 08:20:55,466 INFO moin.utils.clock:45 timer conv_dom_html(0): 13.00ms jinja loader path: k:\moin-master\src\moin\themes\topside\templates jinja loader path: k:\moin-master\src\moin\themes\modernized\templates jinja loader path: k:\moin-master\src\moin\themes\topside_cms\templates jinja loader path: k:\moin-master\src\moin\themes\basic\templates 2018-11-01 08:20:56,163 INFO moin.utils.clock:45 timer navibar(0): 1.00ms 2018-11-01 08:20:56,196 INFO moin.utils.clock:45 timer total(0): 1299.00ms 2018-11-01 08:20:56,197 INFO werkzeug:88 127.0.0.1 "GET /Home HTTP/1.1" 200 - 2018-11-01 08:20:56,253 INFO werkzeug:88 127.0.0.1 "GET /_themes/topside/css/theme.css HTTP/1.1" 200 - 2018-11-01 08:20:56,283 INFO werkzeug:88 127.0.0.1 "GET /static/logos/moinmoin.png HTTP/1.1" 200 - 2018-11-01 08:20:56,312 INFO moin.utils.clock:45 timer init(0): 3.00ms 2018-11-01 08:20:56,346 INFO moin.utils.clock:45 timer total(0): 38.00ms 2018-11-01 08:20:56,358 INFO werkzeug:88 127.0.0.1 "GET /static/img/white-clouds-r.jpg HTTP/1.1" 200 - 2018-11-01 08:20:56,359 INFO werkzeug:88 127.0.0.1 "GET /+get/+d4fef285978645aa8f44d469c4077cfe/png HTTP/1.1" 200 - 2018-11-01 08:20:56,380 INFO werkzeug:88 127.0.0.1 "GET /static/img/moin-search.png HTTP/1.1" 200 - 2018-11-01 08:21:09,109 INFO moin.utils.clock:45 timer init(0): 5.00ms 2018-11-01 08:21:09,400 INFO moin.utils.clock:45 timer navibar(0): 1.00ms 2018-11-01 08:21:09,523 INFO moin.utils.clock:45 timer total(0): 419.00ms 2018-11-01 08:21:09,526 INFO werkzeug:88 127.0.0.1 "GET /+login HTTP/1.1" 200 - 2018-11-01 08:21:19,128 INFO moin.utils.clock:45 timer init(0): 5628.00ms 2018-11-01 08:21:19,292 INFO moin.utils.clock:45 timer navibar(0): 4.00ms 2018-11-01 08:21:19,457 INFO moin.utils.clock:45 timer total(0): 5957.00ms 2018-11-01 08:21:19,461 INFO werkzeug:88 127.0.0.1 "POST /+login HTTP/1.1" 200 - 2018-11-01 08:21:19,750 INFO werkzeug:88 127.0.0.1 "GET /static/img/smileys/icon-error.png HTTP/1.1" 200 - 2018-11-01 08:21:24,559 INFO moin.utils.clock:45 timer init(0): 8.00ms 2018-11-01 08:21:24,562 INFO moin.signalling.log:19 item MyMoinMoin:Home displayed 2018-11-01 08:21:24,625 INFO moin.utils.clock:45 timer conv_in_dom(0): 8.00ms 2018-11-01 08:21:24,634 INFO moin.utils.clock:45 timer nowiki(0): 1.00ms 2018-11-01 08:21:24,700 INFO moin.utils.clock:45 timer conv_in_dom(0): 2.00ms 2018-11-01 08:21:24,776 INFO moin.utils.clock:45 timer conv_in_dom(0): 2.00ms 2018-11-01 08:21:24,789 INFO moin.utils.clock:45 timer conv_include(0): 154.00ms 2018-11-01 08:21:24,799 INFO moin.utils.clock:45 timer conv_macro(0): 8.00ms 2018-11-01 08:21:25,230 INFO moin.utils.clock:45 timer conv_link(0): 430.00ms 2018-11-01 08:21:25,252 INFO moin.utils.clock:45 timer conv_dom_html(0): 20.00ms 2018-11-01 08:21:25,790 INFO moin.utils.clock:45 timer navibar(0): 2.00ms 2018-11-01 08:21:25,892 INFO moin.utils.clock:45 timer total(0): 1341.00ms 2018-11-01 08:21:25,897 INFO werkzeug:88 127.0.0.1 "GET /Home HTTP/1.1" 200 - 2018-11-01 08:21:26,012 INFO moin.utils.clock:45 timer init(0): 6.00ms 2018-11-01 08:21:26,161 INFO moin.utils.clock:45 timer total(0): 154.00ms 2018-11-01 08:21:26,186 INFO werkzeug:88 127.0.0.1 "GET /+get/+d4fef285978645aa8f44d469c4077cfe/png HTTP/1.1" 200 - 2018-11-01 08:22:03,098 INFO moin.utils.clock:45 timer init(0): 4.00ms 2018-11-01 08:22:03,584 INFO moin.utils.clock:45 timer navibar(0): 1.00ms 2018-11-01 08:22:03,644 INFO moin.utils.clock:45 timer total(0): 550.00ms 2018-11-01 08:22:03,645 INFO werkzeug:88 127.0.0.1 "GET /+modify/Home HTTP/1.1" 200 - 2018-11-01 08:22:13,677 INFO moin.utils.clock:45 timer init(0): 10.00ms 2018-11-01 08:22:13,984 ERROR moin.apps.frontend.views:2134 An exception happened in _render_data (error_id = e32ca249-1df3-4db1-86b4-2d1c332ea36c ): Traceback (most recent call last): File "k:\moin-master\src\moin\apps\frontend\views.py", line 719, in modify_item ret = item.do_modify() File "k:\moin-master\src\moin\items__init.py", line 986, in do_modify self.modify(meta, data, comment, contenttype_guessed, {CONTENTTYPE: contenttype_qs}) File "k:\moin-master\src\moin\items__init__.py", line 551, in modify return self._save(meta, data, contenttype_guessed=contenttype_guessed, comment=comment) File "k:\moin-master\src\moin\items__init.py", line 688, in _save data = self.handle_variables(data, meta) File "k:\moin-master\src\moin\items\init__.py", line 750, in handle_variables data = data.replace(u'@{0}@'.format(name), variables[name]) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 28: ordinal not in range(128) 2018-11-01 08:22:14,500 INFO moin.utils.clock:45 timer navibar(0): 2.00ms 2018-11-01 08:22:14,630 ERROR moin.signalling.log:30 'ascii' codec can't decode byte 0xe1 in position 28: ordinal not in range(128) Traceback (most recent call last): File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](req.view_args) File "k:\moin-master\src\moin\apps\frontend\views.py", line 721, in modify_item return _crash(item, None, None) File "k:\moin-master\src\moin\apps\frontend\views.py", line 2142, in _crash item=item, File "k:\moin-master\src\moin\themes\init.py", line 55, in render_template return render_theme_template(get_current_theme(), template, **context) File "k:\moin-master-venv-python\lib\site-packages\flask_theme\init__.py", line 470, in render_theme_template return render_template(template_name, **context) File "k:\moin-master-venv-python\lib\site-packages\flask\templating.py", line 135, in render_template context, ctx.app) File "k:\moin-master-venv-python\lib\site-packages\flask\templating.py", line 117, in _render rv = template.render(context) File "k:\moin-master-venv-python\lib\site-packages\jinja2\environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "k:\moin-master-venv-python\lib\site-packages\jinja2\environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "k:\moin-master\src\moin\templates\crash_view.html", line 5, in top-level template code {% extends theme("show.html") %} File "k:\moin-master\src\moin\templates\show.html", line 7, in top-level template code {% set footer_meta = snippets.footer_meta() %} File "k:\moin-master\src\moin\themes\topside\templates\layout.html", line 11, in top-level template code {% import "utils.html" as utils with context %} File "k:\moin-master\src\moin\templates\base.html", line 67, in top-level template code {%- block layout %} File "k:\moin-master\src\moin\themes\topside\templates\layout.html", line 57, in block "layout" {% block item -%} File "k:\moin-master\src\moin\themes\topside\templates\layout.html", line 65, in block "item" {% block content %} File "k:\moin-master\src\moin\templates\crash_view.html", line 8, in block "content" {% include "crash.html" %} File "k:\moin-master\src\moin\templates\crash.html", line 12, in top-level template code

{{ server_time }}

File "k:\moin-master-venv-python\lib\site-packages\markupsafe_native.py", line 22, in escape return Markup(text_type(s) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 28: ordinal not in range(128) 2018-11-01 08:22:14,654 ERROR flask.app:1761 Exception on /+modify/Home [POST] Traceback (most recent call last): File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "k:\moin-master-venv-python\lib\site-packages\flask\app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "k:\moin-master\src\moin\apps\frontend\views.py", line 721, in modify_item return _crash(item, None, None) File "k:\moin-master\src\moin\apps\frontend\views.py", line 2142, in _crash item=item, File "k:\moin-master\src\moin\themes__init.py", line 55, in render_template return render_theme_template(get_current_theme(), template, **context) File "k:\moin-master-venv-python\lib\site-packages\flask_theme\init__.py", line 470, in render_theme_template return render_template(template_name, **context) File "k:\moin-master-venv-python\lib\site-packages\flask\templating.py", line 135, in render_template context, ctx.app) File "k:\moin-master-venv-python\lib\site-packages\flask\templating.py", line 117, in _render rv = template.render(context) File "k:\moin-master-venv-python\lib\site-packages\jinja2\environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "k:\moin-master-venv-python\lib\site-packages\jinja2\environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "k:\moin-master\src\moin\templates\crash_view.html", line 5, in top-level template code {% extends theme("show.html") %} File "k:\moin-master\src\moin\templates\show.html", line 7, in top-level template code {% set footer_meta = snippets.footer_meta() %} File "k:\moin-master\src\moin\themes\topside\templates\layout.html", line 11, in top-level template code {% import "utils.html" as utils with context %} File "k:\moin-master\src\moin\templates\base.html", line 67, in top-level template code {%- block layout %} File "k:\moin-master\src\moin\themes\topside\templates\layout.html", line 57, in block "layout" {% block item -%} File "k:\moin-master\src\moin\themes\topside\templates\layout.html", line 65, in block "item" {% block content %} File "k:\moin-master\src\moin\templates\crash_view.html", line 8, in block "content" {% include "crash.html" %} File "k:\moin-master\src\moin\templates\crash.html", line 12, in top-level template code

{{ server_time }}

File "k:\moin-master-venv-python\lib\site-packages\markupsafe_native.py", line 22, in escape return Markup(text_type(s) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 28: ordinal not in range(128) 2018-11-01 08:22:14,690 INFO moin.utils.clock:45 timer total(0): 1022.00ms 2018-11-01 08:22:14,710 INFO werkzeug:88 127.0.0.1 "POST /+modify/Home HTTP/1.1" 500 -

In this new installation I haven't modify any files.

ReimarBauer commented 5 years ago

My setup trying this is slightly different, I use miniconda2 and have done conda install virtualenv beforehand. On linux it did not crash. Please show what you have on server time on one of the not changed pages. e.g. http://localhost:9090/WikiDict

And also verify if another change, any change makes that error. #747 shows that a single @ on the page triggers handle_variables. So any 0xe1 on the item will make that error.

Python 2.7.15 |Anaconda, Inc.| (default, Oct 23 2018, 18:31:10) [GCC 7.3.0] on linux2 bildschirmfoto von 2018-11-01 09-16-53

bildschirmfoto von 2018-11-01 09-28-31

try to modify it to get it working again, e.g. remove all content, write one word http://localhost:9090/+modify/Home

ReimarBauer commented 5 years ago

related issue #747

sanzcarlos commented 5 years ago

My setup trying this is slightly different, I use miniconda2 and have done conda install virtualenv beforehand. On linux it did not crash. Please show what you have on server time on one of the not changed pages. e.g. http://localhost:9090/WikiDict

And also verify if another change, any change makes that error. #747 shows that a single @ on the page triggers handle_variables. So any 0xe1 on the item will make that error.

Python 2.7.15 |Anaconda, Inc.| (default, Oct 23 2018, 18:31:10) [GCC 7.3.0] on linux2 bildschirmfoto von 2018-11-01 09-16-53

bildschirmfoto von 2018-11-01 09-28-31

try to modify it to get it working again, e.g. remove all content, write one word http://localhost:9090/+modify/Home

Hello: I don't have the page http://localhost:9090/WikiDict.

Yes, I have tried to delete all the content and just write an email address and the server return 500 Error. If I don't write the character @, the server is fine.

sanzcarlos commented 5 years ago

I'm going to close the case

ThomasWaldmann commented 5 years ago
>>> chr(0x40)
'@'

As you can see, a @ is not 0xe1, but 0x40, so I guess we did not find the root cause here.

ThomasWaldmann commented 5 years ago
File "k:\moin-master\src\moin\items_init.py", line 750, in handle_variables
data = data.replace(u'@{0}@'.format(name), variables[name])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 28: ordinal not in range(128)

So, the problem is some variable content being a byte string and being coerced to unicode.

It could be also some variable name, but the hardcoded ones should be pure ascii and not cause problems.

            'PAGE': item_name,
            'ITEM': item_name,
            'TIMESTAMP': strftime("%Y-%m-%d %H:%M:%S %Z"),
            'TIME': "<<DateTime(%s)>>" % time(),
            'DATE': "<<Date(%s)>>" % time(),
            'ME': flaskg.user.name0,
            'USERNAME': signature,
            'USER': "-- %s" % signature,
            'SIG': "-- %s <<DateTime(%s)>>" % (signature, time()),
            'MAILTO': "<<MailTo({0})>>".format(obfuscated_email_address)
            'EMAIL': "<<MailTo({0})>>".format(email)

Check if any of these is non-ascii.

ThomasWaldmann commented 5 years ago

@sanzcarlos try #752 - I have merged it into master branch already.

You should see a warning about handle_variables in the log output then - with the variable name and value that caused the crash until now (it will not crash any more with that code).

But I need that (likely 1) line from the log output to fix the code, please add a comment with it.

RogerHaase commented 5 years ago

As not one else can reproduce this, I would suggest renaming the virtualenv (moin-venv-python) to preserve its state, deleting m.bat, activate.bat and deactivate.bat from the repo root, and rerunning "python quickinstall.py".

Then try to reproduce the error.

Note #571 was also documented near Halloween... just saying...

sanzcarlos commented 5 years ago

Hi

I have restore a previous backup wiki in fresh installation. Now I can modify a page that has the character @ and insert this character.

PS K:\moin-master> python.exe .\quickinstall.py run --host 0.0.0.0 --port 9080 2018-11-06 13:06:33,680 INFO moin.log:153 using logging configuration read from built-in fallback in moin.log module! 2018-11-06 13:06:33,681 INFO moin.log:158 Running MoinMoin 2.0.0.dev247+ga544f473 code from k:\moin-master\src\moin 2018-11-06 13:06:35,505 INFO moin.utils.clock:45 timer create_app load config(0): 127.00ms 2018-11-06 13:06:35,753 INFO moin.utils.clock:45 timer create_app register(0): 245.00ms 2018-11-06 13:06:35,799 INFO moin.utils.clock:45 timer create_app flask-cache(0): 45.00ms 2018-11-06 13:06:36,184 INFO moin.utils.clock:45 timer create_app init backends(0): 367.00ms 2018-11-06 13:06:36,190 INFO moin.utils.clock:45 timer create_app flask-babel(0): 0.00ms 2018-11-06 13:06:36,196 INFO moin.utils.clock:45 timer create_app flask-theme(0): 4.00ms 2018-11-06 13:06:36,200 INFO moin.utils.clock:45 timer create_app total(0): 827.00ms

  • Serving Flask app "moin" (lazy loading)
  • Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead.
  • Debug mode: off 2018-11-06 13:06:36,336 INFO werkzeug:88 * Running on http://0.0.0.0:9080/ (Press CTRL+C to quit) 2018-11-06 13:06:56,970 INFO moin.utils.clock:45 timer init(0): 192.00ms 2018-11-06 13:06:56,973 INFO moin.signalling.log:19 item MyMoinMoin:Home/Customer/Orange/OP018438/Syslog-NG displayed 2018-11-06 13:06:57,272 INFO moin.utils.clock:45 timer conv_in_dom(0): 65.00ms 2018-11-06 13:06:57,299 INFO moin.utils.clock:45 timer nowiki(0): 15.00ms 2018-11-06 13:06:57,319 INFO moin.utils.clock:45 timer conv_include(0): 18.00ms 2018-11-06 13:06:57,335 INFO moin.utils.clock:45 timer conv_macro(0): 15.00ms 2018-11-06 13:06:57,338 INFO moin.utils.clock:45 timer conv_link(0): 1.00ms 2018-11-06 13:06:57,365 INFO moin.utils.clock:45 timer conv_dom_html(0): 26.00ms jinja loader path: k:\moin-master\src\moin\themes\basic\templates jinja loader path: k:\moin-master\src\moin\themes\modernized\templates jinja loader path: k:\moin-master\src\moin\themes\topside\templates jinja loader path: k:\moin-master\src\moin\themes\topside_cms\templates 2018-11-06 13:06:59,357 INFO moin.utils.clock:45 timer navibar(0): 6.00ms 2018-11-06 13:06:59,671 INFO moin.utils.clock:45 timer total(0): 2891.00ms 2018-11-06 13:06:59,677 INFO werkzeug:88 127.0.0.1 "GET /Home/Customer/Orange/OP018438/Syslog-NG HTTP/1.1" 200 - 2018-11-06 13:06:59,832 INFO werkzeug:88 127.0.0.1 "GET /static/css/normalize.css HTTP/1.1" 304 - 2018-11-06 13:06:59,844 INFO werkzeug:88 127.0.0.1 "GET /+serve/pygments/css/colorful.css HTTP/1.1" 304 - 2018-11-06 13:06:59,880 INFO werkzeug:88 127.0.0.1 "GET /+serve/font_awesome/css/font-awesome.css HTTP/1.1" 304 - 2018-11-06 13:06:59,907 INFO werkzeug:88 127.0.0.1 "GET /static/css/common.css HTTP/1.1" 304 - 2018-11-06 13:06:59,950 INFO werkzeug:88 127.0.0.1 "GET /_themes/basic/css/theme.css HTTP/1.1" 304 - 2018-11-06 13:06:59,977 INFO werkzeug:88 127.0.0.1 "GET /+serve/jquery/jquery.min.js HTTP/1.1" 304 - 2018-11-06 13:07:00,062 INFO werkzeug:88 127.0.0.1 "GET /static/js/jquery.i18n.min.js HTTP/1.1" 304 - 2018-11-06 13:07:00,115 INFO moin.utils.clock:45 timer init(0): 19.00ms 2018-11-06 13:07:00,128 INFO werkzeug:88 127.0.0.1 "GET /+serve/autosize/jquery.autosize-min.js HTTP/1.1" 304 - 2018-11-06 13:07:00,174 INFO werkzeug:88 127.0.0.1 "GET /+serve/jquery_tablesorter/jquery.tablesorter.js HTTP/1.1" 304 - 2018-11-06 13:07:00,204 INFO moin.utils.clock:45 timer total(0): 109.00ms 2018-11-06 13:07:00,207 INFO werkzeug:88 127.0.0.1 "GET /+template/dictionary.js HTTP/1.1" 200 - 2018-11-06 13:07:00,257 INFO werkzeug:88 127.0.0.1 "GET /static/js/common.js HTTP/1.1" 304 - 2018-11-06 13:07:00,263 INFO werkzeug:88 127.0.0.1 "GET /+serve/bootstrap/js/bootstrap.min.js HTTP/1.1" 304 - 2018-11-06 13:07:00,298 INFO werkzeug:88 127.0.0.1 "GET /static/js/basic.js HTTP/1.1" 304 - 2018-11-06 13:07:00,319 INFO werkzeug:88 127.0.0.1 "GET /static/logos/moinmoin.png HTTP/1.1" 304 - 2018-11-06 13:07:00,336 INFO werkzeug:88 127.0.0.1 "GET /static/logos/moinmoin_powered.png HTTP/1.1" 304 - 2018-11-06 13:07:00,352 INFO werkzeug:88 127.0.0.1 "GET /static/logos/python_powered.png HTTP/1.1" 304 - 2018-11-06 13:07:00,397 INFO werkzeug:88 127.0.0.1 "GET /static/logos/favicon.ico HTTP/1.1" 304 - 2018-11-06 13:07:10,717 INFO moin.utils.clock:45 timer init(0): 33.00ms 2018-11-06 13:07:11,302 INFO moin.utils.clock:45 timer navibar(0): 7.00ms 2018-11-06 13:07:11,634 INFO moin.utils.clock:45 timer total(0): 951.00ms 2018-11-06 13:07:11,644 INFO werkzeug:88 127.0.0.1 "GET /+modify/Home/Customer/Orange/OP018438/Syslog-NG HTTP/1.1" 200 - 2018-11-06 13:07:12,285 INFO moin.utils.clock:45 timer init(0): 152.00ms 2018-11-06 13:07:12,322 INFO moin.utils.clock:45 timer total(0): 191.00ms 2018-11-06 13:07:12,361 INFO werkzeug:88 127.0.0.1 "GET /+template/dictionary.js HTTP/1.1" 200 - 2018-11-06 13:07:44,436 INFO moin.utils.clock:45 timer init(0): 109.00ms 2018-11-06 13:07:44,750 WARNING moin.items:753 handle_variables: UnicodeError! name: 'TIMESTAMP' value: '2018-11-06 13:07:44 Hora est\xe1ndar romance' 2018-11-06 13:07:51,229 INFO moin.signalling.log:25 item MyMoinMoin:Home/Customer/Orange/OP018438/Syslog-NG modified 2018-11-06 13:07:53,141 INFO moin.utils.clock:45 timer total(0): 8815.00ms 2018-11-06 13:07:53,144 INFO werkzeug:88 127.0.0.1 "POST /+modify/Home/Customer/Orange/OP018438/Syslog-NG HTTP/1.1" 302 - 2018-11-06 13:07:53,230 INFO moin.utils.clock:45 timer init(0): 31.00ms 2018-11-06 13:07:53,233 INFO moin.signalling.log:19 item MyMoinMoin:Home/Customer/Orange/OP018438/Syslog-NG displayed 2018-11-06 13:07:53,361 INFO moin.utils.clock:45 timer conv_in_dom(0): 51.00ms 2018-11-06 13:07:53,371 INFO moin.utils.clock:45 timer nowiki(0): 4.00ms 2018-11-06 13:07:53,384 INFO moin.utils.clock:45 timer conv_include(0): 7.00ms 2018-11-06 13:07:53,400 INFO moin.utils.clock:45 timer conv_macro(0): 13.00ms 2018-11-06 13:07:53,404 INFO moin.utils.clock:45 timer conv_link(0): 2.00ms 2018-11-06 13:07:53,427 INFO moin.utils.clock:45 timer conv_dom_html(0): 18.00ms 2018-11-06 13:07:53,947 INFO moin.utils.clock:45 timer navibar(0): 4.00ms 2018-11-06 13:07:54,361 INFO moin.utils.clock:45 timer total(0): 1161.00ms 2018-11-06 13:07:54,361 INFO werkzeug:88 127.0.0.1 "GET /Home/Customer/Orange/OP018438/Syslog-NG HTTP/1.1" 200 - 2018-11-06 13:07:54,657 INFO moin.utils.clock:45 timer init(0): 48.00ms 2018-11-06 13:07:54,677 INFO moin.utils.clock:45 timer total(0): 68.00ms 2018-11-06 13:07:54,686 INFO werkzeug:88 127.0.0.1 "GET /+template/dictionary.js HTTP/1.1" 200 -

The only line that is not info is:

2018-11-06 13:07:44,750 WARNING moin.items:753 handle_variables: UnicodeError! name: 'TIMESTAMP' value: '2018-11-06 13:07:44 Hora est\xe1ndar romance'

Do you need other test?

ThomasWaldmann commented 5 years ago

Yes, I need a test with current master in the environment that previously made it fail.

And the warning log output line that tells why it fails.

See: https://github.com/moinwiki/moin/issues/745#issuecomment-435722810

RogerHaase commented 5 years ago

This is a windows issue that can not be reproduced after the installations is refreshed:

sanzcarlos commented on Nov 6, 2018

Hi
I have restore a previous backup wiki in fresh installation. Now I can modify 
a page that has the character @ and insert this character.
--

See #571 for another issue related to Windows installation where the install process creates an almost-valid installation that results in a repeatable error. But once the installation is refreshed, the problem goes away.

RogerHaase commented 4 years ago

Closing, cannot reproduce, has not happened since py3 conversion