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.

I am facing the same issue, except the build fails sometimes and sometimes it works. I presume it’s some sort of throttling on contentfuls end–no error reporting makes it harder to pinpoint the root cause.

    "gatsby-plugin-canonical-urls": "^3.9.0",
    "gatsby-plugin-force-trailing-slashes": "^1.0.5",
    "gatsby-plugin-google-analytics": "^3.9.0",
    "gatsby-plugin-google-tagmanager": "^3.9.0",
    "gatsby-plugin-image": "^1.9.0",
    "gatsby-plugin-manifest": "^3.9.0",
    "gatsby-plugin-modal-routing": "^1.2.0",
    "gatsby-plugin-modal-routing-3": "^3.0.0",
    "gatsby-plugin-netlify": "^3.9.0",
    "gatsby-plugin-nprogress": "^3.9.0",
    "gatsby-plugin-offline": "^4.9.0",
    "gatsby-plugin-preact": "^5.9.0",
    "gatsby-plugin-react-helmet": "^4.9.0",
    "gatsby-plugin-robots-txt": "^1.6.8",
    "gatsby-plugin-sass": "^4.9.0",
    "gatsby-plugin-sharp": "^3.9.0",
    "gatsby-plugin-sitemap": "^4.5.0",
    "gatsby-source-contentful": "^5.9.0",
    "gatsby-source-filesystem": "^3.9.0",
    "gatsby-transformer-sharp": "^3.9.0",
    "gatsby": "^3.9.0",