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

add validation logs for configured Logger/Audit HTTP targets #10274

Merged
merged 1 commit into from Aug 16, 2020

Conversation

harshavardhana
Copy link
Member

Description

add validation logs for configured Logger/Audit HTTP targets

Motivation and Context

extra logs in-case of misconfiguration of audit/logger targets

How to test this PR?

~ MINIO_AUDIT_WEBHOOK_ENABLE=on MINIO_AUDIT_WEBHOOK_ENDPOINT=http://localhost:9001 minio server ~/test

API: SYSTEM()
Time: 12:56:16 PDT 08/15/2020
DeploymentID: 061d9868-a5e2-497e-815b-b88f84e43e39
Error: Unable to initialize audit HTTP target: Post "http://localhost:9001": dial tcp 127.0.0.1:9001: connect: connection refused
       7: cmd/config-current.go:482:cmd.lookupConfigs()
       6: cmd/config-current.go:606:cmd.loadConfig()
       5: cmd/config.go:233:cmd.initConfig()
       4: cmd/config.go:193:cmd.(*ConfigSys).Init()
       3: cmd/server-main.go:340:cmd.initAllSubsystems()
       2: cmd/server-main.go:265:cmd.initSafeMode()
       1: cmd/server-main.go:529:cmd.serverMain()

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

Copy link
Contributor

@poornas poornas left a comment

Choose a reason for hiding this comment

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

LGTM

extra logs in-case of misconfiguration of audit/logger targets
@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...

10274-a819c4e/mint-gateway-s3.sh.log:

Running with
SERVER_ENDPOINT:      minio-c2.minio.io:31532
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 066a66846c50:/mint/log /tmp/mint-logs'

(1/15) Running aws-sdk-go tests ... done in 0 seconds
(2/15) Running aws-sdk-java tests ... done in 2 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 2 seconds
(6/15) Running healthcheck tests ... done in 0 seconds
(7/15) Running mc tests ... done in 46 seconds
(8/15) Running minio-dotnet tests ... done in 28 seconds
(9/15) Running minio-go tests ... FAILED in 58 seconds
{
  "args": {
    "destination": {
      "Bucket": "minio-go-test-t23a6s2t3cj6w9vj",
      "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-t23a6s2t3cj6w9vj",
      "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": 386,
  "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 21 seconds
(10/15) Running minio-js tests ... done in 42 seconds
(11/15) Running minio-py tests ... done in 1 minutes and 23 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.

10274-a819c4e/mint-gateway-azure.sh.log:

Running with
SERVER_ENDPOINT:      minio-dev6.minio.io:32255
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 aa76bd2ee64b:/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 4 minutes and 8 seconds
(4/15) Running aws-sdk-ruby tests ... done in 17 seconds
(5/15) Running awscli tests ... done in 2 minutes and 43 seconds
(6/15) Running healthcheck tests ... done in 1 seconds
(7/15) Running mc tests ... done in 2 minutes and 57 seconds
(8/15) Running minio-dotnet tests ... done in 1 minutes and 33 seconds
(9/15) Running minio-go tests ... FAILED in 5 minutes and 12 seconds
{
  "args": {},
  "duration": 956,
  "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"
}
(9/15) Running minio-java tests ... done in 6 minutes and 0 seconds
(10/15) Running minio-js tests ... done in 3 minutes and 41 seconds
(11/15) Running minio-py tests ... FAILED in 2 seconds
{
  "name": "minio-py:test_negative_make_bucket_invalid_name",
  "status": "FAIL",
  "args": {
    "location": "default value ('us-east-1')",
    "bucket_name": ".minio-py-test-0842085a-df75-4bc0-828a-6d4722fd7915"
  },
  "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": 400
}
(11/15) Running s3cmd tests ... done in 1 minutes and 21 seconds
(12/15) Running s3select tests ... done in 58 seconds
(13/15) Running security tests ... done in 0 seconds

Executed 13 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

@kannappanr kannappanr merged commit f7c1a59 into minio:master Aug 16, 2020
@harshavardhana harshavardhana deleted the extra-logs branch August 16, 2020 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants