Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

403 Forbidden on long running attachment processes #24

Open
OliverAbdulrahim opened this issue Apr 16, 2023 · 1 comment
Open

403 Forbidden on long running attachment processes #24

OliverAbdulrahim opened this issue Apr 16, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@OliverAbdulrahim
Copy link
Member

Observed issue

Attempting to download an attachment will fail with HTTP 403 Forbidden if around 120 seconds has elapsed (that's my best guess) after acquiring the download URL.

Scope

Task attachment does not download. See the documentation for this endpoint.

Possible solution

  1. Find a less transient attachment download URL
  2. Download the attachment and store it server-side rather than relying on the link
  3. Avoid long queues of attachment downloads

Stack trace

java.io.IOException: Server returned HTTP response code: 403 for URL: https://asana-user-private-us-east-1.s3.amazonaws.com/assets/<redacted>

Original Stack Trace:
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1980) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1581) ~[na:na]
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224) ~[na:na]
	at java.base/java.net.URL.openStream(URL.java:1317) ~[na:na]
	at org.conservationco.asana.extensions.tasks.Tasks.createAttachment(Tasks.kt:53) ~[kotlin-asana-39de515f38.jar:na]
	at org.conservationco.asana.extensions.AsanaClientExtension.createAttachment(AsanaClientExtension.kt:79) ~[kotlin-asana-39de515f38.jar:na]
	at org.conservationco.asana.extensions.AsanaClientExtension.createTask(AsanaClientExtension.kt:138) ~[kotlin-asana-39de515f38.jar:na]
	at org.conservationco.asanahire.service.SyncService.addToInterviewProject(SyncService.kt:132) ~[classes/:na]
	at org.conservationco.asanahire.service.SyncService.syncSingleApplicant(SyncService.kt:113) ~[classes/:na]
	at org.conservationco.asanahire.service.SyncService.access$syncSingleApplicant(SyncService.kt:22) ~[classes/:na]
	at org.conservationco.asanahire.service.SyncService$startSync$2.invoke(SyncService.kt:94) ~[classes/:na]
	at org.conservationco.asanahire.service.SyncService$startSync$2.invoke(SyncService.kt:94) ~[classes/:na]
	at org.conservationco.asanahire.service.SyncService.startSync$lambda$10(SyncService.kt:94) ~[classes/:na]
@OliverAbdulrahim OliverAbdulrahim self-assigned this Apr 16, 2023
@OliverAbdulrahim OliverAbdulrahim added the bug Something isn't working label Apr 16, 2023
@OliverAbdulrahim
Copy link
Member Author

  1. Create a pivot_index column for each job (essentially just the size of that project at the time)
  2. Create a last_run column for each job
  3. Fall back to a full sync only if there's no last_run

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant