Uploading files over API results in error 500

Hello!

We are trying to upload an attachment over API using POST https://api.pipedrive.com/v1/files endpoint, but as a result we receive

[2019-02-14T13:04:17.347420 #4]  INFO -- Status: 500
D, [2019-02-14T13:04:17.347549 #4] DEBUG -- response: content-type: "application/json; charset=UTF-8"
content-length: "100"
x-correlation-id: "b3dfe166-d06d-421a-86d1-958cb4e0688b"
badi: "Routing: us-east-1=>us-east-1; Version: aea4;"
access-control-expose-headers: "X-RateLimit-Remaining, X-RateLimit-Limit, X-RateLimit-Reset"
x-frame-options: "SAMEORIGIN"
access-control-allow-origin: "*"
x-ratelimit-limit: "40"
x-ratelimit-remaining: "39"
x-ratelimit-reset: "2"
server: "no-name-at-all"
x-xss-protection: "1; mode=block"
x-content-type-options: "nosniff"
date: "Thu, 14 Feb 2019 13:04:17 GMT"
connection: "close"
set-cookie: "pipe-last-active=1550149457127;path=/;domain=.pipedrive.com;expires=0"
server-timing: "edge; dur=2, origin; dur=427, cdn-cache; desc=MISS"
strict-transport-security: "max-age=31536000 ; includeSubDomains"
D, [2019-02-14T13:04:17.347619 #4] DEBUG -- response: Body: {"success":false,"error":"Internal Server Error occurred. Pipedrive staff was notified about this."}

Could you please help us resolving this issue?

Thanks,
Anton

P.S. We have used this endpoint to upload thousands of files over API and usually it works fine.

Can you post a snippet of the code?

What kind of files are you trying to upload? How Big?

Hi Anton, maybe you’d find this tutorial helpful https://pipedrive.readme.io/docs/adding-a-file

Here is the file information:

“name”=>“image2",
“size”=>60757,
“height”=>1280,
“width”=>707,
“encoding”=>“jpeg”,
“type”=>“IMG”,
“extension”=>“jpeg”,

I wouldn’t like to share the code, but like i have mentioned before the same code was used to import thousands of files into the Pipedrive.

You can try uploading the same file with the same condition through our API Reference https://developers.pipedrive.com/docs/api/v1/#!/Files/post_files

If it works, it means there’s probably something in your code. If it doesn’t work there either, we can look deeper into it.

yeap, it doesn’t work there either:

error 500
{
“success”: false,
“error”: “Internal Server Error occurred. Pipedrive staff was notified about this.”
}

Hey Anton,

Just curious, but is this 500 response only happening with one particular file or multiple ones?
I’m unable to replicate on my end is why I ask.

Actually it happens with a lot of files on that Pipedrive instance. We tried uploading the same file to one of the other instances and it worked correctly. So, it seems that the issue is on some instances, but not the others.

P.s. it is really bad that support for developers is now like that in the public forum. I could provide you more details (like Pipedrive instance id), but i can’t because it is a private info.

Hi Anton,
I sent you a private message about this yesterday. It’s in the same thread as the other topic. We can continue the discussion there if you prefer :slight_smile:

I believe this happens because users can have google drive integration enabled and if it fails to sync a file, API will fail with 500, but I’m not 100% sure, team responsible for file upload should investigate & if possible provide a more detailed error :thinking:

3 Likes