diff --git a/cmd/api-errors.go b/cmd/api-errors.go index 4abc6556c..b695fa4f9 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -129,6 +129,7 @@ const ( ErrReplicationSourceNotVersionedError ErrReplicationNeedsVersioningError ErrReplicationBucketNeedsVersioningError + ErrReplicationDenyEditError ErrReplicationNoMatchingRuleError ErrObjectRestoreAlreadyInProgress ErrNoSuchKey @@ -888,6 +889,11 @@ var errorCodes = errorCodeMap{ Description: "No matching replication rule found for this object prefix", HTTPStatusCode: http.StatusBadRequest, }, + ErrReplicationDenyEditError: { + Code: "XMinioReplicationDenyEdit", + Description: "Cannot alter local replication config since this server is in a cluster replication setup", + HTTPStatusCode: http.StatusConflict, + }, ErrBucketRemoteIdenticalToSource: { Code: "XMinioAdminRemoteIdenticalToSource", Description: "The remote target cannot be identical to source", diff --git a/cmd/apierrorcode_string.go b/cmd/apierrorcode_string.go index b8b40ecd5..a4cfc7bb3 100644 --- a/cmd/apierrorcode_string.go +++ b/cmd/apierrorcode_string.go @@ -64,239 +64,240 @@ func _() { _ = x[ErrReplicationSourceNotVersionedError-53] _ = x[ErrReplicationNeedsVersioningError-54] _ = x[ErrReplicationBucketNeedsVersioningError-55] - _ = x[ErrReplicationNoMatchingRuleError-56] - _ = x[ErrObjectRestoreAlreadyInProgress-57] - _ = x[ErrNoSuchKey-58] - _ = x[ErrNoSuchUpload-59] - _ = x[ErrInvalidVersionID-60] - _ = x[ErrNoSuchVersion-61] - _ = x[ErrNotImplemented-62] - _ = x[ErrPreconditionFailed-63] - _ = x[ErrRequestTimeTooSkewed-64] - _ = x[ErrSignatureDoesNotMatch-65] - _ = x[ErrMethodNotAllowed-66] - _ = x[ErrInvalidPart-67] - _ = x[ErrInvalidPartOrder-68] - _ = x[ErrAuthorizationHeaderMalformed-69] - _ = x[ErrMalformedPOSTRequest-70] - _ = x[ErrPOSTFileRequired-71] - _ = x[ErrSignatureVersionNotSupported-72] - _ = x[ErrBucketNotEmpty-73] - _ = x[ErrAllAccessDisabled-74] - _ = x[ErrMalformedPolicy-75] - _ = x[ErrMissingFields-76] - _ = x[ErrMissingCredTag-77] - _ = x[ErrCredMalformed-78] - _ = x[ErrInvalidRegion-79] - _ = x[ErrInvalidServiceS3-80] - _ = x[ErrInvalidServiceSTS-81] - _ = x[ErrInvalidRequestVersion-82] - _ = x[ErrMissingSignTag-83] - _ = x[ErrMissingSignHeadersTag-84] - _ = x[ErrMalformedDate-85] - _ = x[ErrMalformedPresignedDate-86] - _ = x[ErrMalformedCredentialDate-87] - _ = x[ErrMalformedCredentialRegion-88] - _ = x[ErrMalformedExpires-89] - _ = x[ErrNegativeExpires-90] - _ = x[ErrAuthHeaderEmpty-91] - _ = x[ErrExpiredPresignRequest-92] - _ = x[ErrRequestNotReadyYet-93] - _ = x[ErrUnsignedHeaders-94] - _ = x[ErrMissingDateHeader-95] - _ = x[ErrInvalidQuerySignatureAlgo-96] - _ = x[ErrInvalidQueryParams-97] - _ = x[ErrBucketAlreadyOwnedByYou-98] - _ = x[ErrInvalidDuration-99] - _ = x[ErrBucketAlreadyExists-100] - _ = x[ErrMetadataTooLarge-101] - _ = x[ErrUnsupportedMetadata-102] - _ = x[ErrMaximumExpires-103] - _ = x[ErrSlowDown-104] - _ = x[ErrInvalidPrefixMarker-105] - _ = x[ErrBadRequest-106] - _ = x[ErrKeyTooLongError-107] - _ = x[ErrInvalidBucketObjectLockConfiguration-108] - _ = x[ErrObjectLockConfigurationNotFound-109] - _ = x[ErrObjectLockConfigurationNotAllowed-110] - _ = x[ErrNoSuchObjectLockConfiguration-111] - _ = x[ErrObjectLocked-112] - _ = x[ErrInvalidRetentionDate-113] - _ = x[ErrPastObjectLockRetainDate-114] - _ = x[ErrUnknownWORMModeDirective-115] - _ = x[ErrBucketTaggingNotFound-116] - _ = x[ErrObjectLockInvalidHeaders-117] - _ = x[ErrInvalidTagDirective-118] - _ = x[ErrInvalidEncryptionMethod-119] - _ = x[ErrInsecureSSECustomerRequest-120] - _ = x[ErrSSEMultipartEncrypted-121] - _ = x[ErrSSEEncryptedObject-122] - _ = x[ErrInvalidEncryptionParameters-123] - _ = x[ErrInvalidSSECustomerAlgorithm-124] - _ = x[ErrInvalidSSECustomerKey-125] - _ = x[ErrMissingSSECustomerKey-126] - _ = x[ErrMissingSSECustomerKeyMD5-127] - _ = x[ErrSSECustomerKeyMD5Mismatch-128] - _ = x[ErrInvalidSSECustomerParameters-129] - _ = x[ErrIncompatibleEncryptionMethod-130] - _ = x[ErrKMSNotConfigured-131] - _ = x[ErrNoAccessKey-132] - _ = x[ErrInvalidToken-133] - _ = x[ErrEventNotification-134] - _ = x[ErrARNNotification-135] - _ = x[ErrRegionNotification-136] - _ = x[ErrOverlappingFilterNotification-137] - _ = x[ErrFilterNameInvalid-138] - _ = x[ErrFilterNamePrefix-139] - _ = x[ErrFilterNameSuffix-140] - _ = x[ErrFilterValueInvalid-141] - _ = x[ErrOverlappingConfigs-142] - _ = x[ErrUnsupportedNotification-143] - _ = x[ErrContentSHA256Mismatch-144] - _ = x[ErrReadQuorum-145] - _ = x[ErrWriteQuorum-146] - _ = x[ErrStorageFull-147] - _ = x[ErrRequestBodyParse-148] - _ = x[ErrObjectExistsAsDirectory-149] - _ = x[ErrInvalidObjectName-150] - _ = x[ErrInvalidObjectNamePrefixSlash-151] - _ = x[ErrInvalidResourceName-152] - _ = x[ErrServerNotInitialized-153] - _ = x[ErrOperationTimedOut-154] - _ = x[ErrClientDisconnected-155] - _ = x[ErrOperationMaxedOut-156] - _ = x[ErrInvalidRequest-157] - _ = x[ErrTransitionStorageClassNotFoundError-158] - _ = x[ErrInvalidStorageClass-159] - _ = x[ErrBackendDown-160] - _ = x[ErrMalformedJSON-161] - _ = x[ErrAdminNoSuchUser-162] - _ = x[ErrAdminNoSuchGroup-163] - _ = x[ErrAdminGroupNotEmpty-164] - _ = x[ErrAdminNoSuchPolicy-165] - _ = x[ErrAdminInvalidArgument-166] - _ = x[ErrAdminInvalidAccessKey-167] - _ = x[ErrAdminInvalidSecretKey-168] - _ = x[ErrAdminConfigNoQuorum-169] - _ = x[ErrAdminConfigTooLarge-170] - _ = x[ErrAdminConfigBadJSON-171] - _ = x[ErrAdminConfigDuplicateKeys-172] - _ = x[ErrAdminCredentialsMismatch-173] - _ = x[ErrInsecureClientRequest-174] - _ = x[ErrObjectTampered-175] - _ = x[ErrSiteReplicationInvalidRequest-176] - _ = x[ErrSiteReplicationPeerResp-177] - _ = x[ErrSiteReplicationBackendIssue-178] - _ = x[ErrSiteReplicationServiceAccountError-179] - _ = x[ErrSiteReplicationBucketConfigError-180] - _ = x[ErrSiteReplicationBucketMetaError-181] - _ = x[ErrSiteReplicationIAMError-182] - _ = x[ErrAdminBucketQuotaExceeded-183] - _ = x[ErrAdminNoSuchQuotaConfiguration-184] - _ = x[ErrHealNotImplemented-185] - _ = x[ErrHealNoSuchProcess-186] - _ = x[ErrHealInvalidClientToken-187] - _ = x[ErrHealMissingBucket-188] - _ = x[ErrHealAlreadyRunning-189] - _ = x[ErrHealOverlappingPaths-190] - _ = x[ErrIncorrectContinuationToken-191] - _ = x[ErrEmptyRequestBody-192] - _ = x[ErrUnsupportedFunction-193] - _ = x[ErrInvalidExpressionType-194] - _ = x[ErrBusy-195] - _ = x[ErrUnauthorizedAccess-196] - _ = x[ErrExpressionTooLong-197] - _ = x[ErrIllegalSQLFunctionArgument-198] - _ = x[ErrInvalidKeyPath-199] - _ = x[ErrInvalidCompressionFormat-200] - _ = x[ErrInvalidFileHeaderInfo-201] - _ = x[ErrInvalidJSONType-202] - _ = x[ErrInvalidQuoteFields-203] - _ = x[ErrInvalidRequestParameter-204] - _ = x[ErrInvalidDataType-205] - _ = x[ErrInvalidTextEncoding-206] - _ = x[ErrInvalidDataSource-207] - _ = x[ErrInvalidTableAlias-208] - _ = x[ErrMissingRequiredParameter-209] - _ = x[ErrObjectSerializationConflict-210] - _ = x[ErrUnsupportedSQLOperation-211] - _ = x[ErrUnsupportedSQLStructure-212] - _ = x[ErrUnsupportedSyntax-213] - _ = x[ErrUnsupportedRangeHeader-214] - _ = x[ErrLexerInvalidChar-215] - _ = x[ErrLexerInvalidOperator-216] - _ = x[ErrLexerInvalidLiteral-217] - _ = x[ErrLexerInvalidIONLiteral-218] - _ = x[ErrParseExpectedDatePart-219] - _ = x[ErrParseExpectedKeyword-220] - _ = x[ErrParseExpectedTokenType-221] - _ = x[ErrParseExpected2TokenTypes-222] - _ = x[ErrParseExpectedNumber-223] - _ = x[ErrParseExpectedRightParenBuiltinFunctionCall-224] - _ = x[ErrParseExpectedTypeName-225] - _ = x[ErrParseExpectedWhenClause-226] - _ = x[ErrParseUnsupportedToken-227] - _ = x[ErrParseUnsupportedLiteralsGroupBy-228] - _ = x[ErrParseExpectedMember-229] - _ = x[ErrParseUnsupportedSelect-230] - _ = x[ErrParseUnsupportedCase-231] - _ = x[ErrParseUnsupportedCaseClause-232] - _ = x[ErrParseUnsupportedAlias-233] - _ = x[ErrParseUnsupportedSyntax-234] - _ = x[ErrParseUnknownOperator-235] - _ = x[ErrParseMissingIdentAfterAt-236] - _ = x[ErrParseUnexpectedOperator-237] - _ = x[ErrParseUnexpectedTerm-238] - _ = x[ErrParseUnexpectedToken-239] - _ = x[ErrParseUnexpectedKeyword-240] - _ = x[ErrParseExpectedExpression-241] - _ = x[ErrParseExpectedLeftParenAfterCast-242] - _ = x[ErrParseExpectedLeftParenValueConstructor-243] - _ = x[ErrParseExpectedLeftParenBuiltinFunctionCall-244] - _ = x[ErrParseExpectedArgumentDelimiter-245] - _ = x[ErrParseCastArity-246] - _ = x[ErrParseInvalidTypeParam-247] - _ = x[ErrParseEmptySelect-248] - _ = x[ErrParseSelectMissingFrom-249] - _ = x[ErrParseExpectedIdentForGroupName-250] - _ = x[ErrParseExpectedIdentForAlias-251] - _ = x[ErrParseUnsupportedCallWithStar-252] - _ = x[ErrParseNonUnaryAgregateFunctionCall-253] - _ = x[ErrParseMalformedJoin-254] - _ = x[ErrParseExpectedIdentForAt-255] - _ = x[ErrParseAsteriskIsNotAloneInSelectList-256] - _ = x[ErrParseCannotMixSqbAndWildcardInSelectList-257] - _ = x[ErrParseInvalidContextForWildcardInSelectList-258] - _ = x[ErrIncorrectSQLFunctionArgumentType-259] - _ = x[ErrValueParseFailure-260] - _ = x[ErrEvaluatorInvalidArguments-261] - _ = x[ErrIntegerOverflow-262] - _ = x[ErrLikeInvalidInputs-263] - _ = x[ErrCastFailed-264] - _ = x[ErrInvalidCast-265] - _ = x[ErrEvaluatorInvalidTimestampFormatPattern-266] - _ = x[ErrEvaluatorInvalidTimestampFormatPatternSymbolForParsing-267] - _ = x[ErrEvaluatorTimestampFormatPatternDuplicateFields-268] - _ = x[ErrEvaluatorTimestampFormatPatternHourClockAmPmMismatch-269] - _ = x[ErrEvaluatorUnterminatedTimestampFormatPatternToken-270] - _ = x[ErrEvaluatorInvalidTimestampFormatPatternToken-271] - _ = x[ErrEvaluatorInvalidTimestampFormatPatternSymbol-272] - _ = x[ErrEvaluatorBindingDoesNotExist-273] - _ = x[ErrMissingHeaders-274] - _ = x[ErrInvalidColumnIndex-275] - _ = x[ErrAdminConfigNotificationTargetsFailed-276] - _ = x[ErrAdminProfilerNotEnabled-277] - _ = x[ErrInvalidDecompressedSize-278] - _ = x[ErrAddUserInvalidArgument-279] - _ = x[ErrAdminAccountNotEligible-280] - _ = x[ErrAccountNotEligible-281] - _ = x[ErrAdminServiceAccountNotFound-282] - _ = x[ErrPostPolicyConditionInvalidFormat-283] + _ = x[ErrReplicationDenyEditError-56] + _ = x[ErrReplicationNoMatchingRuleError-57] + _ = x[ErrObjectRestoreAlreadyInProgress-58] + _ = x[ErrNoSuchKey-59] + _ = x[ErrNoSuchUpload-60] + _ = x[ErrInvalidVersionID-61] + _ = x[ErrNoSuchVersion-62] + _ = x[ErrNotImplemented-63] + _ = x[ErrPreconditionFailed-64] + _ = x[ErrRequestTimeTooSkewed-65] + _ = x[ErrSignatureDoesNotMatch-66] + _ = x[ErrMethodNotAllowed-67] + _ = x[ErrInvalidPart-68] + _ = x[ErrInvalidPartOrder-69] + _ = x[ErrAuthorizationHeaderMalformed-70] + _ = x[ErrMalformedPOSTRequest-71] + _ = x[ErrPOSTFileRequired-72] + _ = x[ErrSignatureVersionNotSupported-73] + _ = x[ErrBucketNotEmpty-74] + _ = x[ErrAllAccessDisabled-75] + _ = x[ErrMalformedPolicy-76] + _ = x[ErrMissingFields-77] + _ = x[ErrMissingCredTag-78] + _ = x[ErrCredMalformed-79] + _ = x[ErrInvalidRegion-80] + _ = x[ErrInvalidServiceS3-81] + _ = x[ErrInvalidServiceSTS-82] + _ = x[ErrInvalidRequestVersion-83] + _ = x[ErrMissingSignTag-84] + _ = x[ErrMissingSignHeadersTag-85] + _ = x[ErrMalformedDate-86] + _ = x[ErrMalformedPresignedDate-87] + _ = x[ErrMalformedCredentialDate-88] + _ = x[ErrMalformedCredentialRegion-89] + _ = x[ErrMalformedExpires-90] + _ = x[ErrNegativeExpires-91] + _ = x[ErrAuthHeaderEmpty-92] + _ = x[ErrExpiredPresignRequest-93] + _ = x[ErrRequestNotReadyYet-94] + _ = x[ErrUnsignedHeaders-95] + _ = x[ErrMissingDateHeader-96] + _ = x[ErrInvalidQuerySignatureAlgo-97] + _ = x[ErrInvalidQueryParams-98] + _ = x[ErrBucketAlreadyOwnedByYou-99] + _ = x[ErrInvalidDuration-100] + _ = x[ErrBucketAlreadyExists-101] + _ = x[ErrMetadataTooLarge-102] + _ = x[ErrUnsupportedMetadata-103] + _ = x[ErrMaximumExpires-104] + _ = x[ErrSlowDown-105] + _ = x[ErrInvalidPrefixMarker-106] + _ = x[ErrBadRequest-107] + _ = x[ErrKeyTooLongError-108] + _ = x[ErrInvalidBucketObjectLockConfiguration-109] + _ = x[ErrObjectLockConfigurationNotFound-110] + _ = x[ErrObjectLockConfigurationNotAllowed-111] + _ = x[ErrNoSuchObjectLockConfiguration-112] + _ = x[ErrObjectLocked-113] + _ = x[ErrInvalidRetentionDate-114] + _ = x[ErrPastObjectLockRetainDate-115] + _ = x[ErrUnknownWORMModeDirective-116] + _ = x[ErrBucketTaggingNotFound-117] + _ = x[ErrObjectLockInvalidHeaders-118] + _ = x[ErrInvalidTagDirective-119] + _ = x[ErrInvalidEncryptionMethod-120] + _ = x[ErrInsecureSSECustomerRequest-121] + _ = x[ErrSSEMultipartEncrypted-122] + _ = x[ErrSSEEncryptedObject-123] + _ = x[ErrInvalidEncryptionParameters-124] + _ = x[ErrInvalidSSECustomerAlgorithm-125] + _ = x[ErrInvalidSSECustomerKey-126] + _ = x[ErrMissingSSECustomerKey-127] + _ = x[ErrMissingSSECustomerKeyMD5-128] + _ = x[ErrSSECustomerKeyMD5Mismatch-129] + _ = x[ErrInvalidSSECustomerParameters-130] + _ = x[ErrIncompatibleEncryptionMethod-131] + _ = x[ErrKMSNotConfigured-132] + _ = x[ErrNoAccessKey-133] + _ = x[ErrInvalidToken-134] + _ = x[ErrEventNotification-135] + _ = x[ErrARNNotification-136] + _ = x[ErrRegionNotification-137] + _ = x[ErrOverlappingFilterNotification-138] + _ = x[ErrFilterNameInvalid-139] + _ = x[ErrFilterNamePrefix-140] + _ = x[ErrFilterNameSuffix-141] + _ = x[ErrFilterValueInvalid-142] + _ = x[ErrOverlappingConfigs-143] + _ = x[ErrUnsupportedNotification-144] + _ = x[ErrContentSHA256Mismatch-145] + _ = x[ErrReadQuorum-146] + _ = x[ErrWriteQuorum-147] + _ = x[ErrStorageFull-148] + _ = x[ErrRequestBodyParse-149] + _ = x[ErrObjectExistsAsDirectory-150] + _ = x[ErrInvalidObjectName-151] + _ = x[ErrInvalidObjectNamePrefixSlash-152] + _ = x[ErrInvalidResourceName-153] + _ = x[ErrServerNotInitialized-154] + _ = x[ErrOperationTimedOut-155] + _ = x[ErrClientDisconnected-156] + _ = x[ErrOperationMaxedOut-157] + _ = x[ErrInvalidRequest-158] + _ = x[ErrTransitionStorageClassNotFoundError-159] + _ = x[ErrInvalidStorageClass-160] + _ = x[ErrBackendDown-161] + _ = x[ErrMalformedJSON-162] + _ = x[ErrAdminNoSuchUser-163] + _ = x[ErrAdminNoSuchGroup-164] + _ = x[ErrAdminGroupNotEmpty-165] + _ = x[ErrAdminNoSuchPolicy-166] + _ = x[ErrAdminInvalidArgument-167] + _ = x[ErrAdminInvalidAccessKey-168] + _ = x[ErrAdminInvalidSecretKey-169] + _ = x[ErrAdminConfigNoQuorum-170] + _ = x[ErrAdminConfigTooLarge-171] + _ = x[ErrAdminConfigBadJSON-172] + _ = x[ErrAdminConfigDuplicateKeys-173] + _ = x[ErrAdminCredentialsMismatch-174] + _ = x[ErrInsecureClientRequest-175] + _ = x[ErrObjectTampered-176] + _ = x[ErrSiteReplicationInvalidRequest-177] + _ = x[ErrSiteReplicationPeerResp-178] + _ = x[ErrSiteReplicationBackendIssue-179] + _ = x[ErrSiteReplicationServiceAccountError-180] + _ = x[ErrSiteReplicationBucketConfigError-181] + _ = x[ErrSiteReplicationBucketMetaError-182] + _ = x[ErrSiteReplicationIAMError-183] + _ = x[ErrAdminBucketQuotaExceeded-184] + _ = x[ErrAdminNoSuchQuotaConfiguration-185] + _ = x[ErrHealNotImplemented-186] + _ = x[ErrHealNoSuchProcess-187] + _ = x[ErrHealInvalidClientToken-188] + _ = x[ErrHealMissingBucket-189] + _ = x[ErrHealAlreadyRunning-190] + _ = x[ErrHealOverlappingPaths-191] + _ = x[ErrIncorrectContinuationToken-192] + _ = x[ErrEmptyRequestBody-193] + _ = x[ErrUnsupportedFunction-194] + _ = x[ErrInvalidExpressionType-195] + _ = x[ErrBusy-196] + _ = x[ErrUnauthorizedAccess-197] + _ = x[ErrExpressionTooLong-198] + _ = x[ErrIllegalSQLFunctionArgument-199] + _ = x[ErrInvalidKeyPath-200] + _ = x[ErrInvalidCompressionFormat-201] + _ = x[ErrInvalidFileHeaderInfo-202] + _ = x[ErrInvalidJSONType-203] + _ = x[ErrInvalidQuoteFields-204] + _ = x[ErrInvalidRequestParameter-205] + _ = x[ErrInvalidDataType-206] + _ = x[ErrInvalidTextEncoding-207] + _ = x[ErrInvalidDataSource-208] + _ = x[ErrInvalidTableAlias-209] + _ = x[ErrMissingRequiredParameter-210] + _ = x[ErrObjectSerializationConflict-211] + _ = x[ErrUnsupportedSQLOperation-212] + _ = x[ErrUnsupportedSQLStructure-213] + _ = x[ErrUnsupportedSyntax-214] + _ = x[ErrUnsupportedRangeHeader-215] + _ = x[ErrLexerInvalidChar-216] + _ = x[ErrLexerInvalidOperator-217] + _ = x[ErrLexerInvalidLiteral-218] + _ = x[ErrLexerInvalidIONLiteral-219] + _ = x[ErrParseExpectedDatePart-220] + _ = x[ErrParseExpectedKeyword-221] + _ = x[ErrParseExpectedTokenType-222] + _ = x[ErrParseExpected2TokenTypes-223] + _ = x[ErrParseExpectedNumber-224] + _ = x[ErrParseExpectedRightParenBuiltinFunctionCall-225] + _ = x[ErrParseExpectedTypeName-226] + _ = x[ErrParseExpectedWhenClause-227] + _ = x[ErrParseUnsupportedToken-228] + _ = x[ErrParseUnsupportedLiteralsGroupBy-229] + _ = x[ErrParseExpectedMember-230] + _ = x[ErrParseUnsupportedSelect-231] + _ = x[ErrParseUnsupportedCase-232] + _ = x[ErrParseUnsupportedCaseClause-233] + _ = x[ErrParseUnsupportedAlias-234] + _ = x[ErrParseUnsupportedSyntax-235] + _ = x[ErrParseUnknownOperator-236] + _ = x[ErrParseMissingIdentAfterAt-237] + _ = x[ErrParseUnexpectedOperator-238] + _ = x[ErrParseUnexpectedTerm-239] + _ = x[ErrParseUnexpectedToken-240] + _ = x[ErrParseUnexpectedKeyword-241] + _ = x[ErrParseExpectedExpression-242] + _ = x[ErrParseExpectedLeftParenAfterCast-243] + _ = x[ErrParseExpectedLeftParenValueConstructor-244] + _ = x[ErrParseExpectedLeftParenBuiltinFunctionCall-245] + _ = x[ErrParseExpectedArgumentDelimiter-246] + _ = x[ErrParseCastArity-247] + _ = x[ErrParseInvalidTypeParam-248] + _ = x[ErrParseEmptySelect-249] + _ = x[ErrParseSelectMissingFrom-250] + _ = x[ErrParseExpectedIdentForGroupName-251] + _ = x[ErrParseExpectedIdentForAlias-252] + _ = x[ErrParseUnsupportedCallWithStar-253] + _ = x[ErrParseNonUnaryAgregateFunctionCall-254] + _ = x[ErrParseMalformedJoin-255] + _ = x[ErrParseExpectedIdentForAt-256] + _ = x[ErrParseAsteriskIsNotAloneInSelectList-257] + _ = x[ErrParseCannotMixSqbAndWildcardInSelectList-258] + _ = x[ErrParseInvalidContextForWildcardInSelectList-259] + _ = x[ErrIncorrectSQLFunctionArgumentType-260] + _ = x[ErrValueParseFailure-261] + _ = x[ErrEvaluatorInvalidArguments-262] + _ = x[ErrIntegerOverflow-263] + _ = x[ErrLikeInvalidInputs-264] + _ = x[ErrCastFailed-265] + _ = x[ErrInvalidCast-266] + _ = x[ErrEvaluatorInvalidTimestampFormatPattern-267] + _ = x[ErrEvaluatorInvalidTimestampFormatPatternSymbolForParsing-268] + _ = x[ErrEvaluatorTimestampFormatPatternDuplicateFields-269] + _ = x[ErrEvaluatorTimestampFormatPatternHourClockAmPmMismatch-270] + _ = x[ErrEvaluatorUnterminatedTimestampFormatPatternToken-271] + _ = x[ErrEvaluatorInvalidTimestampFormatPatternToken-272] + _ = x[ErrEvaluatorInvalidTimestampFormatPatternSymbol-273] + _ = x[ErrEvaluatorBindingDoesNotExist-274] + _ = x[ErrMissingHeaders-275] + _ = x[ErrInvalidColumnIndex-276] + _ = x[ErrAdminConfigNotificationTargetsFailed-277] + _ = x[ErrAdminProfilerNotEnabled-278] + _ = x[ErrInvalidDecompressedSize-279] + _ = x[ErrAddUserInvalidArgument-280] + _ = x[ErrAdminAccountNotEligible-281] + _ = x[ErrAccountNotEligible-282] + _ = x[ErrAdminServiceAccountNotFound-283] + _ = x[ErrPostPolicyConditionInvalidFormat-284] } -const _APIErrorCode_name = "NoneAccessDeniedBadDigestEntityTooSmallEntityTooLargePolicyTooLargeIncompleteBodyInternalErrorInvalidAccessKeyIDInvalidBucketNameInvalidDigestInvalidRangeInvalidRangePartNumberInvalidCopyPartRangeInvalidCopyPartRangeSourceInvalidMaxKeysInvalidEncodingMethodInvalidMaxUploadsInvalidMaxPartsInvalidPartNumberMarkerInvalidPartNumberInvalidRequestBodyInvalidCopySourceInvalidMetadataDirectiveInvalidCopyDestInvalidPolicyDocumentInvalidObjectStateMalformedXMLMissingContentLengthMissingContentMD5MissingRequestBodyErrorMissingSecurityHeaderNoSuchBucketNoSuchBucketPolicyNoSuchBucketLifecycleNoSuchLifecycleConfigurationInvalidLifecycleWithObjectLockNoSuchBucketSSEConfigNoSuchCORSConfigurationNoSuchWebsiteConfigurationReplicationConfigurationNotFoundErrorRemoteDestinationNotFoundErrorReplicationDestinationMissingLockRemoteTargetNotFoundErrorReplicationRemoteConnectionErrorReplicationBandwidthLimitErrorBucketRemoteIdenticalToSourceBucketRemoteAlreadyExistsBucketRemoteLabelInUseBucketRemoteArnTypeInvalidBucketRemoteArnInvalidBucketRemoteRemoveDisallowedRemoteTargetNotVersionedErrorReplicationSourceNotVersionedErrorReplicationNeedsVersioningErrorReplicationBucketNeedsVersioningErrorReplicationNoMatchingRuleErrorObjectRestoreAlreadyInProgressNoSuchKeyNoSuchUploadInvalidVersionIDNoSuchVersionNotImplementedPreconditionFailedRequestTimeTooSkewedSignatureDoesNotMatchMethodNotAllowedInvalidPartInvalidPartOrderAuthorizationHeaderMalformedMalformedPOSTRequestPOSTFileRequiredSignatureVersionNotSupportedBucketNotEmptyAllAccessDisabledMalformedPolicyMissingFieldsMissingCredTagCredMalformedInvalidRegionInvalidServiceS3InvalidServiceSTSInvalidRequestVersionMissingSignTagMissingSignHeadersTagMalformedDateMalformedPresignedDateMalformedCredentialDateMalformedCredentialRegionMalformedExpiresNegativeExpiresAuthHeaderEmptyExpiredPresignRequestRequestNotReadyYetUnsignedHeadersMissingDateHeaderInvalidQuerySignatureAlgoInvalidQueryParamsBucketAlreadyOwnedByYouInvalidDurationBucketAlreadyExistsMetadataTooLargeUnsupportedMetadataMaximumExpiresSlowDownInvalidPrefixMarkerBadRequestKeyTooLongErrorInvalidBucketObjectLockConfigurationObjectLockConfigurationNotFoundObjectLockConfigurationNotAllowedNoSuchObjectLockConfigurationObjectLockedInvalidRetentionDatePastObjectLockRetainDateUnknownWORMModeDirectiveBucketTaggingNotFoundObjectLockInvalidHeadersInvalidTagDirectiveInvalidEncryptionMethodInsecureSSECustomerRequestSSEMultipartEncryptedSSEEncryptedObjectInvalidEncryptionParametersInvalidSSECustomerAlgorithmInvalidSSECustomerKeyMissingSSECustomerKeyMissingSSECustomerKeyMD5SSECustomerKeyMD5MismatchInvalidSSECustomerParametersIncompatibleEncryptionMethodKMSNotConfiguredNoAccessKeyInvalidTokenEventNotificationARNNotificationRegionNotificationOverlappingFilterNotificationFilterNameInvalidFilterNamePrefixFilterNameSuffixFilterValueInvalidOverlappingConfigsUnsupportedNotificationContentSHA256MismatchReadQuorumWriteQuorumStorageFullRequestBodyParseObjectExistsAsDirectoryInvalidObjectNameInvalidObjectNamePrefixSlashInvalidResourceNameServerNotInitializedOperationTimedOutClientDisconnectedOperationMaxedOutInvalidRequestTransitionStorageClassNotFoundErrorInvalidStorageClassBackendDownMalformedJSONAdminNoSuchUserAdminNoSuchGroupAdminGroupNotEmptyAdminNoSuchPolicyAdminInvalidArgumentAdminInvalidAccessKeyAdminInvalidSecretKeyAdminConfigNoQuorumAdminConfigTooLargeAdminConfigBadJSONAdminConfigDuplicateKeysAdminCredentialsMismatchInsecureClientRequestObjectTamperedSiteReplicationInvalidRequestSiteReplicationPeerRespSiteReplicationBackendIssueSiteReplicationServiceAccountErrorSiteReplicationBucketConfigErrorSiteReplicationBucketMetaErrorSiteReplicationIAMErrorAdminBucketQuotaExceededAdminNoSuchQuotaConfigurationHealNotImplementedHealNoSuchProcessHealInvalidClientTokenHealMissingBucketHealAlreadyRunningHealOverlappingPathsIncorrectContinuationTokenEmptyRequestBodyUnsupportedFunctionInvalidExpressionTypeBusyUnauthorizedAccessExpressionTooLongIllegalSQLFunctionArgumentInvalidKeyPathInvalidCompressionFormatInvalidFileHeaderInfoInvalidJSONTypeInvalidQuoteFieldsInvalidRequestParameterInvalidDataTypeInvalidTextEncodingInvalidDataSourceInvalidTableAliasMissingRequiredParameterObjectSerializationConflictUnsupportedSQLOperationUnsupportedSQLStructureUnsupportedSyntaxUnsupportedRangeHeaderLexerInvalidCharLexerInvalidOperatorLexerInvalidLiteralLexerInvalidIONLiteralParseExpectedDatePartParseExpectedKeywordParseExpectedTokenTypeParseExpected2TokenTypesParseExpectedNumberParseExpectedRightParenBuiltinFunctionCallParseExpectedTypeNameParseExpectedWhenClauseParseUnsupportedTokenParseUnsupportedLiteralsGroupByParseExpectedMemberParseUnsupportedSelectParseUnsupportedCaseParseUnsupportedCaseClauseParseUnsupportedAliasParseUnsupportedSyntaxParseUnknownOperatorParseMissingIdentAfterAtParseUnexpectedOperatorParseUnexpectedTermParseUnexpectedTokenParseUnexpectedKeywordParseExpectedExpressionParseExpectedLeftParenAfterCastParseExpectedLeftParenValueConstructorParseExpectedLeftParenBuiltinFunctionCallParseExpectedArgumentDelimiterParseCastArityParseInvalidTypeParamParseEmptySelectParseSelectMissingFromParseExpectedIdentForGroupNameParseExpectedIdentForAliasParseUnsupportedCallWithStarParseNonUnaryAgregateFunctionCallParseMalformedJoinParseExpectedIdentForAtParseAsteriskIsNotAloneInSelectListParseCannotMixSqbAndWildcardInSelectListParseInvalidContextForWildcardInSelectListIncorrectSQLFunctionArgumentTypeValueParseFailureEvaluatorInvalidArgumentsIntegerOverflowLikeInvalidInputsCastFailedInvalidCastEvaluatorInvalidTimestampFormatPatternEvaluatorInvalidTimestampFormatPatternSymbolForParsingEvaluatorTimestampFormatPatternDuplicateFieldsEvaluatorTimestampFormatPatternHourClockAmPmMismatchEvaluatorUnterminatedTimestampFormatPatternTokenEvaluatorInvalidTimestampFormatPatternTokenEvaluatorInvalidTimestampFormatPatternSymbolEvaluatorBindingDoesNotExistMissingHeadersInvalidColumnIndexAdminConfigNotificationTargetsFailedAdminProfilerNotEnabledInvalidDecompressedSizeAddUserInvalidArgumentAdminAccountNotEligibleAccountNotEligibleAdminServiceAccountNotFoundPostPolicyConditionInvalidFormat" +const _APIErrorCode_name = "NoneAccessDeniedBadDigestEntityTooSmallEntityTooLargePolicyTooLargeIncompleteBodyInternalErrorInvalidAccessKeyIDInvalidBucketNameInvalidDigestInvalidRangeInvalidRangePartNumberInvalidCopyPartRangeInvalidCopyPartRangeSourceInvalidMaxKeysInvalidEncodingMethodInvalidMaxUploadsInvalidMaxPartsInvalidPartNumberMarkerInvalidPartNumberInvalidRequestBodyInvalidCopySourceInvalidMetadataDirectiveInvalidCopyDestInvalidPolicyDocumentInvalidObjectStateMalformedXMLMissingContentLengthMissingContentMD5MissingRequestBodyErrorMissingSecurityHeaderNoSuchBucketNoSuchBucketPolicyNoSuchBucketLifecycleNoSuchLifecycleConfigurationInvalidLifecycleWithObjectLockNoSuchBucketSSEConfigNoSuchCORSConfigurationNoSuchWebsiteConfigurationReplicationConfigurationNotFoundErrorRemoteDestinationNotFoundErrorReplicationDestinationMissingLockRemoteTargetNotFoundErrorReplicationRemoteConnectionErrorReplicationBandwidthLimitErrorBucketRemoteIdenticalToSourceBucketRemoteAlreadyExistsBucketRemoteLabelInUseBucketRemoteArnTypeInvalidBucketRemoteArnInvalidBucketRemoteRemoveDisallowedRemoteTargetNotVersionedErrorReplicationSourceNotVersionedErrorReplicationNeedsVersioningErrorReplicationBucketNeedsVersioningErrorReplicationDenyEditErrorReplicationNoMatchingRuleErrorObjectRestoreAlreadyInProgressNoSuchKeyNoSuchUploadInvalidVersionIDNoSuchVersionNotImplementedPreconditionFailedRequestTimeTooSkewedSignatureDoesNotMatchMethodNotAllowedInvalidPartInvalidPartOrderAuthorizationHeaderMalformedMalformedPOSTRequestPOSTFileRequiredSignatureVersionNotSupportedBucketNotEmptyAllAccessDisabledMalformedPolicyMissingFieldsMissingCredTagCredMalformedInvalidRegionInvalidServiceS3InvalidServiceSTSInvalidRequestVersionMissingSignTagMissingSignHeadersTagMalformedDateMalformedPresignedDateMalformedCredentialDateMalformedCredentialRegionMalformedExpiresNegativeExpiresAuthHeaderEmptyExpiredPresignRequestRequestNotReadyYetUnsignedHeadersMissingDateHeaderInvalidQuerySignatureAlgoInvalidQueryParamsBucketAlreadyOwnedByYouInvalidDurationBucketAlreadyExistsMetadataTooLargeUnsupportedMetadataMaximumExpiresSlowDownInvalidPrefixMarkerBadRequestKeyTooLongErrorInvalidBucketObjectLockConfigurationObjectLockConfigurationNotFoundObjectLockConfigurationNotAllowedNoSuchObjectLockConfigurationObjectLockedInvalidRetentionDatePastObjectLockRetainDateUnknownWORMModeDirectiveBucketTaggingNotFoundObjectLockInvalidHeadersInvalidTagDirectiveInvalidEncryptionMethodInsecureSSECustomerRequestSSEMultipartEncryptedSSEEncryptedObjectInvalidEncryptionParametersInvalidSSECustomerAlgorithmInvalidSSECustomerKeyMissingSSECustomerKeyMissingSSECustomerKeyMD5SSECustomerKeyMD5MismatchInvalidSSECustomerParametersIncompatibleEncryptionMethodKMSNotConfiguredNoAccessKeyInvalidTokenEventNotificationARNNotificationRegionNotificationOverlappingFilterNotificationFilterNameInvalidFilterNamePrefixFilterNameSuffixFilterValueInvalidOverlappingConfigsUnsupportedNotificationContentSHA256MismatchReadQuorumWriteQuorumStorageFullRequestBodyParseObjectExistsAsDirectoryInvalidObjectNameInvalidObjectNamePrefixSlashInvalidResourceNameServerNotInitializedOperationTimedOutClientDisconnectedOperationMaxedOutInvalidRequestTransitionStorageClassNotFoundErrorInvalidStorageClassBackendDownMalformedJSONAdminNoSuchUserAdminNoSuchGroupAdminGroupNotEmptyAdminNoSuchPolicyAdminInvalidArgumentAdminInvalidAccessKeyAdminInvalidSecretKeyAdminConfigNoQuorumAdminConfigTooLargeAdminConfigBadJSONAdminConfigDuplicateKeysAdminCredentialsMismatchInsecureClientRequestObjectTamperedSiteReplicationInvalidRequestSiteReplicationPeerRespSiteReplicationBackendIssueSiteReplicationServiceAccountErrorSiteReplicationBucketConfigErrorSiteReplicationBucketMetaErrorSiteReplicationIAMErrorAdminBucketQuotaExceededAdminNoSuchQuotaConfigurationHealNotImplementedHealNoSuchProcessHealInvalidClientTokenHealMissingBucketHealAlreadyRunningHealOverlappingPathsIncorrectContinuationTokenEmptyRequestBodyUnsupportedFunctionInvalidExpressionTypeBusyUnauthorizedAccessExpressionTooLongIllegalSQLFunctionArgumentInvalidKeyPathInvalidCompressionFormatInvalidFileHeaderInfoInvalidJSONTypeInvalidQuoteFieldsInvalidRequestParameterInvalidDataTypeInvalidTextEncodingInvalidDataSourceInvalidTableAliasMissingRequiredParameterObjectSerializationConflictUnsupportedSQLOperationUnsupportedSQLStructureUnsupportedSyntaxUnsupportedRangeHeaderLexerInvalidCharLexerInvalidOperatorLexerInvalidLiteralLexerInvalidIONLiteralParseExpectedDatePartParseExpectedKeywordParseExpectedTokenTypeParseExpected2TokenTypesParseExpectedNumberParseExpectedRightParenBuiltinFunctionCallParseExpectedTypeNameParseExpectedWhenClauseParseUnsupportedTokenParseUnsupportedLiteralsGroupByParseExpectedMemberParseUnsupportedSelectParseUnsupportedCaseParseUnsupportedCaseClauseParseUnsupportedAliasParseUnsupportedSyntaxParseUnknownOperatorParseMissingIdentAfterAtParseUnexpectedOperatorParseUnexpectedTermParseUnexpectedTokenParseUnexpectedKeywordParseExpectedExpressionParseExpectedLeftParenAfterCastParseExpectedLeftParenValueConstructorParseExpectedLeftParenBuiltinFunctionCallParseExpectedArgumentDelimiterParseCastArityParseInvalidTypeParamParseEmptySelectParseSelectMissingFromParseExpectedIdentForGroupNameParseExpectedIdentForAliasParseUnsupportedCallWithStarParseNonUnaryAgregateFunctionCallParseMalformedJoinParseExpectedIdentForAtParseAsteriskIsNotAloneInSelectListParseCannotMixSqbAndWildcardInSelectListParseInvalidContextForWildcardInSelectListIncorrectSQLFunctionArgumentTypeValueParseFailureEvaluatorInvalidArgumentsIntegerOverflowLikeInvalidInputsCastFailedInvalidCastEvaluatorInvalidTimestampFormatPatternEvaluatorInvalidTimestampFormatPatternSymbolForParsingEvaluatorTimestampFormatPatternDuplicateFieldsEvaluatorTimestampFormatPatternHourClockAmPmMismatchEvaluatorUnterminatedTimestampFormatPatternTokenEvaluatorInvalidTimestampFormatPatternTokenEvaluatorInvalidTimestampFormatPatternSymbolEvaluatorBindingDoesNotExistMissingHeadersInvalidColumnIndexAdminConfigNotificationTargetsFailedAdminProfilerNotEnabledInvalidDecompressedSizeAddUserInvalidArgumentAdminAccountNotEligibleAccountNotEligibleAdminServiceAccountNotFoundPostPolicyConditionInvalidFormat" -var _APIErrorCode_index = [...]uint16{0, 4, 16, 25, 39, 53, 67, 81, 94, 112, 129, 142, 154, 176, 196, 222, 236, 257, 274, 289, 312, 329, 347, 364, 388, 403, 424, 442, 454, 474, 491, 514, 535, 547, 565, 586, 614, 644, 665, 688, 714, 751, 781, 814, 839, 871, 901, 930, 955, 977, 1003, 1025, 1053, 1082, 1116, 1147, 1184, 1214, 1244, 1253, 1265, 1281, 1294, 1308, 1326, 1346, 1367, 1383, 1394, 1410, 1438, 1458, 1474, 1502, 1516, 1533, 1548, 1561, 1575, 1588, 1601, 1617, 1634, 1655, 1669, 1690, 1703, 1725, 1748, 1773, 1789, 1804, 1819, 1840, 1858, 1873, 1890, 1915, 1933, 1956, 1971, 1990, 2006, 2025, 2039, 2047, 2066, 2076, 2091, 2127, 2158, 2191, 2220, 2232, 2252, 2276, 2300, 2321, 2345, 2364, 2387, 2413, 2434, 2452, 2479, 2506, 2527, 2548, 2572, 2597, 2625, 2653, 2669, 2680, 2692, 2709, 2724, 2742, 2771, 2788, 2804, 2820, 2838, 2856, 2879, 2900, 2910, 2921, 2932, 2948, 2971, 2988, 3016, 3035, 3055, 3072, 3090, 3107, 3121, 3156, 3175, 3186, 3199, 3214, 3230, 3248, 3265, 3285, 3306, 3327, 3346, 3365, 3383, 3407, 3431, 3452, 3466, 3495, 3518, 3545, 3579, 3611, 3641, 3664, 3688, 3717, 3735, 3752, 3774, 3791, 3809, 3829, 3855, 3871, 3890, 3911, 3915, 3933, 3950, 3976, 3990, 4014, 4035, 4050, 4068, 4091, 4106, 4125, 4142, 4159, 4183, 4210, 4233, 4256, 4273, 4295, 4311, 4331, 4350, 4372, 4393, 4413, 4435, 4459, 4478, 4520, 4541, 4564, 4585, 4616, 4635, 4657, 4677, 4703, 4724, 4746, 4766, 4790, 4813, 4832, 4852, 4874, 4897, 4928, 4966, 5007, 5037, 5051, 5072, 5088, 5110, 5140, 5166, 5194, 5227, 5245, 5268, 5303, 5343, 5385, 5417, 5434, 5459, 5474, 5491, 5501, 5512, 5550, 5604, 5650, 5702, 5750, 5793, 5837, 5865, 5879, 5897, 5933, 5956, 5979, 6001, 6024, 6042, 6069, 6101} +var _APIErrorCode_index = [...]uint16{0, 4, 16, 25, 39, 53, 67, 81, 94, 112, 129, 142, 154, 176, 196, 222, 236, 257, 274, 289, 312, 329, 347, 364, 388, 403, 424, 442, 454, 474, 491, 514, 535, 547, 565, 586, 614, 644, 665, 688, 714, 751, 781, 814, 839, 871, 901, 930, 955, 977, 1003, 1025, 1053, 1082, 1116, 1147, 1184, 1208, 1238, 1268, 1277, 1289, 1305, 1318, 1332, 1350, 1370, 1391, 1407, 1418, 1434, 1462, 1482, 1498, 1526, 1540, 1557, 1572, 1585, 1599, 1612, 1625, 1641, 1658, 1679, 1693, 1714, 1727, 1749, 1772, 1797, 1813, 1828, 1843, 1864, 1882, 1897, 1914, 1939, 1957, 1980, 1995, 2014, 2030, 2049, 2063, 2071, 2090, 2100, 2115, 2151, 2182, 2215, 2244, 2256, 2276, 2300, 2324, 2345, 2369, 2388, 2411, 2437, 2458, 2476, 2503, 2530, 2551, 2572, 2596, 2621, 2649, 2677, 2693, 2704, 2716, 2733, 2748, 2766, 2795, 2812, 2828, 2844, 2862, 2880, 2903, 2924, 2934, 2945, 2956, 2972, 2995, 3012, 3040, 3059, 3079, 3096, 3114, 3131, 3145, 3180, 3199, 3210, 3223, 3238, 3254, 3272, 3289, 3309, 3330, 3351, 3370, 3389, 3407, 3431, 3455, 3476, 3490, 3519, 3542, 3569, 3603, 3635, 3665, 3688, 3712, 3741, 3759, 3776, 3798, 3815, 3833, 3853, 3879, 3895, 3914, 3935, 3939, 3957, 3974, 4000, 4014, 4038, 4059, 4074, 4092, 4115, 4130, 4149, 4166, 4183, 4207, 4234, 4257, 4280, 4297, 4319, 4335, 4355, 4374, 4396, 4417, 4437, 4459, 4483, 4502, 4544, 4565, 4588, 4609, 4640, 4659, 4681, 4701, 4727, 4748, 4770, 4790, 4814, 4837, 4856, 4876, 4898, 4921, 4952, 4990, 5031, 5061, 5075, 5096, 5112, 5134, 5164, 5190, 5218, 5251, 5269, 5292, 5327, 5367, 5409, 5441, 5458, 5483, 5498, 5515, 5525, 5536, 5574, 5628, 5674, 5726, 5774, 5817, 5861, 5889, 5903, 5921, 5957, 5980, 6003, 6025, 6048, 6066, 6093, 6125} func (i APIErrorCode) String() string { if i < 0 || i >= APIErrorCode(len(_APIErrorCode_index)-1) { diff --git a/cmd/bucket-handlers.go b/cmd/bucket-handlers.go index 42ea5a71d..9a1fa03cf 100644 --- a/cmd/bucket-handlers.go +++ b/cmd/bucket-handlers.go @@ -1586,7 +1586,10 @@ func (api objectAPIHandlers) PutBucketReplicationConfigHandler(w http.ResponseWr writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL) return } - + if globalSiteReplicationSys.isEnabled() { + writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrReplicationDenyEditError), r.URL) + return + } if versioned := globalBucketVersioningSys.Enabled(bucket); !versioned { writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrReplicationNeedsVersioningError), r.URL) return @@ -1688,6 +1691,10 @@ func (api objectAPIHandlers) DeleteBucketReplicationConfigHandler(w http.Respons writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL) return } + if globalSiteReplicationSys.isEnabled() { + writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrReplicationDenyEditError), r.URL) + return + } if err := globalBucketMetadataSys.Update(bucket, bucketReplicationConfig, nil); err != nil { writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL) return diff --git a/cmd/bucket-versioning-handler.go b/cmd/bucket-versioning-handler.go index af30036c0..d3e74d4b2 100644 --- a/cmd/bucket-versioning-handler.go +++ b/cmd/bucket-versioning-handler.go @@ -63,6 +63,15 @@ func (api objectAPIHandlers) PutBucketVersioningHandler(w http.ResponseWriter, r return } + if globalSiteReplicationSys.isEnabled() { + writeErrorResponse(ctx, w, APIError{ + Code: "InvalidBucketState", + Description: "Cluster replication is enabled for this site, so the versioning state cannot be changed.", + HTTPStatusCode: http.StatusConflict, + }, r.URL) + return + } + if rcfg, _ := globalBucketObjectLockSys.Get(bucket); rcfg.LockEnabled && v.Suspended() { writeErrorResponse(ctx, w, APIError{ Code: "InvalidBucketState", diff --git a/cmd/site-replication.go b/cmd/site-replication.go index 669b1d9a3..0e2f41ffd 100644 --- a/cmd/site-replication.go +++ b/cmd/site-replication.go @@ -1635,6 +1635,13 @@ func (c *SiteReplicationSys) annotatePeerErr(dstPeer string, annotation string, return fmt.Errorf("%s->%s: %s: %v", c.state.Name, dstPeer, annotation, err) } +// isEnabled returns true if site replication is enabled +func (c *SiteReplicationSys) isEnabled() bool { + c.RLock() + defer c.RUnlock() + return c.enabled +} + // Other helpers // newRemoteClusterHTTPTransport returns a new http configuration