Problem with updating file via COS Files API


#1

Hello,

Please, see what problem I have.

I have some file in File system.
I have updated this file using this API method:

But file content was not updated.
According to this article:


File should be updated in 2 hours. I was waiting for about 16 hours, but file is still not updated.

Even if I delete file using this method:


and upload new file with the same name, file content is still not updated, even after 16 hours.

But, I have found really interesting behavior.
If I change file name in File manager, just adding one more character or symbol, and try opening file with new name, file content is updated. And if I rename file to old name, file content is still old one.

Can anybody explain me what is going on?

Thanks


#2

Hi @kremenetskyi,

Can you reach back out with a link to a specific file that you’ve seen this behavior with?


#3

Now it is updated, after some time (more than 16 hours).

I will update this post with links for new files soon.


#4

Hello,

Please, see this file:
https://app.hubspot.com/file-preview/4022346/file/5539413870/

But seems like you can’t see this file, if you are not logged in system. I don’t know how to show…
If I change content file via API, I see old content.
If I rename this file, content becomes correct (new one).
If I rename to old name, content becomes old (


#5

Also, please, see

If I see file like this:
https://app.hubspot.com/file-preview/4022346/file/5539413870/
it is old one
but, if I see the same file here:


there is new content.

It seems like some problem with CDNs updating.

Could you check?

Thanks.


#6

And only now file https://app.hubspot.com/file-preview/4022346/file/5539413870/
is updated
It got about 24 hours…
So pity.


#7

Hi @kremenetskyi,

I’m digging into this with the team now. Based on the examples I’ve been able to produce, I haven’t seen the same behavior, but we’re still working through the behavior. Just to make sure I fully understand the process you’re using:


#8

Hello @Derek_Gervais,

Thanks for your attention.
About process:

  1. It doesn’t matter way for uploading file. I uploaded via endpoint: https://developers.hubspot.com/docs/methods/files/post_files. Also, I uploaded file just via File Manager. Results are the same.
  2. Yes, replace via: https://developers.hubspot.com/docs/methods/files/post_files_file_id
  3. Yes.

#9

Hi @kremenetskyi,

Thank you, that’s helpful to have confirmed. As I said before, I’m digging into this with the team now. I’ll be sure to reach out in this topic when I have more information on this issue.


#10

Hello

Any news about this issue?


#11

Hi @kremenetskyi,

Sorry for the radio silence here. It appears this caching was due to a complication with some CDN updates that were made recently. While I don’t have a precise timeline, the team is currently working on a fix. I’ll update this thread when I have more information.


#12

Hello,

It will be really great, if you can update status here.

Thank you @Derek_Gervais


#13

Hi @kremenetskyi,

Sure thing; appreciate the patience here. This has been a particularly tricky issue to pin down. It had to do with the CDN changes taking effect in certain domains, but not others. The file-preview domains weren’t updated along with the other domains, which meant that the caches weren’t being cleared. This update is in progress now; caching times for CDN2 links should now reflect the normal ~2 hour max. I’ll post again here when I get confirmation from my team that it’s been complete for the file-preview domain as well.