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

Unable to initialize new alias from the provided credentials. #3421

Closed
tsuyoring opened this issue Sep 27, 2020 · 8 comments
Closed

Unable to initialize new alias from the provided credentials. #3421

tsuyoring opened this issue Sep 27, 2020 · 8 comments

Comments

@tsuyoring
Copy link

tsuyoring commented Sep 27, 2020

Hi, I'm working with the latest Docker Image.
Since this morning my command mc config host add not working.
It's a Docker client problem because the browser GUI working with same credentials.
This problem is with same #2496.

Expected behavior

Finished to make buckets.

Actual behavior

this error log occured.

createbuckets_1  | mc: <ERROR> Unable to initialize new alias from the provided credentials. The Access Key Id you provided does not exist in our records.

Steps to reproduce the behavior

In docker-compose.yml, writing below the sencece.

  storage:
    image: minio/minio
    hostname: storage
    ports:
      - 9000:9000
    volumes:
      - ./storage/:/storage
    environment:
      MINIO_ACCESS_KEY: **********
      MINIO_SECRET_KEY: **********
    command: server /storage

  createbuckets:
    image: minio/mc
    depends_on:
      - storage
    entrypoint: >
      /bin/sh -c "
      until (/usr/bin/mc config host add myminio http://storage:9000 minioadmin minioadmin) do echo '...waiting...' && sleep 1; done;
      /usr/bin/mc mb myminio/test;
      /usr/bin/mc policy download myminio/test;
      exit 0;
      "

mc --version

  • (paste output of mc --version)
    RELEASE.2020-09-23T20-02-13Z

System information

MacOS Catalina 10.15.6
Docker version 19.03.12, build 48a66213fe

@harshavardhana
Copy link
Member

Works perfectly fine for me

docker-compose -f /tmp/test.yaml up
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Starting tmp_storage_1_3fec6f79fabf ... done
Starting tmp_createbuckets_1_19bb97256b82 ... done
Attaching to tmp_storage_1_3fec6f79fabf, tmp_createbuckets_1_19bb97256b82
storage_1_3fec6f79fabf | Attempting encryption of all config, IAM users and policies on MinIO backend
createbuckets_1_19bb97256b82 | mc: <ERROR> Unable to initialize new alias from the provided credentials. Server not initialized, please try again.
createbuckets_1_19bb97256b82 | ...waiting...
storage_1_3fec6f79fabf | Endpoint:  http://192.168.112.2:9000  http://127.0.0.1:9000
storage_1_3fec6f79fabf | 
storage_1_3fec6f79fabf | Browser Access:
storage_1_3fec6f79fabf |    http://192.168.112.2:9000  http://127.0.0.1:9000
storage_1_3fec6f79fabf | 
storage_1_3fec6f79fabf | Object API (Amazon S3 compatible):
storage_1_3fec6f79fabf |    Go:         https://docs.min.io/docs/golang-client-quickstart-guide
storage_1_3fec6f79fabf |    Java:       https://docs.min.io/docs/java-client-quickstart-guide
storage_1_3fec6f79fabf |    Python:     https://docs.min.io/docs/python-client-quickstart-guide
storage_1_3fec6f79fabf |    JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
storage_1_3fec6f79fabf |    .NET:       https://docs.min.io/docs/dotnet-client-quickstart-guide
storage_1_3fec6f79fabf | Detected default credentials 'minioadmin:minioadmin', please change the credentials immediately using 'MINIO_ACCESS_KEY' and 'MINIO_SECRET_KEY'
createbuckets_1_19bb97256b82 | Added `myminio` successfully.
createbuckets_1_19bb97256b82 | Bucket created successfully `myminio/test`.
createbuckets_1_19bb97256b82 | Access permission for `myminio/test` is set to `download`
tmp_createbuckets_1_19bb97256b82 exited with code 0

Looks like some setup issue on your end.

@harshavardhana
Copy link
Member

version: '3'

services:
  storage:
    image: minio/minio
    ports:
      - 9000:9000
    volumes:
      - ./storage/:/storage
    environment:
      MINIO_ACCESS_KEY: minioadmin
      MINIO_SECRET_KEY: minioadmin
    command: server /storage

  createbuckets:
    image: minio/mc
    depends_on:
      - storage
    entrypoint: >
      /bin/sh -c "
      until (/usr/bin/mc config host add myminio http://storage:9000 minioadmin minioadmin) do echo '...waiting...' && sleep 1; done;
      /usr/bin/mc mb myminio/test;
      /usr/bin/mc policy set download myminio/test;
      exit 0;
      "

@jamesbebbington
Copy link

I'm seeing a similar issue in our (somewhat clunky) GitHub action:

# This should be a service, but GitHub Actions doesn't support calling a custom command and the minio/minio
# dockerfile requires that a custom `minio server /data` command is used to start the server.
# Could be worked around by creating/publishing our own docker instance.
# See: https://github.community/t/job-service-command/16477
- name: Set up object storage
  run: |
    wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
    chmod +x minio
    ./minio server ./minio-data &
    wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
    chmod +x mc
    ./mc config host add minio http://localhost:9000 minioadmin minioadmin
    ./mc mb --region=eu-west-1 minio/app-test
    rm config/amazon_s3.yml
    cp config/amazon_s3.yml.github-actions config/amazon_s3.yml

With amazon_s3.yml settings:

test:
  bucket: app-test
  region: "eu-west-1"
  access_key_id: minioadmin
  secret_access_key: minioadmin
  permissions: authenticated-read
  protocol: http
  options:
    server: localhost
    port: 9000

Resulting in:

Run wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
  wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
  chmod +x minio
  ./minio server ./minio-data &
  wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
  chmod +x mc
  ./mc config host add minio http://localhost:9000 minioadmin minioadmin
  ./mc mb --region=eu-west-1 minio/app-test
  rm config/amazon_s3.yml
  cp config/amazon_s3.yml.github-actions config/amazon_s3.yml
  shell: /bin/bash -e {0}
mc: <ERROR> Unable to initialize new alias from the provided credentials. Server not initialized, please try again.
Endpoint:  http://10.1.0.4:9000  http://172.17.0.1:9000  http://172.18.0.1:9000  http://127.0.0.1:9000          

Browser Access:

   http://10.1.0.4:9000  http://172.17.0.1:9000  http://172.18.0.1:9000  http://127.0.0.1:9000          

Object API (Amazon S3 compatible):
   Go:         https://docs.min.io/docs/golang-client-quickstart-guide
   Java:       https://docs.min.io/docs/java-client-quickstart-guide
   Python:     https://docs.min.io/docs/python-client-quickstart-guide
   JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
   .NET:       https://docs.min.io/docs/dotnet-client-quickstart-guide
Detected default credentials 'minioadmin:minioadmin', please change the credentials immediately using 'MINIO_ACCESS_KEY' and 'MINIO_SECRET_KEY'
Error: Process completed with exit code 1.

We'd not made any changes to any of this infrastructure recently. It stopped working for us on 5th Oct. Any guidance on what has changed or what we're doing wrong would be much appreciated.

@harshavardhana
Copy link
Member

I'm seeing a similar issue in our (somewhat clunky) GitHub action:

# This should be a service, but GitHub Actions doesn't support calling a custom command and the minio/minio
# dockerfile requires that a custom `minio server /data` command is used to start the server.
# Could be worked around by creating/publishing our own docker instance.
# See: https://github.community/t/job-service-command/16477
- name: Set up object storage
  run: |
    wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
    chmod +x minio
    ./minio server ./minio-data &
    wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
    chmod +x mc
    ./mc config host add minio http://localhost:9000 minioadmin minioadmin
    ./mc mb --region=eu-west-1 minio/app-test
    rm config/amazon_s3.yml
    cp config/amazon_s3.yml.github-actions config/amazon_s3.yml

With amazon_s3.yml settings:

test:
  bucket: app-test
  region: "eu-west-1"
  access_key_id: minioadmin
  secret_access_key: minioadmin
  permissions: authenticated-read
  protocol: http
  options:
    server: localhost
    port: 9000

Resulting in:

Run wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
  wget -q https://dl.min.io/server/minio/release/linux-amd64/minio
  chmod +x minio
  ./minio server ./minio-data &
  wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
  chmod +x mc
  ./mc config host add minio http://localhost:9000 minioadmin minioadmin
  ./mc mb --region=eu-west-1 minio/app-test
  rm config/amazon_s3.yml
  cp config/amazon_s3.yml.github-actions config/amazon_s3.yml
  shell: /bin/bash -e {0}
mc: <ERROR> Unable to initialize new alias from the provided credentials. Server not initialized, please try again.
Endpoint:  http://10.1.0.4:9000  http://172.17.0.1:9000  http://172.18.0.1:9000  http://127.0.0.1:9000          

Browser Access:

   http://10.1.0.4:9000  http://172.17.0.1:9000  http://172.18.0.1:9000  http://127.0.0.1:9000          

Object API (Amazon S3 compatible):
   Go:         https://docs.min.io/docs/golang-client-quickstart-guide
   Java:       https://docs.min.io/docs/java-client-quickstart-guide
   Python:     https://docs.min.io/docs/python-client-quickstart-guide
   JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
   .NET:       https://docs.min.io/docs/dotnet-client-quickstart-guide
Detected default credentials 'minioadmin:minioadmin', please change the credentials immediately using 'MINIO_ACCESS_KEY' and 'MINIO_SECRET_KEY'
Error: Process completed with exit code 1.

We'd not made any changes to any of this infrastructure recently. It stopped working for us on 5th Oct. Any guidance on what has changed or what we're doing wrong would be much appreciated.

Well you are not really waiting for MinIO server to come online, this worked by chance in the past.

You need to wait for the service to be online the technique I posted should be used

#3421 (comment)

@jamesbebbington
Copy link

Ah yes of course, that makes sense, many thanks @harshavardhana!

@nvtanhh
Copy link

nvtanhh commented Jun 19, 2021

You are my life saver @harshavardhana, many thanks!

@tushar-tdm
Copy link

version: '3'

services:
  storage:
    image: minio/minio
    ports:
      - 9000:9000
    volumes:
      - ./storage/:/storage
    environment:
      MINIO_ACCESS_KEY: minioadmin
      MINIO_SECRET_KEY: minioadmin
    command: server /storage

  createbuckets:
    image: minio/mc
    depends_on:
      - storage
    entrypoint: >
      /bin/sh -c "
      until (/usr/bin/mc config host add myminio http://storage:9000 minioadmin minioadmin) do echo '...waiting...' && sleep 1; done;
      /usr/bin/mc mb myminio/test;
      /usr/bin/mc policy set download myminio/test;
      exit 0;
      "

Where can i edit this. I am using mac and i wanted to know the location of this file.

@NefixEstrada
Copy link

For anyone that could face the same problem as I did: BE CAREFUL WITH QUOTES!!

Just remove those from the docker-compose.yml file in the environment section and try again, it worked for me! :)

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

6 participants