# CMakePresets.json: Could not read presets: Invalid preset

**URL:** https://discourse.cmake.org/t/cmakepresets-json-could-not-read-presets-invalid-preset/4883
**Category:** Usage
**Created:** [January 20, 2022, 10:28pm UTC](https://discourse.cmake.org/t/cmakepresets-json-could-not-read-presets-invalid-preset/4883 "2022-01-20T22:28:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Allison\_Vacanti](https://discourse.cmake.org/user_avatar/discourse.cmake.org/allison_vacanti/32/2123_2.png) [@Allison\_Vacanti](https://discourse.cmake.org/u/Allison_Vacanti)
#### Post date: [January 20, 2022, 10:28pm UTC](https://discourse.cmake.org/t/cmakepresets-json-could-not-read-presets-invalid-preset/4883/1 "2022-01-20T22:28:34Z")

</div>

I’m trying to setup a `CMakePresets.json` file, included below. When I try to use it, I get a very basic error message: “Invalid preset”, with no details or context. I’ve validated this against the published schema, but there are no errors reported. I’ve double checked it against the documentation, but I don’t see any issues.

Is this a bug in the parser, or a problem with my file?

cc: @kyle.edwards

```auto
{
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 21,
    "patch": 0
  },
  "version": 3,
  "configurePresets": [
    {
      "name": "base",
      "hidden": true,
      "description": "Basic Thrust config for building tests, etc.",
      "cacheVariables": {
        "THRUST_ENABLE_EXAMPLES": true,
        "THRUST_ENABLE_TESTING": true,
        "THRUST_ENABLE_BENCHMARKS": true
      }
    },
    {
      "name": "base-mc-systems_none",
      "inherits": "base",
      "hidden": true,
      "description": "Base multiconfig with no systems enabled.",
      "cacheVariables": {
        "THRUST_ENABLE_MULTICONFIG": true,
        "THRUST_IGNORE_DEPRECATED_CPP_11": true,
        "THRUST_MULTICONFIG_ENABLE_DIALECT_ALL": true,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_CPP": false,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_TBB": false,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_OMP": false,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_CUDA": false
      }
    },
    {
      "name": "base-mc-systems_cuda",
      "inherits": "base-mc-systems_none",
      "hidden": true,
      "description": "Base multiconfig + CUDA config.",
      "cacheVariables": {
        "THRUST_DISABLE_ARCH_BY_DEFAULT": false,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_CPP": true,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_OMP": true,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_TBB": true,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_CUDA": true,
        "THRUST_MULTICONFIG_WORKLOAD": "SMALL",
        "THRUST_INCLUDE_CUB_CMAKE": true,
        "CUB_ENABLE_EXAMPLES": true,
        "CUB_ENABLE_TESTING": true,
        "CUB_ENABLE_HEADER_TESTING": true
      }
    },
    {
      "name": "base-mc-systems_nocuda",
      "inherits": "base-mc-systems_none",
      "hidden": true,
      "description": "Base multiconfig + CPU-only config.",
      "cacheVariables": {
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_CPP": true,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_OMP": true,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_TBB": true,
        "THRUST_MULTICONFIG_WORKLOAD": "LARGE"
      }
    },
    {
      "name": "base-mc-systems_all",
      "inherits": "base-mc-systems_cuda",
      "hidden": true,
      "description": "Base multiconfig with all systems enabled.",
      "cacheVariables": {
        "THRUST_MULTICONFIG_WORKLOAD": "LARGE"
      }
    },
    {
      "name": "exhaustive",
      "inherits": "base-mc-systems_all",
      "description": "ci/local/build.bash's 'Exhaustive' coverage plan.",
      "binaryDir": "build",
      "cacheVariables": {}
    },
    {
      "name": "thorough",
      "inherits": "base-mc-systems_cuda",
      "description": "ci/local/build.bash's 'Thorough' coverage plan.",
      "binaryDir": "build",
      "cacheVariables": {
        "THRUST_DISABLE_ARCH_BY_DEFAULT": true,
        "THRUST_AUTO_DETECT_COMPUTE_ARCH": true,
        "THRUST_ENABLE_COMPUTE_50": true,
        "THRUST_ENABLE_COMPUTE_60": true,
        "THRUST_ENABLE_COMPUTE_70": true,
        "THRUST_ENABLE_COMPUTE_80": true
      }
    },
    {
      "name": "minimial",
      "inherits": "base-mc-system_cuda",
      "description": "ci/local/build.bash's 'Minimal' coverage plan.",
      "binaryDir": "build",
      "cacheVariables": {
        "THRUST_DISABLE_ARCH_BY_DEFAULT": true,
        "THRUST_AUTO_DETECT_COMPUTE_ARCH": true,
        "THRUST_MULTICONFIG_ENABLE_DIALECT_ALL": false,
        "THRUST_MULTICONFIG_ENABLE_DIALECT_LATEST": true,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_TBB": false,
        "THRUST_MULTICONFIG_ENABLE_SYSTEM_OMP": false
      }
    },
    {
      "name": "test",
      "inherits": "base-mc-system_cuda",
      "binaryDir": "build"
    }
  ],
  "testPresets": [
    {
      "name": "base",
      "hidden": true,
      "output": {
        "outputOnFailure": true
      },
      "execution": {
        "noTestsAction": "error",
        "stopOnFailure": false
      }
    },
    {
      "name": "base-no_cuda",
      "inherits": "base",
      "hidden": true,
      "filter": {
        "exclude": {
          "name": "^thrust\\.[^.]+\\.cuda\\.|^cub\\."
        }
      }
    },
    {
      "name": "base-all",
      "inherits": "base",
      "hidden": true
    },
    {
      "name": "test",
      "inherits": "base-no_cuda",
      "configurePreset": "test"
    }
  ]
}

```

---

<div class="post-metadata">

### Author: ![Allison\_Vacanti](https://discourse.cmake.org/user_avatar/discourse.cmake.org/allison_vacanti/32/2123_2.png) [@Allison\_Vacanti](https://discourse.cmake.org/u/Allison_Vacanti)
#### Post date: [January 20, 2022, 10:34pm UTC](https://discourse.cmake.org/t/cmakepresets-json-could-not-read-presets-invalid-preset/4883/2 "2022-01-20T22:34:04Z")

</div>

Ah, solved it – I had a typo in one of the inherit fields, `s/system_/systems_/` seems to fix it.

Sorry for the noise, and looking forward to [https://gitlab.kitware.com/cmake/cmake/-/issues/21310](https://gitlab.kitware.com/cmake/cmake/-/issues/21310) 🙂

---

<div class="post-metadata">

### Author: ![phread](https://discourse.cmake.org/user_avatar/discourse.cmake.org/phread/32/2285_2.png) [@phread](https://discourse.cmake.org/u/phread)
#### Post date: [June 21, 2023, 2:56pm UTC](https://discourse.cmake.org/t/cmakepresets-json-could-not-read-presets-invalid-preset/4883/3 "2023-06-21T14:56:21Z")

</div>

Is there a way to get the parser to help?  
The error messages are not wrong but they are terse.  
In your case it says “invalid preset” it would be more helpful if it said “base\_mc-system\_cuda is an invalid preset”.

I am currently getting “Duplicate presets” but I have many presets.
