Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

openssl error #27

Open
mohsraj opened this issue Feb 25, 2022 · 4 comments
Open

openssl error #27

mohsraj opened this issue Feb 25, 2022 · 4 comments

Comments

@mohsraj
Copy link

mohsraj commented Feb 25, 2022

Hi,

I'm getting the following error when running the step, docker-compose -f docker-compose.setup.yml run --rm certs
"E: Unable to locate package openssl"

if I comment out the "apt-get install unzip openssl -y" in setp/setup.sh, I get "/usr/share/elasticsearch/config/setup.sh: line 127: openssl: command not found"

what am I missing?

thanks

@mohsraj
Copy link
Author

mohsraj commented Feb 26, 2022

I've overcome this issue by using 8.0.0, yet, now I'm getting an error from kibana

FATAL Error: [config validation of [xpack.fleet].enabled]: definition for this key is missing

Any clue?

@Geexirooz
Copy link

I'm having the same problem.
Although I have openssl installed , I get "E: Unable to locate package openssl" error.

@Geexirooz
Copy link

I think I solved the error.
This is the error I got:

E: Unable to locate package openssl
ERROR: 100

After a bit of reading the files which are used to setup certificate, I realized that it is not our main host which lacks openssl package. The container in which the certificates are supposed to be generated doesn't have openssl package to generate the certs. So I decided to install the openssl package manually by changing the configurations as follows:

1.Open "docker-compose.setup.yml" and comment out the following line:

image: docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}

2.Add below lines right after "certs:" (line 4 I guess):
IMP: mind indentations

build:
      context: .
      dockerfile: Dockerfile

3.Create a file named "Dockerfile" and write below lines onto it:
IMP: write the ELK version explicitly (I copied it from .env-sample file)

FROM docker.elastic.co/elasticsearch/elasticsearch:7.16.0
RUN apt-get update && apt-get install -y openssl

4.Your files should look like this:
docker-compose.setup.yml:

version: '3.5'

services:
  certs:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: certs
    #image: docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}
    command: bash ${ELASTIC_DIR}/config/setup.sh
    user: "0"
    volumes:
      - ./swag:/swag/
      - ./secrets:/secrets/
      - ./setup/setup.sh:${ELASTIC_DIR}/config/setup.sh
      - ./setup/instances.yml:${ELASTIC_DIR}/config/instances.yml:ro
    environment:
      ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
      SUBDOMAIN: ${SUBDOMAIN}
      SUBFOLDER: ${SUBFOLDER}
      STAGING: ${STAGING}
    networks:
      - elk

volumes:
  secrets:
    driver: local
  setup:
    driver: local

networks:
  elk:
    driver: bridge

Dockerfile:

FROM docker.elastic.co/elasticsearch/elasticsearch:7.16.0
RUN apt-get update && apt-get install -y openssl

5.Now you can run the following command successfully:

sudo docker-compose -f docker-compose.setup.yml run --rm certs

P.S. This is not a best-practice solution and it needs to be optimized, I just came up with this and wanted to help you as well by sharing it.
BTW, you might get an error saying the following, but it is a minor one and you can ignore it. I guess it might have been solved if I had installed apt-utils package via the "Dockerfile".

debconf: delaying package configuration, since apt-utils is not installed

Hope you got it sorted now!!!

@Geexirooz
Copy link

Or I could simply add apt-get update && before apt-get install unzip openssl -y in "setup/setup.sh" file. :)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants