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

fix: storageClass shouldn't set the value upon failure #10271

Merged
merged 1 commit into from Aug 15, 2020

Conversation

harshavardhana
Copy link
Member

Description

fix: storageClass shouldn't set the value upon failure

Motivation and Context

This can be disastrous in situations, luckily we had
double validation code to avoid this situation
at the lower layer.

How to test this PR?

This command with master results in following error

~ MINIO_STORAGE_CLASS_STANDARD=EC:5 minio server /tmp/fs{1...6}/disk{1...3}

API: SYSTEM()
Time: 17:53:22 PDT 08/14/2020
DeploymentID: 834070eb-fd40-4a38-9240-41e77101e5bf
Error: internal error: invalid version entry generated
       4: cmd/iam-object-store.go:197:cmd.(*IAMObjectStore).migrateToV1()
       3: cmd/iam-object-store.go:205:cmd.(*IAMObjectStore).migrateBackendFormat()
       2: cmd/iam.go:408:cmd.(*IAMSys).doIAMConfigMigration()
       1: cmd/iam.go:478:cmd.(*IAMSys).Init()

API: SYSTEM()
Time: 17:53:22 PDT 08/14/2020
DeploymentID: 834070eb-fd40-4a38-9240-41e77101e5bf
Error: Unable to migrate IAM users and policies to new format: internal error: invalid version entry generated
       1: cmd/iam.go:490:cmd.(*IAMSys).Init()

API: SYSTEM()
Time: 17:53:22 PDT 08/14/2020
DeploymentID: 834070eb-fd40-4a38-9240-41e77101e5bf
Error: IAM sub-system is partially initialized, some users may not be available
       1: cmd/iam.go:491:cmd.(*IAMSys).Init()
^CExiting on signal: INTERRUPT

This PR fixes this behavior properly.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Documentation needed
  • Unit tests needed

@minio-trusted
Copy link
Contributor

Mint Automation

Test Result
mint-xl.sh ✔️
mint-large-bucket.sh ✔️
mint-fs.sh ✔️
mint-dist-xl.sh ✔️
mint-zoned.sh ✔️
mint-gateway-nas.sh ✔️
mint-gateway-s3.sh more...
mint-gateway-azure.sh more...

10271-3c6f6d1/mint-gateway-azure.sh.log:

Running with
SERVER_ENDPOINT:      minio-dev8.minio.io:30112
ACCESS_KEY:           minioazure
SECRET_KEY:           ***REDACTED***
ENABLE_HTTPS:         0
SERVER_REGION:        us-east-1
MINT_DATA_DIR:        /mint/data
MINT_MODE:            full
ENABLE_VIRTUAL_STYLE: 0

To get logs, run 'docker cp 33ac6cd54269:/mint/log /tmp/mint-logs'

(1/15) Running aws-sdk-go tests ... done in 7 seconds
(2/15) Running aws-sdk-java tests ... done in 1 seconds
(3/15) Running aws-sdk-php tests ... done in 3 minutes and 58 seconds
(4/15) Running aws-sdk-ruby tests ... done in 17 seconds
(5/15) Running awscli tests ... FAILED in 1 minutes and 5 seconds
{
  "name": "awscli",
  "duration": 2078,
  "function": "aws --endpoint-url http://minio-dev8.minio.io:30112 s3api create-multipart-upload --bucket \nAn error occurred (BucketAlreadyOwnedByYou) when calling the CreateBucket operation: Your previous request to create the named bucket succeeded and you already own it. --key \nAn error occurred (BucketAlreadyOwnedByYou) when calling the CreateBucket operation: Your previous request to create the named bucket succeeded and you already own it.-object\n",
  "status": "FAIL",
  "error": ""
}
(5/15) Running healthcheck tests ... done in 0 seconds
(6/15) Running mc tests ... done in 3 minutes and 22 seconds
(7/15) Running minio-dotnet tests ... done in 1 minutes and 34 seconds
(8/15) Running minio-go tests ... FAILED in 5 minutes and 52 seconds
{
  "args": {},
  "duration": 940,
  "error": "The specified multipart upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.",
  "function": "CopyObjectPart(destination, source)",
  "message": "CompleteMultipartUpload call failed",
  "name": "minio-go: testUnencryptedToSSES3CopyObjectPart",
  "status": "FAIL"
}
(8/15) Running minio-java tests ... done in 6 minutes and 19 seconds
(9/15) Running minio-js tests ... done in 2 minutes and 40 seconds
(10/15) Running minio-py tests ... FAILED in 1 seconds
{
  "name": "minio-py:test_negative_make_bucket_invalid_name",
  "status": "FAIL",
  "args": {
    "location": "default value ('us-east-1')",
    "bucket_name": ".minio-py-test-dc4c4366-e89e-4e98-b04a-a6d7b7ee694d"
  },
  "message": "NoSuchBucket: message: The specified bucket does not exist.",
  "error": "Traceback (most recent call last):\n  File \"/mint/run/core/minio-py/tests.py\", line 147, in _call_test\n    func(log_entry, *args, **kwargs)\n  File \"/mint/run/core/minio-py/tests.py\", line 241, in test_negative_make_bucket_invalid_name\n    _call(log_entry, _CLIENT.make_bucket, bucket_name)\n  File \"/mint/run/core/minio-py/tests.py\", line 130, in _call\n    return func(*args, **kwargs)\n  File \"/usr/local/lib/python3.6/dist-packages/minio/api.py\", line 335, in make_bucket\n    raise ResponseError(response, method, bucket_name).get_exception()\nminio.error.NoSuchBucket: NoSuchBucket: message: The specified bucket does not exist.\n",
  "function": "make_bucket(bucket_name, location, object_lock)",
  "duration": 405
}
(10/15) Running s3cmd tests ... done in 1 minutes and 24 seconds
(11/15) Running s3select tests ... done in 1 minutes and 6 seconds
(12/15) Running security tests ... done in 0 seconds

Executed 12 out of 15 tests successfully.

10271-3c6f6d1/mint-gateway-s3.sh.log:

Running with
SERVER_ENDPOINT:      minio-dev8.minio.io:32340
ACCESS_KEY:           minio
SECRET_KEY:           ***REDACTED***
ENABLE_HTTPS:         0
SERVER_REGION:        us-east-1
MINT_DATA_DIR:        /mint/data
MINT_MODE:            full
ENABLE_VIRTUAL_STYLE: 0

To get logs, run 'docker cp a257a19efbe8:/mint/log /tmp/mint-logs'

(1/15) Running aws-sdk-go tests ... done in 1 seconds
(2/15) Running aws-sdk-java tests ... done in 1 seconds
(3/15) Running aws-sdk-php tests ... done in 41 seconds
(4/15) Running aws-sdk-ruby tests ... done in 2 seconds
(5/15) Running awscli tests ... done in 2 minutes and 3 seconds
(6/15) Running healthcheck tests ... done in 0 seconds
(7/15) Running mc tests ... done in 30 seconds
(8/15) Running minio-dotnet tests ... done in 35 seconds
(9/15) Running minio-go tests ... FAILED in 55 seconds
{
  "args": {
    "destination": {
      "Bucket": "minio-go-test-npvgxll6ui9jfarf",
      "Object": "srcObject",
      "Encryption": {},
      "UserMetadata": null,
      "ReplaceMetadata": false,
      "UserTags": null,
      "ReplaceTags": false,
      "LegalHold": "",
      "Mode": "",
      "RetainUntilDate": "0001-01-01T00:00:00Z",
      "Size": 0,
      "Progress": null
    },
    "source": {
      "Bucket": "minio-go-test-npvgxll6ui9jfarf",
      "Object": "srcObject",
      "VersionID": "",
      "MatchETag": "",
      "NoMatchETag": "",
      "MatchModifiedSince": "0001-01-01T00:00:00Z",
      "MatchUnmodifiedSince": "0001-01-01T00:00:00Z",
      "MatchRange": false,
      "Start": 0,
      "End": 0,
      "Encryption": null
    }
  },
  "duration": 293,
  "error": "This copy request is illegal because it is trying to copy an object to itself without changing the object's metadata, storage class, website redirect location or encryption attributes.",
  "function": "CopyObject(destination, source)",
  "message": "CopyObject failed",
  "name": "minio-go: testEncryptedSSES3ToSSES3CopyObject",
  "status": "FAIL"
}
(9/15) Running minio-java tests ... done in 22 seconds
(10/15) Running minio-js tests ... done in 36 seconds
(11/15) Running minio-py tests ... done in 1 minutes and 25 seconds
(12/15) Running s3cmd tests ... done in 1 minutes and 0 seconds
(13/15) Running s3select tests ... done in 3 seconds
(14/15) Running security tests ... done in 0 seconds

Executed 14 out of 15 tests successfully.

Deleting image on docker hub
Deleting image locally

Copy link
Contributor

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harshavardhana harshavardhana merged commit a4463dd into minio:master Aug 15, 2020
@harshavardhana harshavardhana deleted the fix-linux branch August 15, 2020 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants