Java Client: Sometimes a task creation request returns null instead of throwing the actually occurring error

Hey guys,

over the last weeks we have been tracking down a weird Nullpointer that we could finally nail down to the AsanaClient returning null on some task creation requests.

The specific thing about the request where we could analyse the root cause is that it usually fails with a com.asana.errors.InvalidRequestError: Invalid Request (followers: [1]: Not an email, GID, or "me": ) error - but if this request is done often enough at some point it will just return null instead of throwing an exception.

So I’d like to report this inconsistent and flaky behaviour → after the first analysis it would also be great to get an idea if this might affect other object creation methods aswell.

We could observe this behaviour continuously in a flaky manner using the following taskRequestBuilder:

requestBuilder: {
name="my fancy name",
notes="my fancy notes",
followers=["",  ""],
projects=["projectId1", "projectId2", "projectId3", "projectId4"]

The second follower in the list is an empty string - and usually it would trigger the above mentioned error - but sometimes the API-client just doesn’t report an error but returns a null Task instead (no task is created in asana).

Best Regards,

Could now reproduce the same sporadic NullPointer behaviour with the following error smarter.ecommerce.commons.asana.AsanaApiException: com.asana.errors.InvalidRequestError: Invalid Request (projects: [2]: Unknown object: myProjectId)

The behaviour is stable enough that with a repeatedly sending wrong request I can reproduce it in a test!

Hey @Phil_Seeman would you by any chance know to whome to best reach out to for this topic? My go to person which was @Ross_Grambo is not working at asana anymore :sweat_smile:

@Ronald_Findling , I would recommend sending it in an email to api-support at asana dot com.

Thx @Phil_Seeman, my request was forwarded to the engineering team - I’ll keep this thread updated if I get any relevant information.

@Ronald_Findling thanks for reporting this. Are you using a fork of the Java SDK by any chance? I’m trying to understand exactly what code leads to this NPE. Any specific context you can provide based on your investigation would be useful for us to reproduce this.

Hey @Kem_Ozbek to be specific - for reproducing the behaviour in test I used the groovy spock framework:


My local environment where I reproduced it used adopt@1.8.0-232 - but we also saw occurrences on another machine using openjdk-8.

FYI: doing a few hundred wrong requests in a test I could reproduce the NPE every-time I tried :slight_smile: