<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hi</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Thanks for the report and the test
case.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Yes, that comment is wrong. It didn't
consider that if the page number is too high, the resulting page
will be empty even though the first page isn't.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I propose fixing it with
<a class="moz-txt-link-freetext" href="https://kallithea-scm.org/repos/kallithea-incoming/changeset/0ff78683c8730a454b9df805afe3766eebfa5a62">https://kallithea-scm.org/repos/kallithea-incoming/changeset/0ff78683c8730a454b9df805afe3766eebfa5a62</a></div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">/Mads</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 2/1/21 4:45 PM, Brett Smith wrote:<br>
</div>
<blockquote type="cite"
cite="mid:4864b666-7885-0f84-0e0b-cac67332663f@sfconservancy.org">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p>Hi all,</p>
<p>I got this crash report from the server at k.sfconservancy.org
over the weekend, and the comment in the last line jumped out at
me. It sounds like there's a situation where the code assumes a
list can't be empty, but in fact it can be. The full details are
below, except I've removed bits that just reveal too much about
our server setup or the visitor.</p>
<p>You're welcome to browse around or clone the repository if it
helps you debug the problem; it's all public.<br>
</p>
<p><br>
</p>
<div class="moz-forward-container">
<pre>TRACEBACK:</pre>
<pre>Traceback (most recent call last):</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/tg/appwrappers/session.py", line 71, in __call__</pre>
<pre> response = self.next_handler(controller, environ, context)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/tg/appwrappers/i18n.py", line 71, in __call__</pre>
<pre> return self.next_handler(controller, environ, context)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/tg/wsgiapp.py", line 243, in _dispatch</pre>
<pre> return controller(environ, context)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/kallithea/lib/base.py", line 536, in __call__</pre>
<pre> return super(BaseController, self).__call__(environ, context)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/tg/controllers/dispatcher.py", line 118, in __call__</pre>
<pre> response = self._perform_call(context)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/tg/controllers/dispatcher.py", line 107, in _perform_call</pre>
<pre> r = self._call(action, params, remainder=remainder, context=context)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/tg/controllers/decoratedcontroller.py", line 129, in _call</pre>
<pre> output = controller_caller(context_config, bound_controller_callable, remainder, params)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/tg/controllers/decoration.py", line 21, in _decorated_controller_caller</pre>
<pre> return application_controller_caller(tg_config, controller, remainder, params)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/tg/configurator/components/dispatch.py", line 114, in _call_controller</pre>
<pre> return controller(*remainder, **params)</pre>
<pre> File "<decorator-gen-4>", line 2, in index</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/kallithea/lib/auth.py", line 608, in __wrapper</pre>
<pre> return func(*fargs, **fkwargs)</pre>
<pre> File "<decorator-gen-3>", line 2, in index</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/kallithea/lib/auth.py", line 657, in __wrapper</pre>
<pre> return func(*fargs, **fkwargs)</pre>
<pre> File "/usr/local/src/kallithea/lib/python3.7/site-packages/kallithea/controllers/changelog.py", line 148, in index</pre>
<pre> c.first_revision = c.cs_pagination[0] # pagination is never empty here!</pre>
<pre>IndexError: list index out of range</pre>
<pre>ENVIRON:</pre>
<pre> HTTP_ACCEPT: '*/*'</pre>
<pre> HTTP_ACCEPT_CHARSET: 'utf-8;q=0.7,iso-8859-1;q=0.2,*;q=0.1'</pre>
<pre> HTTP_CONNECTION: 'Keep-Alive'</pre>
<pre> HTTP_HOST: 'k.sfconservancy.org'</pre>
<pre> HTTP_USER_AGENT: 'Mozilla/5.0 (compatible; DotBot/1.1; <a class="moz-txt-link-freetext" href="http://www.opensiteexplorer.org/dotbot" moz-do-not-send="true">http://www.opensiteexplorer.org/dotbot</a>, <a class="moz-txt-link-abbreviated" href="mailto:help@moz.com" moz-do-not-send="true">help@moz.com</a>)</pre>
<pre> PATH_INFO: '/website/changelog/49c5bca7430b19dd09e0e12d2b908b86d278d325/www/conservancy/static/supporter/index.html'</pre>
<pre> QUERY_STRING: 'page=2'</pre>
<pre> REQUEST_METHOD: 'GET'</pre>
<pre> SCRIPT_NAME: ''</pre>
<pre> SERVER_PROTOCOL: 'HTTP/1.1'</pre>
<pre> SERVER_SOFTWARE: 'waitress'</pre>
<pre>WSGI:</pre>
<pre> beaker.session: {'_domain': None, '_path': '/', '_accessed_time': 1612166635.5476, '_creation_time': 1612166635.5476}</pre>
<pre> pylons.routes_dict: {'repo_name': 'website', 'revision': '49c5bca7430b19dd09e0e12d2b908b86d278d325', 'f_path': 'www/conservancy/static/supporter/index.html', 'action': 'index', 'controller': 'changelog'}</pre>
<pre> tg.routes_dict: {'repo_name': 'website', 'revision': '49c5bca7430b19dd09e0e12d2b908b86d278d325', 'f_path': 'www/conservancy/static/supporter/index.html', 'action': 'index', 'controller': 'changelog'}</pre>
<pre> webob._parsed_query_vars: (GET([('page', '2')]), 'page=2')</pre>
<pre> webob.adhoc_attrs: {'authuser': <AuthUser 1: 'default'>, 'ip_addr': '[redacted]', 'needs_csrf_check': False, 'routes_local': {'mapper': <kallithea.config.routing.Mapper object at 0x7f5d38459390>, 'host': 'k.sfconservancy.org', 'protocol': 'https', 'redirect': <function redirect at 0x7f5d3aff8b70>}}</pre>
<pre> wsgi.input_terminated: True</pre>
<pre> wsgi.multiprocess: False</pre>
<pre> wsgi.multithread: True</pre>
<pre> wsgi.run_once: False</pre>
<pre> wsgi.url_scheme: 'https'</pre>
<pre> wsgi.version: (1, 0)</pre>
<pre> wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7f5d306a8668>, {'repo_name': 'website', 'revision': '49c5bca7430b19dd09e0e12d2b908b86d278d325', 'f_path': 'www/conservancy/static/supporter/index.html', 'action': 'index', 'controller': 'changelog'})</pre>
<pre>REQUEST:</pre>
<pre> <Request at 0x7f5d30575cf8 GET <a class="moz-txt-link-freetext" href="https://k.sfconservancy.org/error/document?page=2" moz-do-not-send="true">https://k.sfconservancy.org/error/document?page=2</a>></pre>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
kallithea-general mailing list
<a class="moz-txt-link-abbreviated" href="mailto:kallithea-general@sfconservancy.org">kallithea-general@sfconservancy.org</a>
<a class="moz-txt-link-freetext" href="https://lists.sfconservancy.org/mailman/listinfo/kallithea-general">https://lists.sfconservancy.org/mailman/listinfo/kallithea-general</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>