Skip to content

wrong arn for notification target using minio mc #1007

@codedoga

Description

@codedoga

Describe the bug
I'm triying to switch from minio to rustfs and I really appreciate this project. I also have an issue with configuring bucket events notifications

To Reproduce
docker-compose.yaml

name: test_app

services:
  s3:
    image: rustfs/rustfs:1.0.0-alpha.72
    ports:
      - "13900:9000"
      - "13901:9001"
    command: /data
    user: "0:0"
    depends_on:
      app:
        condition: service_healthy
    healthcheck:
      test:
        [
          "CMD",
          "sh",
          "-c",
          "curl -f http://localhost:9000/health && curl -f http://localhost:9001/rustfs/console/health",
        ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    environment:
      RUSTFS_ACCESS_KEY: rustfs
      RUSTFS_SECRET_KEY: password
      RUSTFS_CONSOLE_ENABLE: true
      RUSTFS_REGION: eu-central
      RUSTFS_NOTIFY_WEBHOOK_ENABLE_primary: on
      RUSTFS_NOTIFY_WEBHOOK_ENDPOINT_primary: http://app:8000/api/bucket/lambda_handler
      RUSTFS_NOTIFY_WEBHOOK_AUTH_TOKEN_primary: secret
      RUST_LOG: debug
      TZ: Europe/Zagreb
    volumes:
      - type: bind
        source: ./test/s3/
        target: /data/
        bind:
          create_host_path: true
      - type: bind
        source: ./test/rustfs/logs/
        target: /logs/
        bind:
          create_host_path: true
    cpu_shares: 512
    mem_limit: 1g

  createbucket:
    image: minio/mc:latest
    depends_on:
      s3:
        condition: service_healthy
    entrypoint: >
      /bin/sh -c "
      /usr/bin/mc alias set localrustfs http://s3:9000 rustfs password;
      /usr/bin/mc mb --region "eu-central" --ignore-existing localrustfs/app;
      /usr/bin/mc event add --event "put" --prefix "uploads" --ignore-existing localrustfs/app arn:rustfs:sqs:eu-central:primary:webhook;
      /usr/bin/mc put /tmp/chutter_snap.jpg localrustfs/app/uploads/1/1/48ee6468-0d1e-47cb-92a7-57532701cf7e;
      /usr/bin/mc put /tmp/test.heic localrustfs/app/uploads/1/1/65daa93c-42f5-4757-9768-3cf8604ba241;
      "
    volumes:
      - ./test/chutter_snap.jpg:/tmp/chutter_snap.jpg
      - ./test/test.heic:/tmp/test.heic

  app:
    build:
      context: .
      dockerfile: Dockerfile-slim
    cpu_shares: 1024
    mem_limit: 2g
    ports:
      - "13800:8000"
    environment:
      S3_ENDPOINT_URL: http://s3:9000
      EXTERNAL_S3_ENDPOINT_URL: http://localhost:13900
      AWS_ACCESS_KEY_ID: rustfs
      AWS_SECRET_ACCESS_KEY: password
      S3_REGION_NAME: eu-central
      S3_BUCKET_NAME: app
      LAMBDA_SECRET: secret
      SQLITE_DB: /db/db.sqlite3
    volumes:
      - type: bind
        source: ./test/db/
        target: /db/

volumes:
  rustfs-basic-data:
    driver: local

Steps to reproduce the behavior:

  1. I'm creating notification target primary with environment variables
  2. Using minio mc:
  • I'm creating bucket called app and attaching event listener for PUT events with uploads prefix
  • I'm uploading a file

Expected behavior
rustfs sends event notification to webhook
but instead there is an error, and it seems like arn string is constructed wrong (prefix part)

Debug log

[2025-12-05 15:22:47.535818 +00:00] INFO [rustfs_notify::integration] [crates/notify/src/integration.rs:418] [rustfs-worker:ThreadId(23)] Available ARNs: ["arn:rustfs:sqs:eu-central:primary:webhook"]

[2025-12-05 15:22:47.535820 +00:00] DEBUG [rustfs_notify::integration] [crates/notify/src/integration.rs:421] [rustfs-worker:ThreadId(23)] Bucket notification config validation region:eu-central failed: ARN not found:arn:rustfs:sqs:eu-central:arn:rustfs:sqs:eu-central:primary:webhook

[2025-12-05 15:22:47.535826 +00:00] ERROR [rustfs_notify::integration] [crates/notify/src/integration.rs:425] [rustfs-worker:ThreadId(23)] config validate failed, err: ARN not found:arn:rustfs:sqs:eu-central:arn:rustfs:sqs:eu-central:primary:webhook

[2025-12-05 15:22:47.535837 +00:00] INFO [rustfs_notify::notifier] [crates/notify/src/notifier.rs:84] [rustfs-worker:ThreadId(23)] Added rules for bucket: app

Desktop (please complete the following information):

  • OS: Docker Desktop 4.51.0 (210443) on MacOS
  • Docker Engine: 28.5.2
  • Docker Compose: v2.40.3-desktop.1
  • Rustfs Version: 1.0.0-alpha.72

Metadata

Metadata

Assignees

Labels

S-resolvingStatus: Resolving a issuebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions