Page MenuHomePhabricator

Fix unhandled exception when some users "Give Token" 👍 on specific Tasks
Closed, DeclinedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • be one of these users:
  • visit one of these Tasks:
  • click on Award a Token
  • select a Token (for example a thumb up 👍)

What happened?:

Unhandled exception:

No such token ""!

What should have happened instead?:

Assign that token.

Notes

That exception seems to be thrown from PhabricatorTokenGivenEditor#validateToken( $token_phid ). The error message is built in this way:

throw new Exception(pht('No such token "%s"!', $token_phid));

So it seems the $token_phid is just somehow passed as empty.

The function validateToken() is probably called by addToken( $object_phid, $token_phid ) in the same class, so any bug is probably not there too since the function just passes $token_phid as-is.

So probably the error is here:

PhabricatorTokenGiveController#handleRequest( AphrontRequest $request )

Probably the bug is there since it's calling addToken() obtaining the token from $request->getStr('tokenPHID').

Now, the question is, why $request->getStr('tokenPHID') was empty?

NOTE: I was able to assign the token to other Tasks successfully.

It seems we will never know the bug, since I tried later and it worked.

Feel free to mark as wontfix if it's too weird as bug report.

Event Timeline

It's probably worth reporting on we.phorge.it if it happens again.

Phabricator is unmaintained.

Aklapper triaged this task as Lowest priority.Jan 14 2023, 10:18 PM

I could not reproduce on T222458, token was added without a problem.

(Please reopen if this can be reproduced. :-/ )