# Haproxy 1.8 Update to 2.7.3 LUA Issues

**URL:** <https://discourse.haproxy.org/t/haproxy-1-8-update-to-2-7-3-lua-issues/8454>\
**Category:** Lua Scripts\
**Created:** [March 2, 2023, 7:50am UTC](https://discourse.haproxy.org/t/haproxy-1-8-update-to-2-7-3-lua-issues/8454 "2023-03-02T07:50:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidwade](https://avatars.discourse-cdn.com/v4/letter/d/df705f/32.png) [@davidwade](https://discourse.haproxy.org/u/davidwade)\
**Post date:** [March 2, 2023, 7:50am UTC](https://discourse.haproxy.org/t/haproxy-1-8-update-to-2-7-3-lua-issues/8454/1 "2023-03-02T07:50:37Z")

</div>

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:-

```auto
[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.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 2, 2023, 8:24am UTC](https://discourse.haproxy.org/t/haproxy-1-8-update-to-2-7-3-lua-issues/8454/2 "2023-03-02T08:24:25Z")

</div>

> [@davidwade](#):
>
> Is there any way to make the io.popen calls work in 2.7.3 ?

No.

> [@davidwade](#):
>
> 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.

That is correct and the way to go here.

---

<div class="post-metadata">

**Author:** ![davidwade](https://avatars.discourse-cdn.com/v4/letter/d/df705f/32.png) [@davidwade](https://discourse.haproxy.org/u/davidwade)\
**Post date:** [March 2, 2023, 8:26am UTC](https://discourse.haproxy.org/t/haproxy-1-8-update-to-2-7-3-lua-issues/8454/3 "2023-03-02T08:26:22Z")

</div>

Now I know. Thanks for prompt answer.

😄
