AsanaApi: Getting tags by workspace regularly throws SocketTimeoutException

tags
api
#1

Calling tags.findByWorkspace(WORKSPACE_ID) on the Asana Client regularly throws java.net.SocketTimeoutException: Read timed out.

Steps to reproduce:
new Client(new AccessTokenDispatcher(PERSONAL_ACCESS_TOKEN)).tags.findByWorkspace(WORKSPACE_ID).execute()

API version:
com.asana:asana:0.8.1 (using gradle)

Upload screenshots below:

java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:933)
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:735)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
	at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37)
	at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:94)
	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:972)
	at com.asana.Client.request(Client.java:194)
	at com.asana.requests.CollectionRequest.executeRaw(CollectionRequest.java:45)
	at com.asana.requests.CollectionRequest.execute(CollectionRequest.java:35)
Gateway Timeout when fetching tags
#2

Hi @Ronald_Findling and welcome to the Forum :slight_smile:

API bug are actually handled independently by our API Team and Forum Champions, so I’ve gone ahead and move this thread to the #developersAPI category. Our team should be in touch shortly!

1 Like
#3

Hi @Ronald_Findling, I have a few questions for you that will help us diagnose the issue. I have a suspicion about the underlying cause because I’ve seen this before, but want to confirm before making any suggestions.

  1. If you decrease the page size when iterating through tags, do you still encounter the timeouts?
  2. Have you created a lot of tags in your domain? If you’re unsure of how many tags you have, you can send me the ID of the workspace in a DM and then I can confirm the number of tags for you.
#4

Hi Joe, sry I forgot to mention in my request that I don’t think the number of tags is the issue as when I check with the API there are only 27 tags in the workspace.

  1. Should we still try this?
  2. I’m not 100% sure what you mean with domain, in other workspaces I guess we have more tags, in the one where I see the issue we only have 27 tags.
#5

Hi @Ronald_Findling, the number of visible tags may not be the issue, but rather the number of trashed/invisible tags. If you only ever see 27 tags in the workspace, then decreasing the page size won’t help diagnose the issue. And sorry about my terminology—“domains” is what we call workspaces internally. Can you provide the ID of the workspace you’re working in? Then I can confirm the number of visible and invisible tags in it.

#6

Hi @Joe_Trollo,
ok thx for clarification, the workspace id is 16245795717405

#7

Hi @Ronald_Findling, you are affected by the problem I suspected. Your workspace has well over 5,000 tags in it, the majority of which are empty. This causes queries to time out because our data service tries to filter these to only non-empty tags.

The fix here is for us to delete all of these empty tags for you—they are invisible/unrecoverable in the web app and API anyway. Someone from our support team will be reaching out to you to confirm this action, and once you’ve approved it we’ll be able to resolve the issue for you. Sorry for the trouble!