pluja / whishper

Transcribe any audio to text, translate and edit subtitles 100% locally with a web UI. Powered by whisper models!
https://whishper.net
GNU Affero General Public License v3.0
1.54k stars 87 forks source link

Unable to upload file and the whisper user is missing #68

Closed groenator closed 10 months ago

groenator commented 10 months ago

Hi,

I followed the official documentation to deploy whishper via docker. After I am running docker-compose up -d, the application is starting fine. I am running this application from my minicpc, which is located at 192.168.1.* address.

At first I couldn't upload anything because the WHISHPER_HOST value was set to http://127.0.0.1:8082, I rectify that to match my minicpc IP.

Now, the file is uploading, however at the end I get an error the upload failed. Even thou, I can see the file inside the uploads folder. Looking at the logs I noticed the following error happening after the upload is finished, I wonder if this is related:

{"t":{"$date":"2023-12-22T17:34:51.685+00:00"},"s":"I",  "c":"ACCESS",   "id":20251,   "ctx":"conn23","msg":"Supported SASL mechanisms requested for unknown user","attr":{"user":{"user":"whishper","db":"admin"}}}
{"t":{"$date":"2023-12-22T17:34:51.685+00:00"},"s":"I",  "c":"ACCESS",   "id":6788604, "ctx":"conn23","msg":"Auth metrics report","attr":{"metric":"acquireUser","micros":0}}
{"t":{"$date":"2023-12-22T17:34:51.685+00:00"},"s":"I",  "c":"ACCESS",   "id":5286307, "ctx":"conn23","msg":"Failed to authenticate","attr":{"client":"172.25.0.4:33492","isSpeculative":true,"isClusterMember":false,"mechanism":"SCRAM-SHA-256","user":"whishper","db":"admin","error":"UserNotFound: Could not find user \"whishper\" for db \"admin\"","result":11,"metrics":{"conversation_duration":{"micros":151,"summary":{"0":{"step":1,"step_total":2,"duration_micros":138}}}},"extraInfo":{}}}
{"t":{"$date":"2023-12-22T17:34:51.685+00:00"},"s":"I",  "c":"ACCESS",   "id":6788604, "ctx":"conn23","msg":"Auth metrics report","attr":{"metric":"acquireUser","micros":0}}
{"t":{"$date":"2023-12-22T17:34:51.686+00:00"},"s":"I",  "c":"ACCESS",   "id":5286307, "ctx":"conn23","msg":"Failed to authenticate","attr":{"client":"172.25.0.4:33492","isSpeculative":false,"isClusterMember":false,"mechanism":"SCRAM-SHA-1","user":"whishper","db":"admin","error":"UserNotFound: Could not find user \"whishper\" for db \"admin\"","result":11,"metrics":{"conversation_duration":{"micros":157,"summary":{"0":{"step":1,"step_total":2,"duration_micros":146}}}},"extraInfo":{}}}
{"t":{"$date":"2023-12-22T17:34:51.686+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn22","msg":"Interrupted operation as its client disconnected","attr":{"opId":8612}}
{"t":{"$date":"2023-12-22T17:34:51.686+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn23","msg":"Connection ended","attr":{"remote":"172.25.0.4:33492","uuid":{"uuid":{"$uuid":"a05e870e-d38c-4023-b9d0-94bc4704e3d6"}},"connectionId":23,"connectionCount":2}}
{"t":{"$date":"2023-12-22T17:34:51.686+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn22","msg":"Connection ended","attr":{"remote":"172.25.0.4:52228","uuid":{"uuid":{"$uuid":"e87863a6-8741-4bc3-a6c6-4c1366b0bf52"}},"connectionId":22,"connectionCount":1}}
{"t":{"$date":"2023-12-22T17:34:51.686+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.25.0.4:33500","uuid":{"uuid":{"$uuid":"244d72b1-00b3-4dcc-8c68-19ccfd34cd85"}},"connectionId":24,"connectionCount":2}}
{"t":{"$date":"2023-12-22T17:34:51.686+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn24","msg":"client metadata","attr":{"remote":"172.25.0.4:33500","client":"conn24","doc":{"driver":{"name":"mongo-go-driver","version":"v1.12.1"},"os":{"type":"linux","architecture":"amd64"},"platform":"go1.21.0"}}}

I am keep getting the same error the user whishper cannot be found.

Docker compose:

version: "3.9"

services:
  mongo:
    image: mongo
    env_file:
      - .env
    restart: unless-stopped
    volumes:
      - ./whishper_data/db_data:/data/db
      - ./whishper_data/db_data/logs/:/var/log/mongodb/
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${DB_USER:-whishper}
      MONGO_INITDB_ROOT_PASSWORD: ${DB_PASS:-whishper}
    expose:
      - 27017
    command: ['--logpath', '/var/log/mongodb/mongod.log']

  translate:
    container_name: whisper-libretranslate
    image: libretranslate/libretranslate:latest
    restart: unless-stopped
    volumes:
      - ./whishper_data/libretranslate/data:/home/libretranslate/.local/share
      - ./whishper_data/libretranslate/cache:/home/libretranslate/.local/cache
    env_file:
      - .env
    tty: true
    environment:
      LT_DISABLE_WEB_UI: True
      LT_UPDATE_MODELS: True
    expose:
      - 5000
    networks:
      default:
        aliases:
          - translate
    healthcheck:
      test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py']
      interval: 2s
      timeout: 3s
      retries: 5

  whishper:
    pull_policy: always
    image: pluja/whishper:${WHISHPER_VERSION:-latest}
    env_file:
      - .env
    volumes:
      - ./whishper_data/uploads:/app/uploads
      - ./whishper_data/logs:/var/log/whishper
    container_name: whishper
    restart: unless-stopped
    networks:
      default:
        aliases:
          - whishper
    ports:
      - 8082:80
    depends_on:
      - mongo
      - translate
    environment:
      PUBLIC_INTERNAL_API_HOST: "http://127.0.0.1:80"
      PUBLIC_TRANSLATION_API_HOST: ""
      PUBLIC_API_HOST: ${WHISHPER_HOST:-}
      PUBLIC_WHISHPER_PROFILE: cpu
      WHISPER_MODELS_DIR: /app/models
      UPLOAD_DIR: /app/uploads

The .env file:

# Libretranslate Configuration
## Check out https://github.com/LibreTranslate/LibreTranslate#configuration-parameters for more libretranslate configuration options
LT_LOAD_ONLY=es,en,fr

# Whisper Configuration
WHISPER_MODELS=tiny,small,large-v2,large-v3
WHISHPER_HOST=http://192.168.1.4:8082

# Database Configuration
DB_USER=whishper
DB_PASS=whishper

Anyone could help me out here?

Thormus commented 4 months ago

I'm having the same issue.