cgit 1.2.3: lighttpd 1.4.57, AlpineLinux [edge]: using cache breaks delivery

Steffen Nurpmeso steffen at sdaoden.eu
Mon Dec 21 20:31:27 CET 2020


Hi.

John Keeping wrote in
 <X+DiDgGaPaynnocI at john.keeping.me.uk>:
 |On Mon, Dec 21, 2020 at 05:26:19PM +0100, Steffen Nurpmeso wrote:
 |> I discovered today that cgit no longer delivers pages, and it must
 |> have been like that for some time.  The server looks show
 |> successful delivery, the cgit cache is populated and rotated just
 |> correctly, but all cgit delivers is that final error of main() as
 |> 
 |>   <div class='error'>Error processing page: Invalid argument (22)</div>
 |> 
 |> (surely a misconfiguration that this is not a real HTML page,
 |> i recall it took some time to figure out about about-filter, just
 |> "doing it" (<pre>cat(1)</pre>)).
 |> 
 |> If i set "cache-size=0" then the desired page is delivered.
 |> Note the cache itself is managed as usual with the default
 |> cache-size=1999.
 |> 
 |> The files in the cache are 0600, i thought maybe that was it, but
 |> the setting is actively reverted to this mask (i never looked at
 |> cgit code except grepping the error).  It has always been so, the
 |> oldest cache entry was
 |> 
 |>   -rw-------    1 lighttpd lighttpd      3023 Mar 18  2018 d2200000
 |> 
 |> I am pretty sure cgit delivered some weeks ago, the most notable
 |> difference is that AlpineLinux switched to Lighttpd 1.4.56 then
 |> .57, which seems to have brought tremendous changes under the
 |> hood, like HTTP/2 support and OCSP as well as support for all the
 |> different TLS libraries, whereas before it only was OpenSSL and
 |> compatibles, i think.  We have HTTP/2 not enabled yet.
 |> 
 |> Anything i can do about this?
 |
 |Have you looked at the log output?

Yes, sorry, terrible mess above. Monday and no end.

  - Logs show nothing.  I enabled
      debug.log-request-handling = "enable" 
    but that showed nothing.  But wait, there was
    server.breakagelog that was needed .. as below!

 |This error comes from cgit.c::cmd_main() as a result of
 |cache.c::cache_process() returning an error.  It looks like all of the

Yes.

 |error paths there will write a more detailed error message to stderr.

Unfortunately nothing .. but with breakaglog there is

  [cgit] error printing cache /var/lib/lighttpd/cgit/b1000000: Invalid argument (22)

But the file was generated normally:

  # ll /var/lib/lighttpd/cgit/b1000000
  -rw-------    1 lighttpd lighttpd     23417 Dec 21 20:22 /var/lib/lighttpd/cgit/b1000000

 |I don't use lighttpd so I don't know whether that output is captured,
 |but normally output written to stderr will end up in a log file.

Was server.breakagelog i had forgotten about.

 |>From a quick look at the code, given that the problem seems to be caused
 |by updating the web server, my guess is that you'll see the error:
 |
 | [cgit] error printing cache ...: Invalid argument (22)
 |
 |and this may be caused by sendfile(2) failing due to some difference in
 |how the web server is setting up the output file descriptor.  You may
 |want to rebuild CGit without HAVE_LINUX_SENDFILE and see if that works.

I did not know about 'cgi.x-sendfile = "enable"' yet, but setting
it does not matter from cgit's point of view.

 |(If it does, we should add better fallback handling for the case where
 |stdout is not a valid output for sendfile().)

Ok, i will hm do that mirroring the ArchLinux recipe and report
back.

Thanks!

 |John
 --End of <X+DiDgGaPaynnocI at john.keeping.me.uk>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the CGit mailing list