Error deploying Gatsby site

Hello there,

I’m trying to do a deploy using a gatsby site, linked from gitlab repo. The problem comes while trying to do the build in netlify as follow:

────────────────────────────────────────────────────────────────
11:58:16 AM:   1. @netlify/plugin-gatsby (onPreBuild event)                  
11:58:16 AM: ────────────────────────────────────────────────────────────────
11:58:16 AM: ​
11:58:16 AM: ​
11:58:16 AM: ────────────────────────────────────────────────────────────────
11:58:16 AM:   Plugin "@netlify/plugin-gatsby" internal error                
11:58:16 AM: ────────────────────────────────────────────────────────────────
11:58:16 AM: ​
11:58:16 AM:   Error message
11:58:16 AM:   Error: Cannot cache /opt/build/repo because it is the current directory (/opt/build/repo) or a parent directory
11:58:16 AM: ​
11:58:16 AM:   Plugin details
11:58:16 AM:   Package:        @netlify/plugin-gatsby
11:58:16 AM:   Version:        2.0.2
11:58:16 AM:   Repository:     git+https://github.com/netlify/netlify-plugin-gatsby.git
11:58:16 AM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-gatsby
11:58:16 AM:   Report issues:  https://github.com/netlify/netlify-plugin-gatsby/issues

I installed the netlify plugin Essential Gatsby and add to package.json and gatsby-config
Sorry in advance if a dumb question, i’m still learning to use gatsby stack.
Am I missing something?

Hey @nightkami,

Could you share your site URL?

Hi @hrishikesh, of course: Site URL

Error says something onPreBuild:

3:08:57 PM:   Error location
3:08:57 PM:   In "onPreBuild" event in "@netlify/plugin-gatsby" from Netlify app
3:08:57 PM:       at checkSrcPath (file:///opt/buildhome/node-deps/node_modules/@netlify/cache-utils/src/path.js:44:11)
3:08:57 PM:       at getSrcPath (file:///opt/buildhome/node-deps/node_modules/@netlify/cache-utils/src/path.js:18:3)
3:08:57 PM:       at async parsePath (file:///opt/buildhome/node-deps/node_modules/@netlify/cache-utils/src/path.js:9:19)
3:08:57 PM:       at async restoreOne (file:///opt/buildhome/node-deps/node_modules/@netlify/cache-utils/src/main.js:37:34)
3:08:57 PM:       at async Promise.all (index 0)
3:08:57 PM:       at async allowMany (file:///opt/buildhome/node-deps/node_modules/@netlify/cache-utils/src/main.js:84:19)
3:08:57 PM:       at async restoreCache (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/lib/helpers/cache.js:27:9)
3:08:57 PM:       at async onPreBuild (/opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-gatsby/lib/index.js:41:5)
3:08:57 PM:       at async Object.run (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins/child/run.js:21:3)
3:08:57 PM:       at async handleEvent (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins/child/main.js:41:38)

Hey @nightkami,

Could you try removing the plugin for the time being? If that fixes it, maybe we can add it again later?