Contentful logo

Contentful Community

Linked Assets randomly disappearing

Hello everyone, I’m having an issue with linked assets randomly disappearing on rebuild in Gatsby. When I look at my content in Contenful it appears as published, however, when querying with GraphQL it returns “null” (please see screenshot) - even though, it just worked fine and all the content was loaded!
The only way to solve it, is to delete the asset, re-upload and relink it. It’s extremely annoying.
Has anyone experienced something similar or could point me to where I can find help with this issue? Thanks!

clearing the cache with “gatsby clean” solved the issue.

1 Like

Thanks for the workaround @marius.gessler!

This issue seems to specifically be caused when moving the position of an asset within an entry (or adding additional assets to an entry, where one or more assets already exists).

An alternative workaround is to unpublish and republish the affected assets within Contentful, but this is not sustainable.

1 Like

Hi Jim, thanks for your input. Unfortunately, the workaround you proposed didn’t work for me, I had to delete the assets entirely and reupload them, which is extremely tedious when working with a lot of images.