Gatsby v4 build error MDB_PROBLEM: Unexpected problem - txn should abort

  • Netlify site name:

http://www.paigeniedringhaus.com

  • Build problems?

Link to full build log: Netlify App

There’s no special env vars, no special build commands or folders, just a run of the mill gatsby build command.


Hello there!

Two weeks ago I upgraded my Gatsby site from v2 to v4. During local development and builds everything went fine, but when I pushed my newly upgraded site to Netlify for automatic deploying it failed multiple times due to an EPIPE error. I tried some of the workarounds in this support thread, to no avail, and ultimately ended up building my production bundle locally and deploying it from my machine via the Netlify CLI.

On April 28, Grayson Hicks responded to a frustrated tweet I’d made letting me know the issue was fixed.

Today, I wanted to verify if that was the case so I triggered a redeploy of my main site branch and hit a new error during the gatsby build process MDB_PROBLEM: Unexpected problem - txn should abort.

I’d love to be able to turn automatic deploys back on for when I update this website so any help you can provide to get builds with Gatsby v4.12.1+ working again would be much appreciated.

Thanks!

hi there paige,

thanks for letting us know - question:

Does this new build work locally?

Can you share your package.json with us?

I’m assuming you opted for “clear cache and redeploy” to get fresh packages for your build, but can you confirm? thanks!

Hi Perry,

Yes, this build works locally (I haven’t actually changed anything since I built and deployed it using the Netlify CLI a few weeks back - after I got the note on Twitter the EPIPE error was fixed, I was curious to see if I could turn back on my auto deploys, so I just tried rebuilding my unchanged “master” branch).

Here’s the package.json - I’m using Node v14.16 and Yarn.

{
  "name": "paigeniedringhaus.com",
  "description": "Personal website of Paige Niedringhaus running on Gatsby and React",
  "version": "1.1.0",
  "author": "Paige Niedringhaus <hellopaigen@gmail.com>",
  "repository": "https://github.com/paigen11/paigeniedringhaus.com.git",
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^6.1.1",
    "@fortawesome/free-brands-svg-icons": "^6.1.1",
    "@fortawesome/free-solid-svg-icons": "^6.1.1",
    "@fortawesome/react-fontawesome": "^0.1.9",
    "classnames": "^2.2.6",
    "gatsby": "4.12.1",
    "gatsby-cli": "4.12.1",
    "gatsby-plugin-catch-links": "4.12.1",
    "gatsby-plugin-feed": "4.12.1",
    "gatsby-plugin-google-analytics": "4.12.1",
    "gatsby-plugin-google-fonts": "^1.0.1",
    "gatsby-plugin-google-gtag": "4.12.1",
    "gatsby-plugin-image": "^2.12.1",
    "gatsby-plugin-lodash": "^5.12.1",
    "gatsby-plugin-mailgo": "^0.12.2",
    "gatsby-plugin-manifest": "4.12.1",
    "gatsby-plugin-nprogress": "4.12.1",
    "gatsby-plugin-offline": "^5.12.1",
    "gatsby-plugin-react-helmet": "^5.12.1",
    "gatsby-plugin-react-helmet-canonical-urls": "^1.4.0",
    "gatsby-plugin-sass": "^5.12.1",
    "gatsby-plugin-sharp": "4.12.1",
    "gatsby-plugin-sitemap": "^5.12.1",
    "gatsby-plugin-twitter": "4.12.1",
    "gatsby-remark-autolink-headers": "^5.12.1",
    "gatsby-remark-code-titles": "^1.1.0",
    "gatsby-remark-copy-linked-files": "^5.12.1",
    "gatsby-remark-embed-video": "^3.1.1",
    "gatsby-remark-images": "^6.12.1",
    "gatsby-remark-prismjs": "^6.12.1",
    "gatsby-remark-relative-images": "^2.0.2",
    "gatsby-remark-responsive-iframe": "^5.12.1",
    "gatsby-source-filesystem": "4.12.1",
    "gatsby-transformer-remark": "^5.12.1",
    "gatsby-transformer-sharp": "4.12.1",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "node-sass": "^4.0.1",
    "prismjs": "^1.22.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-headroom": "^3.1.0",
    "react-helmet": "^6.1.0",
    "react-share": "^4.1.0",
    "react-twitter-widgets": "^1.7.1",
    "url-join": "^4.0.0"
  },
  "devDependencies": {
    "cli-glob": "^0.1.0",
    "eslint": "^6.8.0",
    "eslint-config-airbnb": "^18.1.0",
    "eslint-config-prettier": "^6.10.1",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-jsx-a11y": "^6.2.1",
    "eslint-plugin-react": "^7.19.0",
    "gatsby-plugin-netlify": "^4.3.0",
    "gh-pages": "^2.2.0",
    "prettier": "^2.0.2",
    "remark-cli": "^8.0.0",
    "remark-preset-lint-recommended": "^4.0.0",
    "stylelint": "^13.2.1",
    "stylelint-config-prettier": "^8.0.1",
    "stylelint-config-standard": "^20.0.0",
    "write-good": "^1.0.1"
  },
  "keywords": [
    "paige niedringhaus",
    "development",
    "dev",
    "tech",
    "articles",
    "blog",
    "developer",
    "frontend",
    "react",
    "gatsby"
  ],
  "license": "MIT",
  "main": "n/a",
  "scripts": {
    "develop": "gatsby develop",
    "dev": "npm run develop",
    "serve": "gatsby serve",
    "build": "gatsby build",
    "build:pp": "gatsby build --prefix-paths",
    "build:gh": "npm run clean && npm run build:pp && gh-pages -d public",
    "clean": "rm -rf public && rm -rf .cache",
    "lint:js": "eslint --ext .js,.jsx .",
    "lint:md": "remark content/",
    "write-good": "write-good $(glob 'content/posts/**/*.md')",
    "format:js": "prettier '**/*.{js,jsx}' --write",
    "format:styles": "prettier '**/*.{css,scss}' --write"
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-lint-recommended"
    ]
  },
  "volta": {
    "node": "14.16.1",
    "npm": "7.20.1",
    "yarn": "1.22.17"
  }
}

