Upload an Attachment limits/errors

attachments
api

#1

Documentation at https://asana.com/developers/api-reference/attachments#uploadAttach File says:

The 100MB size limit on attachments in Asana is enforced on this endpoint.

Experiments showed that:

  1. anything bigger then 50Mb is producing 413 Request Entity Too Large on nginx level.
  2. files under 50Mb make backend crash: Backend exited unexpectedly.
  3. files around 32Mb sometimes succeed, when failing extra header is seen in error: SERIOUS: Exception reached the event loop. Don't just fix the immediate cause, fix the reason it wasn't caught too please!.

Either documentation should be updated, or limit should be withdrawn and error in backend corrected.

Sample 1:

POST /api/1.0/tasks/123456789012345/attachments HTTP/1.1
Host: app.asana.com
Content-Type: multipart/form-data; boundary=----------------------------123456789abc
Content-Length: 52428801

HTTP/1.1 413 Request Entity Too Large

Sample 2:

POST /api/1.0/tasks/123456789012345/attachments HTTP/1.1
Host: app.asana.com
Content-Type: multipart/form-data; boundary=----------------------------123456789abc
Content-Length: 52428800

HTTP/1.1 500 Internal Server Error
Content-Type: text/plain; charset=UTF-8
X-Asana-Preferred-Release-Revision: 20170713_201158_ff4268a5d805343b36edf88b7baa137f2d93a05b
X-Robots-Tag: none

Backend exited unexpectedly

Sample 3a:

POST /api/1.0/tasks/123456789012345/attachments HTTP/1.1
Host: app.asana.com
Content-Type: multipart/form-data; boundary=----------------------------123456789abc
Content-Length: 33554432

HTTP/1.1 500 Internal Server Error
Content-Type: text/plain; charset=UTF-8
SERIOUS: Exception reached the event loop. Don't just fix the immediate cause, fix the reason it wasn't caught too please!
X-Asana-Preferred-Release-Revision: 20170713_201158_ff4268a5d805343b36edf88b7baa137f2d93a05b
X-Robots-Tag: none

Backend exited unexpectedly

Sample 3b:

POST /api/1.0/tasks/123456789012345/attachments HTTP/1.1
Host: app.asana.com
Content-Type: multipart/form-data; boundary=----------------------------123456789abc
Content-Length: 33554432

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
X-Asana-Content-String-Length: 53
Set-Cookie: TooBusyRedirectCount=0
X-Server-Name: prod-ws151.ec2
X-Asana-Preferred-Release-Revision: 20170713_201158_ff4268a5d805343b36edf88b7baa137f2d93a05b
X-Robots-Tag: none
Strict-Transport-Security: max-age=31536000; includeSubDomains
Datacenter-Time-End: 1499990754.863
X-LoadBalancer: prod-lb001.ec2

{"data":{"id":234567890123456,"name":"file1234.ext"}}

#2

Thanks, @Myroslav_Opyr, for breaking this down in such detailed repro steps.

My hunch is that this has somewhat degraded over time. The mechanism we use for API attachments is different than that used in our product, and my gut instinct is that, over time, as we’ve been focusing on performance and adjusting what our production webserver clusters look like, we may have inadvertently introduced regressions.

You’re not the only one noticing that our attachment endpoint seems to have issues, for what it’s worth. I’ve pinged the team that we likely have a bug or two floating around that deserve attention, and we’ll take a look to see what we can find.

Thanks again!


#3

Yes I keep having issues with file uploads as well - no matter how I choose to upload files I get an “Error Forbidden” when I click on the file I attached.

:frowning: