Share feedback, ideas and get community help

Updated 3 months ago

MinIO s3 configuration issue

Hi, I just start to selfhost Typebot on my local server. Everything works perfect the only things not configure well is S3 bucket.

this is my docker-compose

Plain Text
version: "3.3"

volumes:
  db-data:
  s3-data:

services:
  typebot-db:
    image: postgres:14-alpine
    restart: always
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=typebot
      - POSTGRES_PASSWORD=typebot

  typebot-builder:
    image: baptistearno/typebot-builder:latest
    restart: always
    depends_on:
      - typebot-db
    ports:
      - "3002:3000"
    extra_hosts:
      - "host.docker.internal:host-gateway"

  typebot-viewer:
    image: baptistearno/typebot-viewer:latest
    restart: always
    ports:
      - "3001:3000"

  minio:
    image: minio/minio
    command: server /data
    ports:
      - '9001:9001'
    environment:
      MINIO_ROOT_USER: minio
      MINIO_ROOT_PASSWORD: minio123
    volumes:
      - s3-data:/data
  # This service just makes sure a bucket with the right policies is created
  createbuckets:
    image: minio/mc
    depends_on:
      - minio
    entrypoint: >
      /bin/sh -c "
      sleep 20;
      /usr/bin/mc config host add minio http://minio:9001 minio minio123;
      /usr/bin/mc mb minio/typebot;
      /usr/bin/mc anonymous set public minio/typebot/public;
      exit 0;
      "


All service is up and running well except createbuckets throw this error

Plain Text
mc: <ERROR> Unable to initialize new alias from the provided credentials. Get "http://minio:9001/probe-bsign-03kcy1pr3qlcmfmwtgznk5mbe9y2fw/?location=": dial tcp 172.28.0.3:9001: connect: connection refused.
Bucket created successfully `minio/typebot`.
mc: <ERROR> Unable to set anonymous `public` for `minio/typebot/public`. Requested path 


Anyone facing the same issue?
Attachment
image.png
A
Z
B
41 comments
use
/usr/bin/mc anonymous set public minio/typebot
instead of minio/typebot/public;
Hi @Abdullah, i think that solve the issue. πŸ™‚ thanks! But i think there is another issue regarding the connection

mc: <ERROR> Unable to initialize new alias from the provided credentials. Get "http://minio:9001/probe-bsign-bnuflcn69029vdmtvpr64isvbynqm2/?location=": dial tcp 172.28.0.3:9001: connect: connection refused.

There is instuction on typebot document regarding this

Plain Text
This config requires you to add the following DNS entry:


storage IN A <server_ip>


but im not sure how to do it
have you read this https://docs.typebot.io/self-hosting/configuration ?

Make sure to connect your database with the enviornment variables
not sure if that is an issue since it does connect and create a bucket etc
The error state that dial tcp 172.28.0.3:9001: connect: connection refused. do you face thing issue when you setup minio s3 for typebot?
i read the doc the only thing that i dont know how to do it is this part

Plain Text
This config requires you to add the following DNS entry:


storage IN A <server_ip>
Im running this using portainer if that info help
No i have set it up differently
are you using a domain to proxy everything through?
i use domain with cloudflared tunnel to setup
then you need to point a subdomain with name storage pointing towards the server ip (which i am sure you did for typebot and bot sub domain as well)
environment:
  • S3_ENDPOINT=storage.07102020.xyz
you mean like this? i already setup storage domain storage.07102020.xyz
is storage.07102020.xyz pointing to your server ip?
so i have 3 subdomain for
  • typebot
  • bot
  • storage
great then you need to proxy each one of them to their respective ports (which i think you can do with cloudflare tunnel)
yeap. port 9001 just like what i did
If i am not wrong port 9001 is for minio ui
and 9000 is for the server (api)
could be your issue here too since you are trying to connect to 9001
Plain Text
services:
  minio:
    image: minio/minio
    command: server /data
    ports:
      - '9000:9000'
    environment:
      MINIO_ROOT_USER: minio
      MINIO_ROOT_PASSWORD: minio123
    volumes:
      - s3-data:/data
  # This service just makes sure a bucket with the right policies is created
  createbuckets:
    image: minio/mc
    depends_on:
      - minio
    entrypoint: >
      /bin/sh -c "
      sleep 10;
      /usr/bin/mc config host add minio http://minio:9000 minio minio123;
      /usr/bin/mc mb minio/typebot;
      /usr/bin/mc anonymous set public minio/typebot/public;
      exit 0;
      "


on the doc i follow this config, but i need to change port 9000 to 9001 since 9000 is using by my portainer
change your command from
server /data
to
minio server --address ":19992" --console-address ":19993" /data
now your api port will be 19992 so change all 9001 to that
^i am using portainer too so this is the config i use
Plain Text
Added `minio` successfully.
mc: <ERROR> Unable to make bucket `minio/typebot`. Your previous request to create the named bucket succeeded and you already own it.
Access permission for `minio/typebot` is set to `public`


it think everything shoud be working but the container status is exited is this expected?
Attachment
image.png
yes it did its job to create the bucket so its not needed anymore
and i test to upload some icon seems like does not work
make sure you have all the enviornments variables correctly setup
can i dm you to share my docker compose text?
When you upload something what’s the error on the client and on the server?
helped fix already πŸ˜„
Anything that can be improved in the docs? πŸ™‚
Ahh i doubt it πŸ˜… it is usually people not well experienced with docker
Took me a while at the start to get the flow of it as well
Its an extra step but maybe define how to reverse proxy minio in docs too
+ define the minio command with ports
Thanks to @Abdullah help to solve the issue.

I follow the config to setup minio

Plain Text
 minio:
    image: minio/minio
    command: server /data
    ports:
      - '9000:9000'
    environment:
      MINIO_ROOT_USER: minio
      MINIO_ROOT_PASSWORD: minio123
    volumes:
      - s3-data:/data


but i need to change to command: server /data to command: minio server --address ":19992" --console-address ":19993" /data . Im not sure why tho but it works. In my case i need to change the port 9000 to 19992 because of my portainer is using 9000
Issue solve. Case close
Add a reply
Sign up and join the conversation on Discord