You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/10/19 20:41:49 UTC

[GitHub] [ozone] aswinshakil opened a new pull request #2752: HDDS-5863. Error message having null fields on volume creation

aswinshakil opened a new pull request #2752:
URL: https://github.com/apache/ozone/pull/2752


   ## What changes were proposed in this pull request?
   
   Removed null fields in Error Message from permission denial by OM.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5863
   
   ## How was this patch tested?
   
   This patch was manually tested and also with CI tests.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r734239059



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,20 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                "Volume:" + obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                "Bucket:" + obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null?
+                "Key:" + obj.getKeyName() : "";
         LOG.warn("User {} doesn't have {} permission to access {} /{}/{}/{}",

Review comment:
       Minor NIT: Do we need similar thing in logging? As now log will show /vol// when bucket and key is null.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ayushtkn commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r732383670



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,19 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null? obj.getKeyName() : "";

Review comment:
       Just a suggestion
   I think we should prefix Volume:, Bucket: & Key: respectively before the name. Since we are skipping the null entries, At least to denote what the name is.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r738843030



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,20 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                "Volume:" + obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                "Bucket:" + obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null?
+                "Key:" + obj.getKeyName() : "";
         LOG.warn("User {} doesn't have {} permission to access {} /{}/{}/{}",

Review comment:
       The comment is to fix that too like how you have fixed Exception.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] aswinshakil commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
aswinshakil commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r738845378



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,20 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                "Volume:" + obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                "Bucket:" + obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null?
+                "Key:" + obj.getKeyName() : "";
         LOG.warn("User {} doesn't have {} permission to access {} /{}/{}/{}",

Review comment:
       I will fix that and update the PR.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r738841079



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,20 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                "Volume:" + obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                "Bucket:" + obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null?
+                "Key:" + obj.getKeyName() : "";
         LOG.warn("User {} doesn't have {} permission to access {} /{}/{}/{}",

Review comment:
       @aswinshakil Once this comment is addressed, it is good to go




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] aswinshakil commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
aswinshakil commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r732331640



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,19 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null? obj.getKeyName() + " ": "";

Review comment:
       Thanks for the review. Will update this!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] errose28 commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r732330046



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,19 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null? obj.getKeyName() + " ": "";

Review comment:
       super minor nitpick I don't think we need a space after the key name. LGTM otherwise.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] aswinshakil commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
aswinshakil commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r734101571



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,19 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null? obj.getKeyName() : "";

Review comment:
       Thanks for the suggestion. I will update the PR.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] aswinshakil commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
aswinshakil commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r738842221



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,20 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                "Volume:" + obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                "Bucket:" + obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null?
+                "Key:" + obj.getKeyName() : "";
         LOG.warn("User {} doesn't have {} permission to access {} /{}/{}/{}",

Review comment:
       The log will still show vol/null/null. This change only applied to the OMException.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#issuecomment-955010425


   Thank You @aswinshakil for the contribution and every one for the review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] aswinshakil commented on a change in pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
aswinshakil commented on a change in pull request #2752:
URL: https://github.com/apache/ozone/pull/2752#discussion_r738842221



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -2113,16 +2113,20 @@ public boolean checkAcls(OzoneObj obj, RequestContext context,
 
     if (!accessAuthorizer.checkAccess(obj, context)) {
       if (throwIfPermissionDenied) {
+        String volumeName = obj.getVolumeName() != null?
+                "Volume:" + obj.getVolumeName() + " ": "";
+        String bucketName = obj.getBucketName() != null?
+                "Bucket:" + obj.getBucketName() + " ": "";
+        String keyName = obj.getKeyName() != null?
+                "Key:" + obj.getKeyName() : "";
         LOG.warn("User {} doesn't have {} permission to access {} /{}/{}/{}",

Review comment:
       The log will still show vol/null/null. This change is only applied to the OMException.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 merged pull request #2752: HDDS-5863. Error message having null fields on volume creation

Posted by GitBox <gi...@apache.org>.
bharatviswa504 merged pull request #2752:
URL: https://github.com/apache/ozone/pull/2752


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org