mbecker20 / komodo

🦎 a tool to build and deploy software on many servers 🦎
https://komo.do
GNU General Public License v3.0
1.74k stars 34 forks source link

MongoDB Authentication Error on Clean Install #79

Closed gottsman closed 1 month ago

gottsman commented 1 month ago

Deploying the basic docker-compose.yaml file and am unable to launch Komodo. I've deleted the local volumes and am still not having success. I have the MongoDB authentication set to "admin/admin". Not sure why it can't authenticate.

2024-09-13T18:01:54.551162Z  INFO core: Komodo Core version: v1.14.0
2024-09-13T18:01:54.551201Z  INFO core: config: CoreConfig { title: "Komodo", host: "https://komondo.gottsman.com", port: 9120, passkey: "##############", ui_write_disabled: false, ensure_server: "", mongo: MongoConfig { uri: None, address: Some("komodo-mongo:27017"), username: Some("##############"), password: Some("##############"), app_name: "komodo_core", db_name: "komodo" }, local_auth: true, transparent_mode: false, enable_new_users: false, jwt_secret: "##############", jwt_ttl: OneDay, google_oauth: OauthCredentials { enabled: false, id: "", secret: "" }, github_oauth: OauthCredentials { enabled: false, id: "", secret: "" }, webhook_secret: "##############", webhook_base_url: None, github_webhook_app: GithubWebhookAppConfig { app_id: 0, installations: [], pk_path: "/github/private-key.pem" }, logging: LogConfig { level: Info, stdio: Standard, otlp_endpoint: None, opentelemetry_service_name: "Komodo" }, keep_stats_for_days: 14, keep_alerts_for_days: 14, stack_poll_interval: FiveMinutes, sync_poll_interval: FiveMinutes, build_poll_interval: FiveMinutes, repo_poll_interval: FiveMinutes, monitoring_interval: FifteenSeconds, aws: AwsCredentials { access_key_id: "", secret_access_key: "" }, hetzner: HetznerCredentials { token: "" }, git_providers: [], docker_registries: [], aws_ecr_registries: [], secrets: {}, repo_directory: "/repos" }
thread 'tokio-runtime-worker' panicked at bin/core/src/state.rs:45:11:
Exiting
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-09-13T18:01:54.557317Z ERROR core::state: failed to initialize mongo client: failed to create index | index: enabled | error: Error { kind: Authentication { message: "SCRAM failure: Authentication failed." }, labels: {}, wire_version: None, source: Some(Error { kind: Command(CommandError { code: 18, code_name: "AuthenticationFailed", message: "Authentication failed.", topology_version: None }), labels: {}, wire_version: None, source: None }) }
Error: task 33 panicked with message "Exiting"

Here is my docker compose:

services:
  komodo:
    image: ghcr.io/mbecker20/komodo:latest ## use ghcr.io/mbecker20/komodo:latest-aarch64 for arm support
    container_name: komodo
    restart: unless-stopped
    depends_on:
      - komodo-mongo
    networks:
      - homelab
    expose:
      - 9120
    extra_hosts:
      - host.docker.internal:host-gateway
    environment:
      KOMODO_HOST: https://komondo.gottsman.com
      KOMODO_TITLE: Komodo
      KOMODO_MONGO_ADDRESS: komodo-mongo:27017
      KOMODO_MONGO_USERNAME: admin
      KOMODO_MONGO_PASSWORD: admin
      KOMODO_PASSKEY: a_random_passkey
      KOMODO_WEBHOOK_SECRET: a_random_secret
      KOMODO_JWT_SECRET: a_random_jwt_secret
      KOMODO_LOCAL_AUTH: true # the default is false.
      # KOMODO_GITHUB_OAUTH_ENABLED: true # also support google oauth
      # KOMODO_GITHUB_OAUTH_ID: your_oauth_id
      # KOMODO_GITHUB_OAUTH_SECRET: your_oauth_secret
      ## AWS
      # KOMODO_AWS_ACCESS_KEY_ID: your_aws_key_id
      # KOMODO_AWS_SECRET_ACCESS_KEY: your_secret_access_key
      ## HETZNER
      # KOMODO_HETZNER_TOKEN: your_hetzner_token
    labels:
      - traefik.enable=true
      - traefik.http.routers.komodo.entrypoints=https
      - traefik.http.routers.komodo.service=komodo
      - traefik.http.services.komodo.loadbalancer.server.port=9120
  komodo-mongo:
    image: mongo
    container_name: komodo-mongo
    command: --quiet
    restart: unless-stopped
    networks:
      - homelab
    ports:
      - 27017:27017
    volumes:
      - ${APPDATA}/komodo-data:/data/db
      - ${APPDATA}/komodo-config:/data/configdb
    environment:
      MONGO_INITDB_ROOT_USERNAME: admin
      MONGO_INITDB_ROOT_PASSWORD: admin
networks:
  homelab:
    external: true
mbecker20 commented 1 month ago

Can you check the mongo logs for anything? The config looks fine. Maybe Mongo didn't initialize correctly.

And fyi there is also a Postgres and Sqlite option now as well.

gottsman commented 1 month ago

Thanks for the additional DB support. I changed to sqlite for simple testing of the app and everything is happy.

It's weird because the same compose file was fine on my local Mac environment (Orbstack). Other target environment is Linux (TrueNAS Scale jail).