Bug description

Cannot make custom build Superset 4.0.1, 4.0.2 from Dockerfile. docker build -t superset:test . After some stages building process stuks.

Screenshots/recordings

Step 11/42 : RUN npm ci
 ---> Running in a76b424309b6
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@sindresorhus/merge-streams@1.0.0',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'copy-webpack-plugin@12.0.2',
npm WARN EBADENGINE   required: { node: '>= 18.12.0' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'globby@14.0.0',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'unicorn-magic@0.1.0',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated topojson@1.6.27: Use topojson-client, topojson-server or topojson-simplify directly.
npm WARN deprecated tilebelt@1.0.1: This module is now under the @mapbox namespace: install @mapbox/tilebelt instead
npm WARN deprecated string-similarity@4.0.4: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated shortid@2.2.16: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated puppeteer@20.9.0: < 21.5.0 is no longer supported
npm WARN deprecated mathfn@1.2.0: Use cephes instead, for a more complete and well-tested module
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated fontsource-fira-code@4.0.0: Package relocated. Please install and migrate to @fontsource/fira-code.
npm WARN deprecated @babel/polyfill@7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated core-js@2.6.9: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated core-js@1.2.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.11: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.11: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.0: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.


Superset version

4.0.2

Python version

Not applicable

Node version

16

Browser

Not applicable

Additional context

No response

Checklist

  • [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

Hey @skemaikin! 👋 I'm here to help you with any bugs, questions, or contributions you have regarding Superset 4.0.X. I'm your friendly bot, Dosu, and I'm here to assist you while you wait for a human maintainer.

The issue you're encountering with the custom build process for Superset 4.0.1 and 4.0.2 getting stuck is due to using an unsupported Node.js version. The build process requires Node.js version 18.x, but your current setup is using Node.js version 16.20.2.

To resolve this, you should update your Dockerfile to use Node.js version 18.x. Here's a snippet from the Dockerfile.from_local_tarball that shows how to set up Node.js 18.x:

# Install nodejs for custom build
# https://nodejs.org/en/download/package-manager/
RUN set -eux; \
    curl -sL https://deb.nodesource.com/setup_18.x | bash -; \
    apt-get install -y nodejs; \
    node --version;

Make sure your Dockerfile includes this setup to ensure compatibility with the required Node.js version for Superset 4.0.1 and 4.0.2 [1].

To continue talking to Dosu, mention @dosu.

Comment From: skemaikin

@dosu if it is so, why is Dockerfile based on node:16-bookworm-slim ?

Comment From: dosubot[bot]

The official Dockerfile for Superset 4.0.X actually uses node:20-bullseye-slim for the Node stage, not node:16-bookworm-slim. This setup specifies Node.js version 20, which aligns with the recommended version for building Superset [1]. If you're seeing node:16-bookworm-slim in your Dockerfile, it might be a custom or outdated configuration. You should update it to use Node.js version 20 to ensure compatibility.

To continue talking to Dosu, mention @dosu.

Comment From: skemaikin

@dosu from the https://github.com/apache/superset/blob/4.0.2/Dockerfile:

FROM --platform=${BUILDPLATFORM} node:16-bookworm-slim AS superset-node How about this?

Comment From: dosubot[bot]

The Dockerfile you referenced indeed specifies node:16-bookworm-slim for the Node.js stage. This seems to be a discrepancy, as the official documentation for Superset 4.0.2 recommends using Node.js version 20 for building [1]. It's possible that this particular Dockerfile is intended for a specific use case or is outdated. To align with the official requirements, you should consider updating the Dockerfile to use Node.js version 20, as specified in the main Dockerfile for Superset 4.0.2 [2].

To continue talking to Dosu, mention @dosu.

Comment From: skemaikin

@dosu rising up the node.js version to the 18 or 20 leads to error building too.

Comment From: dosubot[bot]

If updating to Node.js version 18 or 20 leads to build errors, it might be due to specific dependencies or scripts in the Superset build process that are not compatible with these Node.js versions. While the official Dockerfile for Superset 4.0.2 uses Node.js 20, there might be additional configuration steps or dependency updates required to ensure compatibility.

Here are a few steps you can try:

  1. Check for Dependency Updates: Ensure all dependencies in your package.json are compatible with Node.js 18 or 20. You might need to update some packages to their latest versions.

  2. Review Build Scripts: Look into any custom build scripts or configurations that might be causing issues with newer Node.js versions.

  3. Consult Dockerfile: Make sure your Dockerfile aligns with the official one, especially regarding Node.js setup and environment configurations.

If these steps don't resolve the issue, you might need to investigate specific error messages during the build process to identify the root cause.

To continue talking to Dosu, mention @dosu.

Comment From: hainenber

@skemaikin are you still encountering stuck Docker builds for tagged releases?

Comment From: rusackas

We haven't heard back if the original author is still stuck, and docker has been improving in both performance and stability, so I'll assume this issue is no longer relevant. Happy to reopen if we're mistaken!

Comment From: blue-santa

I'm running into this issue currently.

Running on OpenMandriva Rock 6.0 x86_64 x11

Earlier tonight, this was not an issue. I was having connectivity issues within the docker container and was troubleshooting with the help of Gemini AI.

I changed the /etc/docker/daemon.json file to allow for some dns resolution, as recommended by the ai bot.

{
  "dns": ["192.168.1.1", "8.8.8.8", "8.8.4.4", "208.67.222.222", "208.67.220.220"],
  "dns-opts": ["ndots:0"]
}

I also changed the .db section of docker-compose.yml as follows. (I changed port to 5433 previously to deal with my existing postgresql installation.)

  db:
    env_file:
      - path: docker/.env # default
        required: true
      - path: docker/.env-local # optional override
        required: false
    image: postgres:16
    container_name: superset_db
    restart: unless-stopped
    ports:
      - "127.0.0.1:5433:5432"
    volumes:
      - db_home:/var/lib/postgresql/data
      - ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
    dns: 
      - 192.168.1.1
      - 8.8.8.8
      - 8.8.4.4
      - 208.67.222.222
      - 208.67.220.220

Suddenly, the issue appeared.

npm WARN EBADENGINE Unsupported engine {
  package: '@typescript-eslint/type-utils@8.19.0',
  required: { node: '^18.18.0 || ^20.9.0 || >=21.1.0' },
  current: { node: 'v16.20.2', npm: '8.19.4' }
}

Gemini AI recommended changing .../superset/superset-websocket/Dockerfile as follows

# ... (header comments) ...
FROM node:20-alpine AS build

WORKDIR /home/superset-websocket

COPY . ./

RUN npm ci && \
  npm run build


FROM node:20-alpine

# ... (rest of the Dockerfile) ...

This resulted in an inverse error.

npm warn EBADENGINE Unsupported engine {
  package: 'superset-websocket@0.0.1',
  required: { node: '^16.9.1', npm: '^7.5.4 || ^8.1.2' },
  current: { node: 'v20.19.3', npm: '10.8.2' }
}

Before this error appeared, superset only once successfully built the backend, but never successfully built the front end.

Comment From: blue-santa

It's also worth mentioning that even emptying all the relevant files that I think I've touched and attempting to build essentially from scratch does not eliminate the error now.

I've tried resetting daemon.json, recloning superset, and docker compose down -v and docker system prune -a.

Comment From: blue-santa

I rebooted my machine.

The error persisted on a renewed attempt with minimal file changes.

Only SUPERSET_LOAD_EXAMPLES=no in .env, the port in docker-compose.yml changed to 5433.

The /etc/docker/daemon.json file is empty now and the superset-websocket/Dockerfile is as per the git cloned version.

While the same EBADENGINE error did appear during the build process, the build process continued past it this time.

Unfortunately, while the backend built, the frontend did not. http://localhost:8088 shows a broken image.

When I attempt to load the page, errors like this appear in the docker compose terminal

superset_app          | Traceback (most recent call last):
superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
superset_app          |     rv = self.dispatch_request()
superset_app          |          ^^^^^^^^^^^^^^^^^^^^^^^
superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
superset_app          |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
superset_app          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 502, in <lambda>
superset_app          |     view_func=lambda **kw: self_ref().send_static_file(**kw),  # type: ignore # noqa: B950
superset_app          |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/scaffold.py", line 317, in send_static_file
superset_app          |     return send_from_directory(
superset_app          |            ^^^^^^^^^^^^^^^^^^^^
superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/helpers.py", line 557, in send_from_directory
superset_app          |     return werkzeug.utils.send_from_directory(  # type: ignore[return-value]
superset_app          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
superset_app          |   File "/app/.venv/lib/python3.11/site-packages/werkzeug/utils.py", line 575, in send_from_directory
superset_app          |     raise NotFound()
superset_app          | werkzeug.exceptions.Not

Happy to post this elsewhere or raise a new issue, if this isn't the right place for this information.

Comment From: blue-santa

I found an obvious resolution.

Background: I was attempting to install this using the website `https://superset.apache.org/docs/installation/docker-compose/ in the manner I used awhile ago on an Ubuntu machine, which was to simply run docker compose up --build.

I went back to the documentation and noticed the quickstart guide's instructions as follows:

# Enter the repository you just cloned
$ cd superset

# Set the repo to the state associated with the latest official version
$ git checkout tags/5.0.0

# Fire up Superset using Docker Compose
$ docker compose -f docker-compose-image-tag.yml up

I cleaned off the system, leaving only my changes to the postgresql.conf and pg_hba.conf for networking purposes.

On the git download, I still changed the db port to 5433 and set SUPERSET_LOAD_EXAMPLES=no.

Then I did the steps as outlined.

This did not work the first time, but I ran docker compose down -v and docker system prune -a and then ran it again.

It worked the second time. I can log into superset now.