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

[Deployment] MinIO check failed: check bucket exists error: Invalid Request (invalid hostname) #2538

Closed
sun2430987 opened this issue Aug 20, 2024 · 4 comments
Assignees

Comments

@sun2430987
Copy link

OpenIM Server Version

3.8.0

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Docker Deployment

Issue Description and Steps to Reproduce

openim-server

issue: MinIO check failed: check bucket exists error: Invalid Request (invalid hostname)

docker-compose.yml

version: '3'

networks:
  openim:
    driver: bridge

services:
  openim_mongo:
    image: "${MONGO_IMAGE}"
    container_name: openim_mongo
    command: ["/bin/bash", "-c", "/docker-entrypoint-initdb.d/mongo-init.sh; docker-entrypoint.sh mongod --wiredTigerCacheSizeGB 1 --auth"]
    volumes:
      - "${DATA_DIR}/components/mongodb/data/db:/data/db"
      - "${DATA_DIR}/components/mongodb/data/logs:/data/logs"
      - "${DATA_DIR}/components/mongodb/data/conf:/etc/mongo"
      - "./scripts/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro"
    environment:
      - TZ=Asia/Shanghai
      - wiredTigerCacheSizeGB=1
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=openIM123
      - MONGO_INITDB_DATABASE=openim_v3
      - MONGO_OPENIM_USERNAME=${MONGO_USERNAME}
      - MONGO_OPENIM_PASSWORD=${MONGO_PASSWORD}
    restart: always
    networks:
      - openim

  openim_redis:
    image: "${REDIS_IMAGE}"
    container_name: openim_redis
    volumes:
      - "${DATA_DIR}/components/redis/data:/data"
      - "${DATA_DIR}/components/redis/config/redis.conf:/usr/local/redis/config/redis.conf"
    environment:
      TZ: Asia/Shanghai
    restart: always
    sysctls:
      net.core.somaxconn: 1024
    command: [ "redis-server", "/usr/local/redis/config/redis.conf", "--requirepass", "${REDIS_PASSWORD}", "--appendonly", "yes" ]
    networks:
      - openim

  openim_etcd:
    image: "${ETCD_IMAGE}"
    container_name: openim_etcd
    ports:
      - "12379:2379"
      - "12380:2380"
    environment:
      - ETCD_NAME=s1
      - ETCD_DATA_DIR=/etcd-data
      - ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
      - ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379
      - ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
      - ETCD_INITIAL_ADVERTISE_PEER_URLS=http://0.0.0.0:2380
      - ETCD_INITIAL_CLUSTER=s1=http://0.0.0.0:2380
      - ETCD_INITIAL_CLUSTER_TOKEN=tkn
      - ETCD_INITIAL_CLUSTER_STATE=new
    restart: always
    networks:
      - openim

  openim_kafka:
    image: "${KAFKA_IMAGE}"
    container_name: openim_kafka
    user: root
    restart: always
    volumes:
      - ./scripts/create-topic.sh:/opt/bitnami/kafka/create-topic.sh
      - "${DATA_DIR}/components/kafka:/bitnami/kafka"
    command: >
      bash -c "/opt/bitnami/scripts/kafka/run.sh & /opt/bitnami/kafka/create-topic.sh; wait"
    environment:
      TZ: Asia/Shanghai
      KAFKA_CFG_NODE_ID: 0
      KAFKA_CFG_PROCESS_ROLES: controller,broker
      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@openim_kafka:9093
      KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
      KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://openim_kafka:9092,EXTERNAL://openim_kafka:9094
      KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT
      KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
    networks:
      - openim

  openim_minio:
    image: "${MINIO_IMAGE}"
    ports:
      - "${MINIO_PORT}:9000"
      - "${MINIO_CONSOLE_PORT}:9090"
    container_name: openim_minio
    volumes:
      - "${DATA_DIR}/components/mnt/data:/data"
      - "${DATA_DIR}/components/mnt/config:/root/.minio"
    environment:
      TZ: Asia/Shanghai
      MINIO_ROOT_USER: "${MINIO_ACCESS_KEY_ID}"
      MINIO_ROOT_PASSWORD: "${MINIO_SECRET_ACCESS_KEY}"
    restart: always
    command: minio server /data --console-address ':9090'
    networks:
      - openim

  openim-web-front:
    image: ${OPENIM_WEB_FRONT_IMAGE}
    container_name: openim-web-front
    restart: always
    ports:
      - "${OPENIM_WEB_FRONT_PORT}:80"
    networks:
      - openim

  openim-admin-front:
    image: ${OPENIM_ADMIN_FRONT_IMAGE}
    container_name: openim-admin-front
    restart: always
    ports:
      - "${OPENIM_ADMIN_FRONT_PORT}:80"
    networks:
      - openim

  openim_prometheus:
    image: ${PROMETHEUS_IMAGE}
    container_name: openim_prometheus
    hostname: prometheus
    restart: always
    volumes:
      - ./config/prometheus.yml:/etc/prometheus/prometheus.yml
      - ./config/instance-down-rules.yml:/etc/prometheus/instance-down-rules.yml
      - ${DATA_DIR}/components/prometheus/data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
    ports:
      - "${PROMETHEUS_PORT}:9090"
    networks:
      - openim

  openim_alertmanager:
    image: ${ALERTMANAGER_IMAGE}
    container_name: openim_alertmanager
    hostname: alertmanager
    restart: always
    volumes:
      - ${DATA_DIR}/config/alertmanager.yml:/etc/alertmanager/alertmanager.yml
      - ${DATA_DIR}/config/email.tmpl:/etc/alertmanager/email.tmpl
    ports:
      - "${ALERT_MANAGER_PORT}:9093"
    networks:
      - openim

  openim_grafana:
    image: ${GRAFANA_IMAGE}
    container_name: openim_grafana
    hostname: grafana
    user: root
    restart: always
    ports:
      - "${GRAFANA_PORT}:3000"
    volumes:
      - "${DATA_DIR}/components/grafana:/var/lib/grafana"
    environment:
      - GF_SECURITY_ALLOW_EMBEDDING=true
      - GF_SESSION_COOKIE_SAMESITE=none
      - GF_SESSION_COOKIE_SECURE=true
      - GF_AUTH_ANONYMOUS_ENABLED=true
      - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
    networks:
      - openim

  openim_node-exporter:
    image: ${NODE_EXPORTER_IMAGE}
    container_name: openim_node-exporter
    hostname: node-exporter
    restart: always
    ports:
      - "${NODE_EXPORTER_PORT}:9100"
    networks:
      - openim

  openim-server:
    image: ${OPENIM_SERVER_IMAGE}
    container_name: openim-server
    ports:
      - "${OPENIM_MSG_GATEWAY_PORT}:10001"
      - "${OPENIM_API_PORT}:10002"
    healthcheck:
      test: [ "CMD", "sh", "-c", "mage check" ]
      interval: 5s
      timeout: 60s
      retries: 10
    environment:
      - IMENV_MONGODB_ADDRESS=${MONGO_ADDRESS}
      - IMENV_MONGODB_USERNAME=${MONGO_USERNAME}
      - IMENV_MONGODB_PASSWORD=${MONGO_PASSWORD}
      - IMENV_KAFKA_ADDRESS=${KAFKA_ADDRESS}
      - IMENV_DISCOVERY_ETCD_ADDRESS=${ETCD_ADDRESS}
      - IMENV_REDIS_ADDRESS=${REDIS_ADDRESS}
      - IMENV_REDIS_PASSWORD=${REDIS_PASSWORD}
      - IMENV_MINIO_INTERNALADDRESS=${MINIO_INTERNAL_ADDRESS}
      - IMENV_MINIO_EXTERNALADDRESS=${MINIO_EXTERNAL_ADDRESS}
      - IMENV_MINIO_ACCESSKEYID=${MINIO_ACCESS_KEY_ID}
      - IMENV_MINIO_SECRETACCESSKEY=${MINIO_SECRET_ACCESS_KEY}
      - IMENV_SHARE_SECRET=${OPENIM_SECRET}
      - IMENV_LOG_ISSTDOUT=${LOG_IS_STDOUT}
      - IMENV_LOG_REMAINLOGLEVEL=${LOG_LEVEL}
      - IMENV_OPENIM_API_PROMETHEUS_GRAFANAURL=${GRAFANA_URL}
    restart: always
    networks:
      - openim

  openim-chat:
    image: ${OPENIM_CHAT_IMAGE}
    container_name: openim-chat
    healthcheck:
      test: [ "CMD", "sh", "-c", "mage check" ]
      interval: 5s
      timeout: 60s
      retries: 10
    environment:
      - CHATENV_MONGODB_ADDRESS=${MONGO_ADDRESS}
      - CHATENV_MONGODB_USERNAME=${MONGO_USERNAME}
      - CHATENV_MONGODB_PASSWORD=${MONGO_PASSWORD}
      - CHATENV_DISCOVERY_ETCD_ADDRESS=${ETCD_ADDRESS}
      - CHATENV_REDIS_ADDRESS=${REDIS_ADDRESS}
      - CHATENV_REDIS_PASSWORD=${REDIS_PASSWORD}
      - CHATENV_SHARE_OPENIM_SECRET=${OPENIM_SECRET}
      - CHATENV_SHARE_OPENIM_APIURL=${API_URL}
      - CHATENV_LOG_ISSTDOUT=${LOG_IS_STDOUT}
      - CHATENV_LOG_REMAINLOGLEVEL=${LOG_LEVEL}
    ports:
      - "${CHAT_API_PORT}:10008"
      - "${ADMIN_API_PORT}:10009"
    restart: always
    networks:
      - openim

env

# Docker images
MONGO_IMAGE=mongo:latest                    # MongoDB server image version
REDIS_IMAGE=redis:latest                    # Redis server image version
KAFKA_IMAGE=bitnami/kafka:3.5.1            # Kafka server image version
MINIO_IMAGE=minio/minio:latest  # MinIO server image version
PROMETHEUS_IMAGE=prom/prometheus:latest   # Prometheus monitoring system image version
ALERTMANAGER_IMAGE=prom/alertmanager:latest # Alertmanager for Prometheus image version
GRAFANA_IMAGE=grafana/grafana:latest       # Grafana visualization tool image version
ETCD_IMAGE=quay.io/coreos/etcd:v3.5.13

OPENIM_WEB_FRONT_IMAGE=registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-web-front:release-v3.8.0
OPENIM_ADMIN_FRONT_IMAGE=registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-admin-front:release-v1.8.0

NODE_EXPORTER_IMAGE=prom/node-exporter:v1.7.0 # Prometheus Node Exporter image version

# OpenIM server and chat service images
#OPENIM_SERVER_IMAGE=openim/openim-server:release-v3.8 # OpenIM server application image version
OPENIM_SERVER_IMAGE=registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:release-v3.8

#OPENIM_CHAT_IMAGE=openim/openim-chat:release-v1.8 # OpenIM chat application image version
OPENIM_CHAT_IMAGE=registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:release-v1.8


