elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.57k stars 8.09k forks source link

Installing Kibana in a container using Ubuntu 20.04.6 LTS image has a "adduser" dependency in kibana.postinst script #182537

Closed indeed-ted closed 1 month ago

indeed-ted commented 3 months ago

Kibana version: 8.13.2-amd64.deb

Elasticsearch version: N/A

Server OS version: Ubuntu 20.04.6 LTS

Browser version: N/A

Browser OS version: N/A

Original install method (e.g. download page, yum, from source, etc.): apt in Dockerfile using "apt install -y ./elasticsearch-8.13.2-amd64.deb"

Describe the bug: When using these lines to install kibana inside a Docker container:

RUN apt-get update && apt-get install -y wget
RUN wget https://artifacts.elastic.co/downloads/kibana/kibana-8.13.2-amd64.deb
RUN apt install -y ./kibana-8.13.2-amd64.deb

It throws this error:

RUN apt install -y ./kibana-8.13.2-amd64.deb
#10 0.232 
#10 0.232 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#10 0.232 
#10 0.237 Reading package lists...
#10 1.026 Building dependency tree...
#10 1.209 Reading state information...
#10 1.495 The following NEW packages will be installed:
#10 1.497   kibana
#10 3.924 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
#10 3.924 Need to get 0 B/321 MB of archives.
#10 3.924 After this operation, 938 MB of additional disk space will be used.
#10 3.924 Get:1 /kibana-8.13.2-amd64.deb kibana amd64 8.13.2 [321 MB]
#10 4.057 debconf: delaying package configuration, since apt-utils is not installed
#10 4.173 Selecting previously unselected package kibana.
(Reading database ... 4876 files and directories currently installed.)
#10 4.178 Preparing to unpack /kibana-8.13.2-amd64.deb ...
#10 4.184 Unpacking kibana (8.13.2) ...
#10 20.84 Setting up kibana (8.13.2) ...
#10 20.86 Creating kibana group.../var/lib/dpkg/info/kibana.postinst: 36: addgroup: not found
#10 20.86 dpkg: error processing package kibana (--configure):
#10 20.86  installed kibana package post-installation script subprocess returned error exit status 127
#10 20.86 Errors were encountered while processing:
#10 20.86  kibana
#10 20.87 E: Sub-process /usr/bin/dpkg returned an error code (1)
#10 ERROR: process "/bin/sh -c apt install -y ./kibana-8.13.2-amd64.deb" did not complete successfully: exit code: 100
------

Where the exact error is: "/var/lib/dpkg/info/kibana.postinst: 36: addgroup: not found"

Looking into the kibana.postinst script, it relies on "addgroup" command, which does not exist in Ubuntu any more. However, I was installing ElasticSearch using these 3 lines, I noticed it auto installed "addgroup" so it didn't have this issue (see output below the 3 lines).

RUN apt-get update && apt-get install -y wget
RUN wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.13.2-amd64.deb
RUN apt install -y ./elasticsearch-8.13.2-amd64.deb
RUN apt install -y ./elasticsearch-8.13.2-amd64.deb
#10 0.229 
#10 0.229 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#10 0.229 
#10 0.234 Reading package lists...
#10 0.961 Building dependency tree...
#10 1.132 Reading state information...
#10 1.338 The following additional packages will be installed:
#10 1.340   adduser
#10 1.341 Suggested packages:
#10 1.341   liblocale-gettext-perl perl cron quota ecryptfs-utils
#10 1.370 The following NEW packages will be installed:
#10 1.372   adduser elasticsearch

So whatever forces the dependency of elasticsearch to addgroup should be configured for kibana apt installs as well.

Note: The temporarily fix is to do run this before the Kibana install:

RUN apt-get update && apt-get install -y adduser

Which installs adduser and fixes it. (Please note this is not addgroup, but it works)

Steps to reproduce:

  1. Create a Dockerfile with 3 lines above for Kibana installation
  2. Execute: "docker build --progress=plain --no-cache --tag 'agghost-kibana-dockerfile' ."
  3. See output with Kibana failing because of missing addgroup

Expected behavior: Kibana should install properly on Ubuntu v20.04.6

Screenshots (if relevant):

Errors in browser console (if relevant):

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

Any additional context: Note: The temporarily fix is to do run this before the Kibana install:

RUN apt-get update && apt-get install -y adduser

Which installs adduser and fixes it. (Please note this is not addgroup, but it works)

elasticmachine commented 3 months ago

Pinging @elastic/kibana-operations (Team:Operations)