Skip to content
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ All notable changes to this project will be documented in this file.
- hbase: replace `sed` calls with `config-utils template` where possible ([#1301]).
- superset: Fix the 4.1.2 build when building from source ([#1309])
- superset: Pin `luxon` to version 3.6.1 to fix build ([#1315], [#1316])
- nifi: Use a patched version of logback to fix corrupted logs ([#1314])

### Fixed

Expand Down Expand Up @@ -107,6 +108,7 @@ All notable changes to this project will be documented in this file.
[#1308]: https://github.com/stackabletech/docker-images/pull/1308
[#1309]: https://github.com/stackabletech/docker-images/pull/1309
[#1311]: https://github.com/stackabletech/docker-images/pull/1311
[#1314]: https://github.com/stackabletech/docker-images/pull/1314
[#1315]: https://github.com/stackabletech/docker-images/pull/1315
[#1316]: https://github.com/stackabletech/docker-images/pull/1316

Expand Down
7 changes: 7 additions & 0 deletions nifi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ARG GIT_SYNC_VERSION

FROM oci.stackable.tech/sdp/git-sync/git-sync:${GIT_SYNC_VERSION} AS git-sync-image

FROM local-image/shared/logback AS patched-logback

FROM local-image/java-devel AS nifi-builder

ARG PRODUCT_VERSION
Expand All @@ -23,8 +25,12 @@ WORKDIR /stackable
COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/patches/patchable.toml /stackable/src/nifi/stackable/patches/patchable.toml
COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/patches/${PRODUCT_VERSION} /stackable/src/nifi/stackable/patches/${PRODUCT_VERSION}
COPY --chown=${STACKABLE_USER_UID}:0 --from=git-sync-image /git-sync /stackable/git-sync
COPY --chown=${STACKABLE_USER_UID}:0 --from=patched-logback /stackable/.m2/repository /stackable/patched-logback-libs

RUN <<EOF
mkdir -p /stackable/.m2/repository
cp -r /stackable/patched-logback-libs/* /stackable/.m2/repository

# This used to be located in /bin/stackable-bcrypt.jar. We create a softlink for /bin/stackable-bcrypt.jar in the main container for backwards compatibility.
curl 'https://repo.stackable.tech/repository/m2/tech/stackable/nifi/stackable-bcrypt/1.0-SNAPSHOT/stackable-bcrypt-1.0-20240508.153334-1-jar-with-dependencies.jar' \
-o /stackable/stackable-bcrypt.jar
Expand Down Expand Up @@ -185,6 +191,7 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackab
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.cdx.json /stackable/nifi-${PRODUCT_VERSION}-stackable${RELEASE_VERSION}/lib/
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*-src.tar.gz /stackable
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/git-sync /stackable/git-sync
COPY --chown=${STACKABLE_USER_UID}:0 --from=patched-logback /stackable/*-src.tar.gz /stackable

COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/opa-authorizer.nar /stackable/nifi-${PRODUCT_VERSION}-stackable${RELEASE_VERSION}/extensions/opa-authorizer.nar
COPY --chown=${STACKABLE_USER_UID}:0 --from=opa-authorizer-builder /stackable/nifi-opa-plugin-${NIFI_OPA_AUTHORIZER_PLUGIN_VERSION}-src.tar.gz /stackable
Expand Down
4 changes: 4 additions & 0 deletions nifi/boil-config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[versions."1.27.0".local-images]
java-base = "11"
java-devel = "11"
"shared/logback" = "1.3.14"

[versions."1.27.0".build-arguments]
git-sync-version = "v4.4.1"
Expand All @@ -11,6 +12,7 @@ nifi-opa-authorizer-plugin-version = "0.3.0"
[versions."1.28.1".local-images]
java-base = "11"
java-devel = "11"
"shared/logback" = "1.3.14"

[versions."1.28.1".build-arguments]
git-sync-version = "v4.4.1"
Expand All @@ -21,6 +23,7 @@ nifi-opa-authorizer-plugin-version = "0.3.0"
[versions."2.4.0".local-images]
java-base = "21"
java-devel = "21"
"shared/logback" = "1.5.18"

[versions."2.4.0".build-arguments]
git-sync-version = "v4.4.1"
Expand All @@ -34,6 +37,7 @@ nifi-iceberg-bundle-version = "0.0.5"
[versions."2.6.0".local-images]
java-base = "21"
java-devel = "21"
"shared/logback" = "1.5.18"

[versions."2.6.0".build-arguments]
git-sync-version = "v4.4.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 1fe22dcc974b52d83b8288d5279c3aa8c41a1243 Mon Sep 17 00:00:00 2001
From: dervoeti <[email protected]>
Date: Wed, 22 Oct 2025 15:27:29 +0200
Subject: fix: pin esbuild to fix NiFi 2.6.0 build

For some reason, npm tries to use a newer version of esbuild than the version in the lock file. I suspect this might be related to how npm handles optional dependencies in lock files. The esbuild version is set to 0.25.10 now to prevent npm from trying to select a newer version, so that the same packages as in the original NiFi build are used.
---
nifi-frontend/src/main/frontend/package.json | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/nifi-frontend/src/main/frontend/package.json b/nifi-frontend/src/main/frontend/package.json
index ee125e7663..6914c5f00c 100644
--- a/nifi-frontend/src/main/frontend/package.json
+++ b/nifi-frontend/src/main/frontend/package.json
@@ -114,10 +114,11 @@
"vite": "^5.4.6",
"underscore": "1.13.6",
"rollup": "4.22.4",
- "esbuild": "^0.25.8",
+ "esbuild": "0.25.10",
"koa": "^2.16.1"
},
"overrides": {
- "koa": "^2.16.1"
+ "koa": "^2.16.1",
+ "esbuild": "0.25.10"
}
}
23 changes: 23 additions & 0 deletions shared/logback/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# syntax=docker/dockerfile:1.15.1@sha256:9857836c9ee4268391bb5b09f9f157f3c91bb15821bb77969642813b0d00518d
# check=error=true

FROM local-image/java-devel AS builder

ARG PRODUCT_VERSION
ARG RELEASE_VERSION
ARG STACKABLE_USER_UID

COPY --chown=${STACKABLE_USER_UID}:0 shared/logback/stackable/patches/patchable.toml /stackable/src/shared/logback/stackable/patches/patchable.toml
COPY --chown=${STACKABLE_USER_UID}:0 shared/logback/stackable/patches/${PRODUCT_VERSION} /stackable/src/shared/logback/stackable/patches/${PRODUCT_VERSION}

USER ${STACKABLE_USER_UID}
WORKDIR /stackable

RUN <<EOF
cd "$(/stackable/patchable --images-repo-root=src checkout shared/logback ${PRODUCT_VERSION})"

# Create snapshot of the source code including custom patches
tar -czf /stackable/logback-${PRODUCT_VERSION}-src.tar.gz .

mvn --batch-mode --no-transfer-progress clean install -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
EOF
5 changes: 5 additions & 0 deletions shared/logback/boil-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[versions."1.3.14".local-images]
java-devel = "21"

[versions."1.5.18".local-images]
java-devel = "21"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 2ee74eaf5645576ec0a604941591c9ae09a92a43 Mon Sep 17 00:00:00 2001
From: dervoeti <[email protected]>
Date: Wed, 22 Oct 2025 11:13:02 +0200
Subject: fix: move StringBuilder into function to prevent race conditions

---
.../java/ch/qos/logback/classic/log4j/XMLLayout.java | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java b/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
index 4bc04388a..405f4ef26 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
@@ -38,9 +38,7 @@ import ch.qos.logback.core.helpers.Transform;
public class XMLLayout extends LayoutBase<ILoggingEvent> {

private final int DEFAULT_SIZE = 256;
- private final int UPPER_LIMIT = 2048;

- private StringBuilder buf = new StringBuilder(DEFAULT_SIZE);
private boolean locationInfo = false;
private boolean properties = false;

@@ -96,13 +94,7 @@ public class XMLLayout extends LayoutBase<ILoggingEvent> {
*/
public String doLayout(ILoggingEvent event) {

- // Reset working buffer. If the buffer is too large, then we need a new
- // one in order to avoid the penalty of creating a large array.
- if (buf.capacity() > UPPER_LIMIT) {
- buf = new StringBuilder(DEFAULT_SIZE);
- } else {
- buf.setLength(0);
- }
+ StringBuilder buf = new StringBuilder(DEFAULT_SIZE);

// We yield to the \r\n heresy.

2 changes: 2 additions & 0 deletions shared/logback/stackable/patches/1.3.14/patchable.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mirror = "https://github.com/stackabletech/logback.git"
base = "39fc5461e7a8e15ce9ecd9f148f67f701aed88ad"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 174aa552f3f1fc03dcce3b37f24993b77b90ab71 Mon Sep 17 00:00:00 2001
From: dervoeti <[email protected]>
Date: Fri, 17 Oct 2025 12:07:51 +0200
Subject: fix: move StringBuilder into function to prevent race conditions

---
.../java/ch/qos/logback/classic/log4j/XMLLayout.java | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java b/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
index 4bc04388a..405f4ef26 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
@@ -38,9 +38,7 @@ import ch.qos.logback.core.helpers.Transform;
public class XMLLayout extends LayoutBase<ILoggingEvent> {

private final int DEFAULT_SIZE = 256;
- private final int UPPER_LIMIT = 2048;

- private StringBuilder buf = new StringBuilder(DEFAULT_SIZE);
private boolean locationInfo = false;
private boolean properties = false;

@@ -96,13 +94,7 @@ public class XMLLayout extends LayoutBase<ILoggingEvent> {
*/
public String doLayout(ILoggingEvent event) {

- // Reset working buffer. If the buffer is too large, then we need a new
- // one in order to avoid the penalty of creating a large array.
- if (buf.capacity() > UPPER_LIMIT) {
- buf = new StringBuilder(DEFAULT_SIZE);
- } else {
- buf.setLength(0);
- }
+ StringBuilder buf = new StringBuilder(DEFAULT_SIZE);

// We yield to the \r\n heresy.

2 changes: 2 additions & 0 deletions shared/logback/stackable/patches/1.5.18/patchable.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mirror = "https://github.com/stackabletech/logback.git"
base = "b2a02f065379a9b1ba5ff837fc08913b744774bc"
2 changes: 2 additions & 0 deletions shared/logback/stackable/patches/patchable.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
upstream = "https://github.com/qos-ch/logback.git"
default-mirror = "https://github.com/stackabletech/logback.git"