Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Required node version in packages.json from release tar.gz so old I cannot build kibana for Archlinux users anymore. #193648

Open
ipaqmaster opened this issue Sep 21, 2024 · 0 comments
Labels
bug Fixes for quality problems that affect the customer experience needs-team Issues missing a team label

Comments

@ipaqmaster
Copy link

Kibana version:

kibana-8.15.1

Elasticsearch version:

NA

Server OS version:

Archlinux, kernel 6.6.51-1-lts

Browser version:

NA

Browser OS version:

NA

Original install method (e.g. download page, yum, from source, etc.):

Download from the releases bar on the right of this repository

Describe the bug:

No sane way to build and package Kibana on Archlinux. I currently maintain the Arch User Repository package for Kibana which takes the tar.gz release from this repository and in a set of instructions, extracts it and bundles it and some service files into an installable package. The package manager can then install this and you can start the kibana service. Very clean ,very easy.

The past quarter year this has stopped working. (See #188498) When starting the kibana service it immediately throws Error: Cannot find module 'require-in-the-middle' which tells me some node module is no longer included in the tar.gz or something else has gone horribly out of check (Perhaps this module was part of a node package on this distro which has been replaced with a newer one. Or something)

I've been trying to have this package simply get the node modules itself but trying to do this has been nothing but headache. The extracted tarball wants to use Node 20.15.1 according to package.json and this is a rolling release distro so the packaged nodejs is a current version: 22.9.0. There is the option of the nodejs-lts-iron package in the extra repository (extra/nodejs-lts-iron) which is version 20.17.0 which still doesn't match but this is the closest official package I can use compared with the version desired in package.json.


Trying yarn kbn bootstrap throws

$ yarn kbn bootstrap
yarn run v1.22.22
error kibana@8.15.1: The engine "node" is incompatible with this module. Expected version "20.15.1". Got "20.17.0"
error Commands cannot run with an incompatible environment.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Trying npm install throws:

$ npm install
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: kibana@8.15.1
npm error Found: react-router-dom@5.3.4
npm error node_modules/react-router-dom
npm error   react-router-dom@"^5.3.4" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react-router-dom@">=6.0.0" from @elastic/apm-rum-react@2.0.3
npm error node_modules/@elastic/apm-rum-react
npm error   @elastic/apm-rum-react@"^2.0.3" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/username/.npm/_logs/2024-09-21T02_32_35_834Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/username/.npm/_logs/2024-09-21T02_32_35_834Z-debug-0.log

and throws additional errors when trying --force or --legacy-peer-deps as suggested in the error output.


I have attempted countless and aimless workarounds for this. Even trying sed -i 's/20.15.1/20.17.0/g' package.json and trying yarn kbn bootstrap again which fails due to attempting to write to the system top level directories instead of relatively to this extracted tarball (Where I want to put them to include them in packaging):

$ yarn kbn bootstrap
yarn run v1.22.22
$ node scripts/kbn bootstrap
info installing Bazel tools
ff ERROR  [bootstrap] failed: [npm] exitted with 243:
          output:
            npm error code EACCES
            npm error syscall mkdir
            npm error path /usr/lib/node_modules/@bazel
            npm error errno -13
            npm error Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/@bazel'

There does not seem to be a flag for changing this to bootstrap node_modules in this relative path! (For building the modules into the package).

Upon trying yarn install with the same sed version overwrite I get some success with a lot of warnings and the kibana package build successfully.

But upon installing the package and running the kibana service it fails with: Error: Cannot find module './polyfill' !


My next step would be to painstakingly trace scripts/kbn and figure out how to relatively install them myself but I wanted to make this issue before getting to that point in a week's time. But I get the feeling yarn install already took care of the missing pieces of node_packages -- I'm hoping there's a simple way to fix this polyfill issue as seen in the sed+yarn-install route I took. But I'm at a point where time is being wasted and kibana does not have a working package for the current version for Archlinux users, which I would rather not be the case.

Steps to reproduce:

  1. Please see above troubleshooting

Expected behavior:

Being able to build a working kibana package for Archlinux users from this tar.gz release. (This is what I do, but as of a few months ago modules are missing on startup and trying to hack slash and build the node_modules with the tarball and a supported nodejs release fails every way I slice it)

Screenshots (if relevant):

NA

Errors in browser console (if relevant):

NA

Provide logs and/or server output (if relevant):

Any additional context:

I'm not the best with software written with node and the familiar cli programs for preparing to run a project but I've tried what I've tried detailing above (And a lot more trust me) to try and get this working with no luck.

I'm trying to to rely on nvm because it's not in the official repositories for Archlinux so anyone trying to also build the kibana Archlinux User Repository package I maintain here would have to rely on it too.

@ipaqmaster ipaqmaster added the bug Fixes for quality problems that affect the customer experience label Sep 21, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Sep 21, 2024
@ipaqmaster ipaqmaster changed the title How are we supposed to package Kibana for Archlinux? -- node version in package.json is no longer supported plus countless build issues. Required node version in packages.json from release tar.gz so old I cannot build kibana for Archlinux users anymore. Sep 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Fixes for quality problems that affect the customer experience needs-team Issues missing a team label
Projects
None yet
Development

No branches or pull requests

1 participant