codenotary / immugw

Apache License 2.0
23 stars 4 forks source link

[Bug] Immugw don't start #15

Closed mageekguy closed 2 years ago

mageekguy commented 2 years ago

What happened

Immugw seems don't start, all HTTP request on it generate a "404 not found" response.

What you expected to happen

Immugw start and works as expected.

How to reproduce it (as minimally and precisely as possible)

In a docker-compose.yml file:

  notarization-database:
    image: codenotary/immudb:latest
    container_name: notarization-${ENV}
    ports:
      - 3322:3322
    environment:
      IMMUDB_ADMIN_PASSWORD: ${IMMUDB_ADMIN_PASSWORD}
    volumes:
      - ./.immudb/data:/var/lib/immudb
    user: ${USER_ID}

 notarization-api:
    build:
      context: docker/immugw
    image: ${REPOSITORY}${IMAGE}/immugw:${TAG}
    container_name: notarization-api-${ENV}
    environment:
      IMMUGW_IMMUDB_ADDRESS: notarization-database
    ports:
      - 3323:3323
    depends_on:
      - notarization-database

Just do docker-compose up -d notarization-api. After that, a docker logs on the notarization API container just says that:

immugw  2022/02/15 10:31:56 INFO: starting immugw: {"Dir":"/var/lib/immudb","Address":"0.0.0.0","Port":3323,"MetricsPort":9476,"ImmudbAddress":"notarization-database","ImmudbPort":3322,"Audit":false,"AuditInterval":300000000000,"AuditUsername":"immugwauditor","Detached":false,"MTLs":false,"MTLsOptions":{"Servername":"","Pkey":"","Certificate":"","ClientCAs":""},"Config":"configs/immugw.toml","Pidfile":"","Logfile":""}

ping notarization-database and telnet notarization-database 3322 works fine both from notarization-api container.

Environment

# run "immu* version" and copy/paste the output here
docker-compose exec notarization-api /usr/sbin/immugw version
Error: flag accessed but not defined: config
Usage:
  immugw version [flags]

Flags:
  -h, --help   help for version

flag accessed but not defined: config
ERROR: 1

Additional info (any other context about the problem)

mageekguy commented 2 years ago

Contents of notarization-api's Dockerfile is:

FROM codenotary/immugw:latest

USER root
RUN apt update && apt install -y iputils-ping telnet && rm -rf /var/lib/apt/lists/*

USER immu

Basically just add ping and telnet binaries to debug network configuration. Problem is the same if the official image is used in docker-compose.yml.

jeroiraz commented 2 years ago

Thanks for reporting it @mageekguy. We're going to review soon, we're also analyzing the possibility to directly use rest endpoints at the immudb server

jeroiraz commented 2 years ago

@mageekguy, I was able to reproduce the issue. It's will be solved in upcoming release, automatically fixed when upgrading Cobra dependency

jeroiraz commented 2 years ago

@mageekguy, I was able to reproduce the issue. It'll be fixed in upcoming release quite soon