You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "PG1204 (via GitHub)" <gi...@apache.org> on 2026/07/16 04:29:53 UTC

[I] Sharing/revoking a computing unit with an unknown email returns HTTP 500 (NPE) instead of a clear 4xx error [texera]

PG1204 opened a new issue, #6445:
URL: https://github.com/apache/texera/issues/6445

   ### What happened?
   
   ### What happened?
   The computing-unit sharing endpoints crash with a NullPointerException (surfaced to the client as HTTP 500) when the target email does not belong to any existing user.
   
   In ComputingUnitAccessResource, both grantAccess and revokeAccess do:
   
   val granteeId = userDao.fetchOneByEmail(email).getUid
   if (granteeId == null) {
     throw new IllegalArgumentException("User with the given email does not exist")
   }
   userDao.fetchOneByEmail(email) returns null when no account matches the email, so .getUid throws an NPE before the null-check on the next line runs. The null-check is therefore dead code, and the intended clean error ("User with the given email does not exist") is never produced.
   
   Expected: granting/revoking to a nonexistent email returns a clear client error (e.g. 400 Bad Request / IllegalArgumentException "User with the given email does not exist").
   Actual: an opaque 500 Internal Server Error from an uncaught NullPointerException.
   
   Affected code:
   computing-unit-managing-service/.../resource/ComputingUnitAccessResource.scala , grantAccess (~line 155) and revokeAccess (~line 183)
   (Note: the same pattern with a proper null-check exists correctly elsewhere, e.g. isOwner checks unit != null before dereferencing; only these two methods dereference first.)
   
   ### How to reproduce?
   
   Enable computing-unit sharing (COMPUTING_UNIT_SHARING_ENABLED=true).
   As the owner of a computing unit, call the grant endpoint with an email that has no account: PUT /access/computing-unit/grant/{cuid}/nobody@example.com/READ
   Observe an HTTP 500 response caused by a NullPointerException, instead of a 4xx "user does not exist" error.
   Same result for the revoke endpoint: DELETE /access/computing-unit/revoke/{cuid}/nobody@example.com
   (Mistyping a teammate's email in the share dialog is the common real-world trigger.)
   
   ### Version/Branch
   
   1.3.0-incubating-SNAPSHOT (main)
   
   ### Commit Hash (Optional)
   
   _No response_
   
   ### What browsers are you seeing the problem on?
   
   _No response_
   
   ### Relevant log output
   
   ```shell
   java.lang.NullPointerException
   	at org.apache.texera.service.resource.ComputingUnitAccessResource.grantAccess(ComputingUnitAccessResource.scala:155)
   	...
   => HTTP 500 Internal Server Error
   ```


-- 
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: notifications-unsubscribe@texera.apache.org.apache.org

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


Re: [I] Sharing/revoking a computing unit with an unknown email returns HTTP 500 (NPE) instead of a clear 4xx error [texera]

Posted by "PG1204 (via GitHub)" <gi...@apache.org>.
PG1204 commented on issue #6445:
URL: https://github.com/apache/texera/issues/6445#issuecomment-4988199250

   /take


-- 
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: notifications-unsubscribe@texera.apache.org

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


Re: [I] Sharing/revoking a computing unit with an unknown email returns HTTP 500 (NPE) instead of a clear 4xx error [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6445:
URL: https://github.com/apache/texera/issues/6445#issuecomment-4988190299

   <!-- texera:template-compliance -->
   👋 Thanks for opening this issue, @PG1204!
   
   It looks like the issue description doesn't quite follow our template yet:
   
   - The **What happened?** section is empty; please fill it in.
   
   Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
   
   You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
   


-- 
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: notifications-unsubscribe@texera.apache.org

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


Re: [I] Computing-unit share/revoke endpoints return HTTP 500 on ordinary input (unknown email; changing an existing collaborator's access level) [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6445:
URL: https://github.com/apache/texera/issues/6445#issuecomment-4995940253

   <!-- texera:template-compliance -->
   👋 Thanks for opening this issue, @PG1204!
   
   It looks like the issue description doesn't quite follow our template yet:
   
   - The **Version/Branch** section is missing; please keep the template's headings.
   
   Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
   
   You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
   


-- 
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: notifications-unsubscribe@texera.apache.org

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


Re: [I] Computing-unit share/revoke endpoints return HTTP 500 on ordinary input (unknown email; changing an existing collaborator's access level) [texera]

Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 closed issue #6445: Computing-unit share/revoke endpoints return HTTP 500 on ordinary input (unknown email; changing an existing collaborator's access level)
URL: https://github.com/apache/texera/issues/6445


-- 
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: notifications-unsubscribe@texera.apache.org

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