keycloakify: RangeError [ERR_OUT_OF_RANGE] when running keycloakify

Unfortunately I can’t provide any more information at the moment. Any ideas what could be causing this? It seems to crop up sporadically inside a docker container in our CI env. I haven’t seen it happen locally, but I don’t build keycloakify locally that often so I’m not 100% it’s CI-specific.

Solution is always rebuilding the Dockerfile without the cache and no other changes.

I am on keycloakify@7.3.0


[2023-03-28T22:28:19.623Z] 🔏 Building the keycloak theme...⌚

[2023-03-28T22:28:21.626Z] RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 2031612. Received 2031636

[2023-03-28T22:28:21.626Z]     at new NodeError (node:internal/errors:387:5)

[2023-03-28T22:28:21.626Z]     at boundsError (node:internal/buffer:86:9)

[2023-03-28T22:28:21.626Z]     at Buffer.readUInt32LE (node:internal/buffer:220:5)

[2023-03-28T22:28:21.626Z]     at /opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:411:47

[2023-03-28T22:28:21.626Z]     at step (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:44:23)

[2023-03-28T22:28:21.626Z]     at Object.next (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:25:53)

[2023-03-28T22:28:21.626Z]     at step (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:29:139)

[2023-03-28T22:28:21.626Z]     at Object.next (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:25:53)

[2023-03-28T22:28:21.626Z]     at resume (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:62:44)

[2023-03-28T22:28:21.626Z]     at /opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:61:121

[2023-03-28T22:28:21.626Z]     at new Promise (<anonymous>)

[2023-03-28T22:28:21.626Z]     at Object.i.<computed> [as next] (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:61:63)

[2023-03-28T22:28:21.626Z]     at /opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:289:49

[2023-03-28T22:28:21.626Z]     at step (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:44:23)

[2023-03-28T22:28:21.626Z]     at Object.next (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:25:53)

[2023-03-28T22:28:21.626Z]     at fulfilled (/opt/ui/node_modules/keycloakify/bin/tools/downloadAndUnzip.js:16:58) {

[2023-03-28T22:28:21.626Z]   code: 'ERR_OUT_OF_RANGE'

[2023-03-28T22:28:21.626Z] }

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 18

Commits related to this issue

Most upvoted comments

Well libraries are not expected to read outside CWD, build tools on the other hand are (npm being a build tool itself). Also XDG_CACHE_HOME or XDG_CONFIG_HOME should be fair game for build tools. Also, since we’re calling npm config we could use that to exfiltrate secrets if we’d want to, so I don’t think it would make much of a difference.

We could be very upfront about that, document clearly what we’re doing here and why.

Of course we could circumvent that using keycloakify-specific config. Then maybe add some docs for suggested workarounds

export KEYCLOAKIFY_PROXY=$(npm config get proxy) && keycloakify

Wouldn’t be my first choice, but okayish

I´ll try it as soon as the new update works. If everything works, there is no need to refactor imo. If they errors concerning the unzipping stay, I built a function with the same interface using yauzl yesterday.

Ok got it, I’m very sory I asked you to work on that when there was already a fix.
Thank you for you reactivity, a new release is being published RN

I updated the starter project but I am getting another error https://github.com/keycloakify/keycloakify/issues/285

I can’t say exactly when I will be able to fix it. I will have a look today if it´s manageable. 😁

I’m verry sorry about that guys 😞

We used to rely on wget and manage cache manually. We moved to make-fetch-happen to make the tool more agnostic to the environement.
Therer’s been some hickup since, we’ll address it soon.
I think there is this PR from @lordvlad that work on this.