Dear Massimo, I think I have got the problem. It seems that try_rewrite_on_error in rewrite.py acts strange when the REQUEST_METHOD is POST. Just to see what will happen, I patched it to handle a the case and afterwards custom error handler seems to be working on posts too. Could you please have a look at the issue when you have time. If relevant, I can open a github ticket afterwards.
I added below lines after the line 238: if environ['REQUEST_METHOD']=='POST': return HTTP(303, 'Sorry', location=path_info + '?' + query_string), environ My best, Cem. 7 Ocak 2015 Çarşamba 00:51:24 UTC+2 tarihinde Massimo Di Pierro yazdı: > > The version of rocket that ships with web2py is 1.2.6. > But what version of web2py are you using. What is the controller in > question? > > On Tuesday, 6 January 2015 13:03:52 UTC-6, Derek wrote: >> >> Yeah, this is strange, I wonder why Rocket reports it's version as 1.2.6 >> when the latest version of Rocket is 1.2.4? >> >> On Monday, December 29, 2014 11:19:55 AM UTC-7, Louis Amon wrote: >>> >>> This is the request received by my ticket handler (I removed some big >>> chunks so that it's readable): >>> >>> >>> >>> _vars None >>> >>> function index >>> >>> _body None >>> >>> args [] >>> >>> wsgi <gluon.main.LazyWSGI object at 0x111e5cdd0> >>> >>> controller ticket >>> >>> utcnow 2014-12-29 18:09:42.485011 >>> >>> url /error/ticket/index/ >>> >>> step None >>> >>> now 2014-12-29 19:09:42.484998 >>> >>> is_local True >>> >>> is_shell None >>> >>> uuid >>> error/127.0.0.1.2014-12-29.19-09-42.95417662-6fed-4364-8f6a-f9e467f66bb6 >>> >>> extension html >>> >>> cid None >>> >>> _post_vars None >>> >>> _get_vars None >>> >>> ajax False >>> >>> is_https False >>> >>> is_sheduler None >>> >>> application error >>> >>> client 127.0.0.1 >>> >>> is_restful False >>> >>> >>> >>> >>> And this is request.env (raw data): >>> >>> content_length 672 >>> >>> HTTP_REFERER >>> http://localhost:8000/location/index/espace-de-stockage/la-seyne-sur-mer/1 >>> >>> SERVER_SOFTWARE Rocket 1.2.6 >>> >>> SCRIPT_NAME >>> >>> REQUEST_METHOD POST >>> >>> HTTP_ORIGIN http://localhost:8000 >>> >>> SERVER_PROTOCOL HTTP/1.1 >>> >>> web2py_path /opt/web2py-prod >>> >>> CONTENT_LENGTH 672 >>> >>> wsgi_url_scheme http >>> >>> server_name Orbital Station >>> >>> WEB2PY_STATUS_CODE 500 >>> >>> wsgi_errors <open file '<stderr>', mode 'w' at 0x10c5fd1e0> >>> >>> web2py_version 2.9.11-stable+timestamp.2014.09.15.23.35.11 >>> >>> wsgi_multiprocess False >>> >>> wsgi.version (1, 0) >>> >>> HTTP_CACHE_CONTROL max-age=0 >>> >>> HTTP_CONTENT_TYPE multipart/form-data; >>> boundary=----WebKitFormBoundarybsXFgXJZPAWZABTt >>> >>> request_uri >>> /error/ticket/index?code=500&ticket=jestocke/127.0.0.1.2014-12-29.19-09-42.ac14c293-9460-46df-934c-d6da0579c5ac&requested_uri=%2Fjestocke%2Ffr%2Flocation%2Findex%2Fespace-de-stockage%2Fla-seyne-sur-mer%2F1&request_url=/location/index/espace-de-stockage/la-seyne-sur-mer/1 >>> >>> HTTP_ACCEPT >>> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 >>> >>> __ROUTES_ONERROR__ True >>> >>> http_connection keep-alive >>> >>> local_hosts ['Orbital Station', '::1', '::ffff:127.0.0.1', '127.0.0.1'] >>> >>> script_name >>> >>> wsgi.multiprocess False >>> >>> http_accept_encoding gzip, deflate >>> >>> __routes_onerror__ True >>> >>> PATH_INFO /error/ticket/index/ >>> >>> http_origin http://localhost:8000 >>> >>> QUERY_STRING >>> code=500&ticket=jestocke/127.0.0.1.2014-12-29.19-09-42.ac14c293-9460-46df-934c-d6da0579c5ac&requested_uri=%2Fjestocke%2Ffr%2Flocation%2Findex%2Fespace-de-stockage%2Fla-seyne-sur-mer%2F1&request_url=/location/index/espace-de-stockage/la-seyne-sur-mer/1 >>> >>> cmd_args [] >>> >>> http_accept >>> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 >>> >>> HTTP_USER_AGENT Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) >>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 >>> >>> HTTP_CONNECTION keep-alive >>> >>> REMOTE_ADDR 127.0.0.1 >>> >>> http_accept_language fr,en-US;q=0.8,en;q=0.6,de;q=0.4,ja;q=0.2 >>> >>> wsgi.url_scheme http >>> >>> is_source True >>> >>> server_port 8000 >>> >>> gluon_parent /opt/web2py-prod >>> >>> HTTP_DNT 1 >>> >>> http_content_length 672 >>> >>> wsgi.multithread True >>> >>> query_string >>> code=500&ticket=jestocke/127.0.0.1.2014-12-29.19-09-42.ac14c293-9460-46df-934c-d6da0579c5ac&requested_uri=%2Fjestocke%2Ffr%2Flocation%2Findex%2Fespace-de-stockage%2Fla-seyne-sur-mer%2F1&request_url=/location/index/espace-de-stockage/la-seyne-sur-mer/1 >>> >>> wsgi_run_once False >>> >>> wsgi.file_wrapper wsgiref.util.FileWrapper >>> >>> HTTP_ACCEPT_ENCODING gzip, deflate >>> >>> http_cache_control max-age=0 >>> >>> REMOTE_PORT 60871 >>> >>> wsgi_file_wrapper wsgiref.util.FileWrapper >>> >>> applications_parent /opt/web2py-prod >>> >>> request_method POST >>> >>> WEB2PY_ORIGINAL_URI /location/index/espace-de-stockage/la-seyne-sur-mer/1 >>> >>> SERVER_PORT 8000 >>> >>> http_content_type multipart/form-data; >>> boundary=----WebKitFormBoundarybsXFgXJZPAWZABTt >>> >>> web2py_original_uri >>> /error/ticket/index/?code=500&ticket=jestocke/127.0.0.1.2014-12-29.19-09-42.ac14c293-9460-46df-934c-d6da0579c5ac&requested_uri=%2Fjestocke%2Ffr%2Flocation%2Findex%2Fespace-de-stockage%2Fla-seyne-sur-mer%2F1&request_url=/location/index/espace-de-stockage/la-seyne-sur-mer/1 >>> >>> wsgi_multithread True >>> >>> web2py_status_code 500 >>> >>> HTTP_HOST localhost:8000 >>> >>> content_type multipart/form-data; >>> boundary=----WebKitFormBoundarybsXFgXJZPAWZABTt >>> >>> REQUEST_URI >>> /jestocke/fr/location/index/espace-de-stockage/la-seyne-sur-mer/1 >>> >>> wsgi.run_once False >>> >>> wsgi.errors <open file '<stderr>', mode 'w' at 0x10c5fd1e0> >>> >>> HTTP_ACCEPT_LANGUAGE fr,en-US;q=0.8,en;q=0.6,de;q=0.4,ja;q=0.2 >>> >>> app_folders set(['/opt/web2py-prod/applications/admin/', >>> '/opt/web2py-prod/applications/jestocke/', >>> '/opt/web2py-prod/applications/error/']) >>> >>> HTTP_CONTENT_LENGTH 672 >>> >>> debugging False >>> >>> http_user_agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) >>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 >>> >>> server_protocol HTTP/1.1 >>> >>> SERVER_NAME Orbital Station >>> >>> remote_addr 127.0.0.1 >>> >>> is_jython False >>> >>> wsgi_version (1, 0) >>> >>> wsgi_input <socket._fileobject object at 0x111d71a50> >>> >>> server_software Rocket 1.2.6 >>> >>> wsgi.input <socket._fileobject object at 0x111d71a50> >>> >>> http_host localhost:8000 >>> >>> path_info /error/ticket/index/ >>> >>> http_referer >>> http://localhost:8000/location/index/espace-de-stockage/la-seyne-sur-mer/1 >>> >>> is_pypy False >>> >>> remote_port 60871 >>> >>> db_sessions set([]) >>> >>> http_dnt 1 >>> >>> CONTENT_TYPE multipart/form-data; >>> boundary=----WebKitFormBoundarybsXFgXJZPAWZABTt >>> >>> folder /opt/web2py-prod/applications/error/ >>> >>> >>> >>> Looking at request.env.query_string, I think it's odd that >>> request._get_vars is empty (None). >>> >>> Something goes very wrong here, but I'm not sure what. >>> >>> Any idea ? >>> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.