We have an internal HAProxy which for convenience I built a users registration in using LUA and that LUA uses io.popen calls. One popen is for running a qrencode command to generate a QR code and one to invoke sendmail to send an email.
This worked perfectly on HAProxy 1.8. The registrations are few and far between, maybe one a week so is not disruptive to the throughput of HAProxy.
But on version 2.7.3 the io.popen calls fail.
Here is an instance of the qrgencode failing:-
[ALERT] (27580) : Lua applet http '<lua.enroll_qr>': [state-id 0] runtime error: /etc/haproxy/enroll.lua:554: /usr/bin/qrencode "otpauth://totp/IRR:waded?secret=JDDKTUYDNCYLKCVY&issuer=IRR" -o -: Resource temporarily unavailable from [C]: in global 'assert', /etc/haproxy/enroll.lua:554: in function line 543.
We get the same “Resource temporarily unavailable from [C]: in global ‘assert’” when trying to use sendmail as well.
Now of course I did look at the doco and see that basically io.* is prohibited in version 2.7.
Now I understand in an async world you/we want to avoid blocking, even if only for a very short time, and what I have implemented is somewhat unusual. Yes I can replace the qrgencode with a Javascript library, but the sending of the email for my process has to stay server side.
Is there any way to make the io.popen calls work in 2.7.3 ?
If not I guess I will have to make HTTP calls from the LUA to a service elsewhere to do this work as I understand that does work in an async manor.