Skip to content

fix(controller): install rocks by URL, bypassing the luarocks index - #6

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix/luarocks-manifest-bypass
Aug 25, 2026
Merged

Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix/luarocks-manifest-bypass

Conversation

@kvaps

Copy link
Copy Markdown
Member

What this does

The controller image has not built since March. Every attempt dies on luarocks install lua-protobuf 0.4.1-1 with Error: No results matching query were found., which reads like the rock was withdrawn — it was not. 0.4.1-1 is still published, and the same failure hits lua-iconv and every other query.

The cause is upstream of this repo. luarocks resolves a name through the luarocks.org index, and that index has grown past what LuaJIT can compile:

Failed loading manifest for https://luarocks.org/...:
main function has more than 65536 constants

65536 constants per function is a hard LuaJIT limit, so no client can load the index any more and every lookup returns nothing. Nothing here rotted — the ecosystem moved out from under a Dockerfile that had been fine for years, which is why the build broke with no commit to blame and stayed broken quietly.

What was ruled out first

  • Bumping LUA_ROCKS_VER. 3.11.1 fails identically to 3.0.0. The newer client just reports it better.
  • busybox vs GNU wget. A real difference — luarocks invokes wget with --no-cache, --tries and --timestamping, none of which busybox supports — but fixing it only changes the error message, because the index still cannot be loaded.

The fix

Installing from a rockspec URL skips the index entirely. Two things follow:

  • git joins the build deps, because the rockspecs fetch their sources from git rather than a source tarball.
  • lua-iconv moves from 7-3 to 7.1.0-1. The 7-3 rockspec points at github.com/downloads/ittner/lua-iconv/..., and GitHub removed the /downloads/ scheme years ago, so that version is unfetchable by anyone regardless of the index. 7.1.0-1 builds from a live git tag.

Verified in registry.k8s.io/ingress-nginx/controller:v1.11.5, the image this Dockerfile builds on: both rocks install.

What this does not do

Merging this rebuilds nothing. The workflow fires on tag pushes and names the image after the tag, so v1.11.5 has to be re-pointed at the fixed commit before a working controller:v1.11.5 exists.

That matters downstream: controller:v1.11.5 currently resolves to a build dated 2025-03-26, whose nginx.tmpl calls buildHTTP3Listener — a function no v1.11.5 binary defines. Go binds template functions at parse time, so the {{ if $cfg.UseHTTP3 }} guard does not help and the controller crash-loops on a default config. cozystack/cozystack#3798 pins that digest and is blocked on it.

The controller image has not built since March. Every attempt dies on

    luarocks install lua-protobuf 0.4.1-1
    Error: No results matching query were found.

which reads like the rock was withdrawn. It was not: 0.4.1-1 is still
published, and the same failure hits lua-iconv and every other query.

The cause is upstream of us. luarocks resolves a name through the
luarocks.org index, and that index has grown past what LuaJIT can
compile:

    Failed loading manifest for https://luarocks.org/...:
    main function has more than 65536 constants

65536 constants per function is a hard LuaJIT limit, so no client can
load the index any more and every lookup returns nothing. Nothing here
rotted; the ecosystem moved out from under a Dockerfile that had been
fine for years, which is why the build broke with no commit to blame.

Bumping LUA_ROCKS_VER does not help — 3.11.1 fails identically. Nor does
swapping busybox wget for GNU wget, though that difference is real:
luarocks invokes wget with --no-cache, --tries and --timestamping, none
of which busybox supports. Fixing that only changes the error message.

Installing from a rockspec URL skips the index entirely, which is the
actual fix. Two things follow from it:

  * git joins the build deps, because the rockspecs fetch their sources
    from git rather than a tarball.

  * lua-iconv moves from 7-3 to 7.1.0-1. The 7-3 rockspec points at
    github.com/downloads/ittner/lua-iconv/..., and GitHub removed the
    /downloads/ scheme years ago, so that version cannot be fetched by
    anyone regardless of the index. 7.1.0-1 builds from a live git tag.

Verified in registry.k8s.io/ingress-nginx/controller:v1.11.5, the image
this Dockerfile builds on: both rocks install.

Note that merging this rebuilds nothing on its own. The workflow fires
on tag pushes and names the image after the tag, so v1.11.5 has to be
re-pointed at the fixed commit before a working controller:v1.11.5
exists.

Signed-off-by: Andrei Kvapil <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7bd52473-dfd5-47ea-a0c4-916f3afd6204


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@myasnikovdaniil
myasnikovdaniil marked this pull request as ready for review August 25, 2026 13:20

@myasnikovdaniil myasnikovdaniil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kvaps
Andrei Kvapil (kvaps) merged commit fdc9ca7 into main Aug 25, 2026
2 checks passed
Andrei Kvapil (kvaps) added a commit to cozystack/cozystack that referenced this pull request Aug 25, 2026
The controller digest this pinned was a build dated 2025-03-26, whose
nginx.tmpl calls buildHTTP3Listener — a function no v1.11.5 binary
defines. Go binds template functions at parse time, so the
{{ if $cfg.UseHTTP3 }} guard around it does not help and the controller
crash-loops on a default config, serving no webhook at all.

The tag pointed at that image because the controller had not been built
since March: the build in the fork failed on a luarocks step, and the
cause was outside the repository. luarocks resolves a rock name through
the luarocks.org index, and that index has grown past LuaJIT's hard
limit of 65536 constants per function, so no client can load it and
every lookup returns "No results matching query were found". Neither a
luarocks bump nor GNU wget fixes that; installing from a rockspec URL,
which skips the index, does. Fixed in
cozystack/ingress-nginx-with-protobuf-exporter#6 and the v1.11.5 tag
re-pointed at it.

Verified in the rebuilt image: zero references to buildHTTP3Listener,
and both lua-protobuf and lua-iconv present — the rocks this fork exists
to add.

The exporter is re-pinned in the same commit rather than separately. It
had drifted a build ahead of its tag before this rebuild, and refreshing
one half alone would leave the PR looking updated while the controller
was still the March build.

Signed-off-by: Andrei Kvapil <[email protected]>
Andrei Kvapil (kvaps) added a commit to cozystack/cozystack that referenced this pull request Sep 7, 2026
The controller digest this pinned was a build dated 2025-03-26, whose
nginx.tmpl calls buildHTTP3Listener — a function no v1.11.5 binary
defines. Go binds template functions at parse time, so the
{{ if $cfg.UseHTTP3 }} guard around it does not help and the controller
crash-loops on a default config, serving no webhook at all.

The tag pointed at that image because the controller had not been built
since March: the build in the fork failed on a luarocks step, and the
cause was outside the repository. luarocks resolves a rock name through
the luarocks.org index, and that index has grown past LuaJIT's hard
limit of 65536 constants per function, so no client can load it and
every lookup returns "No results matching query were found". Neither a
luarocks bump nor GNU wget fixes that; installing from a rockspec URL,
which skips the index, does. Fixed in
cozystack/ingress-nginx-with-protobuf-exporter#6 and the v1.11.5 tag
re-pointed at it.

Verified in the rebuilt image: zero references to buildHTTP3Listener,
and both lua-protobuf and lua-iconv present — the rocks this fork exists
to add.

The exporter is re-pinned in the same commit rather than separately. It
had drifted a build ahead of its tag before this rebuild, and refreshing
one half alone would leave the PR looking updated while the controller
was still the March build.

Signed-off-by: Andrei Kvapil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants