API error message that seems to be blatantly false? Help!

Making the following API call (creating a bunch of fields on a Database; I’ve omitted them because of the character limit)

[
  {
    "command": "fibery.schema/batch",
    "args": {
      "commands": [
        {
          "command": "schema.field/create",
          "args": {
            "fibery/holder-type": "FranDev/Request For Consideration",
            "fibery/name": "FranDev/Fdppid",
            "fibery/type": "fibery/text",
            "fibery/meta": {
              "fibery/readonly?": false
            }
          }
        },
        {
          "command": "schema.field/create",
          "args": {
            "fibery/holder-type": "FranDev/Request For Consideration",
            "fibery/name": "FranDev/Name - First",
            "fibery/type": "fibery/text",
            "fibery/meta": {
              "fibery/readonly?": false
            }
          }
        },
        ...
        {
          "command": "schema.field/create",
          "args": {
            "fibery/holder-type": "FranDev/Request For Consideration",
            "fibery/name": "FranDev/Experience - Businesscount",
            "fibery/type": "fibery/int",
            "fibery/meta": {
              "fibery/readonly?": false
            }
          }
        },
        ...
      ]
    }
  }
]

returns this error:

[
  {
    "success": false,
    "result": {
      "name": "commands.error/schema-type-field-exists",
      "message": "'FranDev/Businesscount - Name' field for 'FranDev/Request For Consideration' database already exists.",
      "data": {
        "top": {
          "error/name": "commands.error/schema-type-field-exists",
          "error/reason": "Field already exists",
          "holder-type": "FranDev/Request For Consideration",
          "field": "FranDev/Businesscount - Name"
        },
        "cause": {
          "error/name": "commands.error/schema-type-field-exists",
          "error/reason": "Field already exists",
          "holder-type": "FranDev/Request For Consideration",
          "field": "FranDev/Businesscount - Name"
        },
        "error/reason": "Field already exists",
        "holder-type": "FranDev/Request For Consideration",
        "field": "FranDev/Businesscount - Name"
      }
    }
  }
]

but the field definitely does not already exist. In the UI, or in a fibery/schema.query call I just made:

{
          "fibery/name": "FranDev/Request For Consideration",
          "fibery/fields": [
            {
              "fibery/name": "fibery/id",
              "fibery/type": "fibery/uuid",
              "fibery/meta": {
                "fibery/secured?": false,
                "fibery/id?": true,
                "fibery/readonly?": true
              },
              "fibery/id": "0878f7b5-4565-449e-8375-667230b61fa8",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "fibery/public-id",
              "fibery/type": "fibery/text",
              "fibery/meta": {
                "fibery/secured?": false,
                "fibery/public-id?": true,
                "fibery/readonly?": true
              },
              "fibery/id": "b5c4803c-8ad1-4190-a5bb-b270b6f7efd2",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "fibery/creation-date",
              "fibery/type": "fibery/date-time",
              "fibery/meta": {
                "fibery/secured?": false,
                "fibery/creation-date?": true,
                "fibery/readonly?": true,
                "fibery/default-value": "$now"
              },
              "fibery/id": "ec961503-d207-4a46-80cb-74ab815493d5",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "fibery/modification-date",
              "fibery/type": "fibery/date-time",
              "fibery/meta": {
                "fibery/modification-date?": true,
                "fibery/required?": true,
                "fibery/readonly?": true,
                "fibery/default-value": "$now",
                "fibery/secured?": false
              },
              "fibery/id": "8bfa5638-2299-4685-9dc2-b06714c210ec",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "fibery/rank",
              "fibery/type": "fibery/rank",
              "fibery/meta": {
                "fibery/secured?": false
              },
              "fibery/id": "ea3d21c2-87d1-49c8-a68e-9db33daff633",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "fibery/created-by",
              "fibery/type": "fibery/user",
              "fibery/meta": {
                "fibery/readonly?": true,
                "fibery/default-value": {
                  "fibery/id": "$my-id"
                }
              },
              "fibery/id": "3f7a9a49-cb7d-4f14-848b-8dd319b58e0f",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "Collaboration~Documents/References",
              "fibery/type": "Collaboration~Documents/Reference",
              "fibery/meta": {
                "fibery/collection?": true,
                "fibery/entity-component?": true
              },
              "fibery/id": "9ecc15d9-fe5e-4223-b9d7-b0d8671cf7cd",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "Files/Files",
              "fibery/type": "fibery/file",
              "fibery/meta": {
                "fibery/collection?": true,
                "fibery/entity-component?": true,
                "ui/object-editor-order": 3
              },
              "fibery/id": "8ad999b3-b0d3-4d16-b1cb-a061e5d0d3ba",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "FranDev/Description_0qvveh2_deleted",
              "fibery/type": "Collaboration~Documents/Document",
              "fibery/meta": {
                "fibery/entity-component?": true,
                "ui/object-editor-order": null,
                "fibery/required?": true
              },
              "fibery/id": "31777a65-6cc0-4dc6-bc9a-f17e01c844db",
              "fibery/deleted?": true
            },
            {
              "fibery/name": "FranDev/Discovery Process",
              "fibery/type": "FranDev/Discovery Process",
              "fibery/meta": {
                "fibery/relation": "9aa288b0-3f0a-11ee-a4ed-872df5dde4f4",
                "ui/object-editor-order": 1
              },
              "fibery/id": "19c1c058-a38a-4114-841b-8cd3fcac9dff",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "FranDev/Name",
              "fibery/type": "fibery/text",
              "fibery/meta": {
                "fibery/secured?": true,
                "ui/title?": true
              },
              "fibery/id": "a2ba053c-cbdb-4ade-a6a0-e3ce05e4d0b4",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "FranDev/Test_0a3phzf_deleted",
              "fibery/type": "fibery/text",
              "fibery/meta": {
                "ui/object-editor-order": 2,
                "fibery/secured?": true
              },
              "fibery/id": "22595bab-289d-4282-8f0d-781d21a0137f",
              "fibery/deleted?": true
            },
            {
              "fibery/name": "FranDev/Tripetto Fingerprint",
              "fibery/type": "fibery/text",
              "fibery/meta": {
                "ui/object-editor-order": 5,
                "fibery/secured?": true
              },
              "fibery/id": "dfbfc88a-d24d-4faf-98d6-ee0304141c9d",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "FranDev/Tripetto ID",
              "fibery/type": "fibery/text",
              "fibery/meta": {
                "ui/object-editor-order": 4,
                "fibery/secured?": true
              },
              "fibery/id": "b135ce60-c650-49b9-b064-38d1d7a072a1",
              "fibery/deleted?": false
            },
            {
              "fibery/name": "FranDev/Tripetto Stencil",
              "fibery/type": "fibery/text",
              "fibery/meta": {
                "ui/object-editor-order": 6,
                "fibery/secured?": true
              },
              "fibery/id": "b5f8d5be-afb1-4785-8be3-373a354c6084",
              "fibery/deleted?": false
            }
          ],
          "fibery/meta": {
            "fibery/primitive?": false,
            "fibery/domain?": true,
            "fibery/secured?": true,
            "ui/color": "#6a849b",
            "app/mixins": {
              "fibery/rank-mixin": true,
              "Collaboration~Documents/ReferencesMixin": true,
              "Files/Files-mixin": true
            }
          },
          "fibery/id": "2299db10-3ac9-11ee-8de9-2dc318e5a8ba",
          "fibery/deleted?": false
        }

Are there any errors in the back end that would clarify what’s going on? Is it a delay issue, where I’m just not seeing the latest schema?

1 Like

Have there previously been fields with these names?

No, there haven’t… Hmm. So, the way I first got the error was by making that API call (a single batch command with many create field commands inside), but I had tried to specify a primitive type that didn’t exist (“fibery/phone”).

After changing those primitives in the API body to "fibery/text instead, I reran the request. That’s when I started getting this “already exists” error.

Because the other fields didn’t show up in the UI or the schema query, I assumed the whole batch of commands were successfully rolled back. Maybe they weren’t? Or maybe they left …“pieces” somewhere? :person_shrugging: I don’t know how these things work.

It might be worth testing that by running a delete field API call for these fields, and then trying again to recreate them