AH02483: lua: Lua handler 'handle' did not return a value, assuming apache2.OK (mod_lua)
Kumaresan S <[email protected]> Fri, 17 Jul 2026 05:25:30 +0000
| Newsgroups | gmane.comp.apache.user |
|---|---|
| Message-ID | <KL1PR03MB7741C764D9643B6B57478020DEC62@KL1PR03MB7741.apcprd03.prod.outlook.com> |
--_000_KL1PR03MB7741C764D9643B6B57478020DEC62KL1PR03MB7741apcp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello Apache HTTP Server Community,
I am seeking clarification regarding a warning generated by mod_lua in Apac=
he HTTP Server.
Environment
-----------
- Apache HTTP Server: 2.4.37
- Operating System: RHEL 8.x
- Lua Version: 5.3
- Module: mod_lua
Background
----------
I have implemented a Lua handler (nonce.lua) using LuaMapHandler to generat=
e a Content Security Policy (CSP) nonce for each request. The handler reads=
index.html, replaces the nonce placeholder, sets the appropriate CSP respo=
nse header, and serves the modified HTML.
The application is functioning as expected:
- The webpage loads successfully.
- The CSP nonce is generated correctly.
- The Content-Security-Policy header is set correctly.
- There are no functional issues observed.
However, Apache logs the following warning for every request:
AH02483: lua: Lua handler handle in /var/www/nonce.lua did not return a val=
ue, assuming apache2.OK
My Lua handler completes successfully but does not explicitly return a valu=
e.
My questions are:
1. Is this warning expected behavior when the Lua handler does not explicit=
ly return a status code?
2. Is it recommended to explicitly return `apache2.OK` (or another Apache s=
tatus code) at the end of the handler to avoid this warning?
3. Could leaving the handler without an explicit return have any side effec=
ts or is it purely an informational warning?
4. Is there a recommended best practice for LuaMapHandler implementations r=
egarding return values?
If needed, I can provide:
- Apache error log
- Apache module information
Thank you for your time and guidance.
Best regards,
Kumaresan S
--_000_KL1PR03MB7741C764D9643B6B57478020DEC62KL1PR03MB7741apcp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
color: rgb(0, 0, 0);">
Hello Apache HTTP Server Community,</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am seeking clarification regarding a warning generated by mod_lua in Apac=
he HTTP Server.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Environment</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-----------</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- Apache HTTP Server: 2.4.37</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- Operating System: RHEL 8.x</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- Lua Version: 5.3</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- Module: mod_lua</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Background</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
----------</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have implemented a Lua handler (nonce.lua) using LuaMapHandler to generat=
e a Content Security Policy (CSP) nonce for each request. The handler reads=
index.html, replaces the nonce placeholder, sets the appropriate CSP respo=
nse header, and serves the modified
HTML.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The application is functioning as expected:</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- The webpage loads successfully.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- The CSP nonce is generated correctly.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- The Content-Security-Policy header is set correctly.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- There are no functional issues observed.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
However, Apache logs the following warning for every request:</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
AH02483: lua: Lua handler handle in /var/www/nonce.lua did not return a val=
ue, assuming apache2.OK</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
My Lua handler completes successfully but does not explicitly return a valu=
e.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
My questions are:</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
1. Is this warning expected behavior when the Lua handler does not explicit=
ly return a status code?</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2. Is it recommended to explicitly return `apache2.OK` (or another Apache s=
tatus code) at the end of the handler to avoid this warning?</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
3. Could leaving the handler without an explicit return have any side effec=
ts or is it purely an informational warning?</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
4. Is there a recommended best practice for LuaMapHandler implementations r=
egarding return values?</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If needed, I can provide:</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- Apache error log</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- Apache module information</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you for your time and guidance.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best regards,</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
color: rgb(0, 0, 0);">
Kumaresan S</div>
<div class=3D"elementToProof">
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
</div>
</body>
</html>
--_000_KL1PR03MB7741C764D9643B6B57478020DEC62KL1PR03MB7741apcp_--