And yes, I did run “clear cache and redeploy” to get a fresh build.

thanks for that, paige. Good news, the fix is actually in gatsby 4.13.1 so the ball is still in play. confirmed by our team here:

Can you try editing your package.json to pull 4.13.1, clear cache and reploy, and hopefully this will be the fix? :crossed_fingers: let us know.

Thanks Perry, it worked! I really appreciate your help and finding the fix - you rock!

I just re-enabled auto deploys for my Netlify pipeline and I’m very grateful!

1 Like

So glad this got you unstuck! Happy building :rocket:

I got this error today using Gatsby 4.14, I had to redeploy
build log

Hey @npg,

It appears the the following builds are working? Are you still having issues?

I am still getting this error
“gatsby”: “^5.8.1”,

12:49:34 PM: success write out requires - 0.004s

12:49:35 PM: warning `isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration`

12:49:35 PM: at isModuleDeclaration (/opt/build/repo/node_modules/@babel/types/lib/validators/generated/index.js:3940:35)

12:49:35 PM: at PluginPass.Program (/opt/build/repo/node_modules/babel-plugin-lodash/lib/index.js:102:44)

12:49:56 PM: success Building production JavaScript and CSS bundles - 21.845s

12:50:06 PM: success Building HTML renderer - 9.946s

12:50:06 PM: success Execute page configs - 0.042s

12:50:06 PM: success Caching Webpack compilations - 0.000s

12:50:07 PM: error [Error: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid]

12:50:07 PM: error [Error: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid]

12:50:07 PM: error [Error: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid]

12:50:07 PM: error [Error: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid]

12:50:07 PM: error [Error: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid]

12:50:07 PM: error Commit failed (see commitError for details)

12:50:07 PM: error An error occurred during parallel query running.

12:50:07 PM: Go here for troubleshooting tips: https://gatsby.dev/pqr-feedback

Hi @tkssharma,

Thanks for reaching out!

Could you link us to the deploy log or let us know which Netlify site (such as example.netlify.app) you’re seeing this issue with?

I’m having the same issue after I migrated from Gatsby cloud to Netlify.
It’s intermittent, sometimes the build suceeds.

Other times, the build succeeds, but Netlify fails to deploy with this error -

This is causing a lot of trouble. Please help.
I’m using Gatsby v4.16.0

Have you tried setting: GATSBY_EXCLUDE_DATASTORE_FROM_BUNDLE Build environment variables | Netlify Docs

1 Like

I think this has fixed the issue. Also the build/deploy time is much faster now. Thanks @hrishikesh