# Directory for data storage
DATA_DIR=./

# MongoDB configuration
MONGO_ADDRESS="openim_mongo:27017"                # Address of MongoDB server
MONGO_USERNAME=openIM                      # MongoDB username
MONGO_PASSWORD=openIM123                   # MongoDB password

# Kafka configuration
KAFKA_ADDRESS="openim_kafka:9094"                 # Address of Kafka server

# Etcd configuration
ETCD_ADDRESS="openim_etcd:2379"

# Redis configuration
REDIS_ADDRESS="openim_redis:6379"                 # Address of Redis server
REDIS_PASSWORD=openIM123                   # Redis password

# MinIO configuration
MINIO_EXTERNAL_ADDRESS="http://*.*.*.*:10005" # External address for MinIO needs to be manually modified
MINIO_INTERNAL_ADDRESS="openim_minio:9000"        # Internal network address of MinIO
MINIO_ACCESS_KEY_ID=root                   # Access key ID for MinIO
MINIO_SECRET_ACCESS_KEY=openIM123          # Secret access key for MinIO
MINIO_PORT=10005                           # Port for MinIO server
MINIO_CONSOLE_PORT=10004                   # Console port for MinIO

# OpenIM configuration
OPENIM_SECRET=openIM123                    # Secret for OpenIM authentication
OPENIM_API_PORT=10002                      # API port for OpenIM server
OPENIM_MSG_GATEWAY_PORT=10001              # Message gateway port for OpenIM

# Ports for chat API and admin API
CHAT_API_PORT=10008                        # Chat service API port
ADMIN_API_PORT=10009                       # Admin API port

# Ports for OpenIM web and admin frontends
OPENIM_WEB_FRONT_PORT=11001                # Web frontend port for OpenIM
OPENIM_ADMIN_FRONT_PORT=11002              # Admin frontend port for OpenIM

# Monitoring ports
PROMETHEUS_PORT=19090                      # Port for Prometheus server
ALERT_MANAGER_PORT=19093                   # Port for Alert Manager
GRAFANA_PORT=13000                         # Port for Grafana
NODE_EXPORTER_PORT=19100                   # Port for Prometheus Node Exporter

# General settings
API_URL="http://openim-server:10002"       # API URL for OpenIM server
LOG_IS_STDOUT=true                         # Log output to standard out
LOG_LEVEL=3                                # Log level: 3 for production environments, 6 for test environments

GRAFANA_URL="http://*.*.*.*:13000/"    # Define the URL for accessing the Grafana dashboard, specifying the external IP and port

Screenshots Link

No response

@OpenIM-Robot
Copy link

Hello! Thank you for filing an issue.

If this is a bug report, please include relevant logs to help us debug the problem.

Join slack 🤖 to connect and communicate with our developers.

@icey-yu
Copy link
Member

icey-yu commented Aug 22, 2024

You should enter your external IP address in the MinIO URL.
MINIO_EXTERNAL_ADDRESS="http://...:10005" # External address for MinIO needs to be manually modified

@sun2430987
Copy link
Author

It's not that reason, it's because I customized the container name openim-minio (default minio) for minio, which caused openim server to not start properly. I don't know if future versions will support customization

@icey-yu
Copy link
Member

icey-yu commented Aug 22, 2024

Minio does not support buckets named with underscores (_); please change them to hyphens (-).

@icey-yu icey-yu closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants