{"record":{"id":"3183f3523cd4103a","repo":"apache/cassandra","slug":"type-s-s-doesn-t-exist-3183f3","errorCode":null,"errorMessage":"Type '%s.%s' doesn't exist","messagePattern":"Type '(.+?)\\.(.+?)' doesn't exist","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/SchemaDescriptionStatement.java","lineNumber":102,"sourceCode":"        KeyspaceMetadata keyspaceMetadata = validateAndGetKeyspace(schema);\n\n        TableMetadata tableMetadata = keyspaceMetadata.getTableOrViewNullable(tableName);\n        if (null == tableMetadata)\n            throw ire(\"Table '%s.%s' doesn't exist\", keyspaceName, tableName);\n\n        if (tableMetadata.kind != REGULAR)\n            throw ire(\"Cannot set %s on non-regular table '%s.%s'\",descriptionType.value, keyspaceName, tableName);\n\n        return tableMetadata;\n    }\n\n    protected UserType validateAndGetType(Keyspaces schema, String typeName)\n    {\n        KeyspaceMetadata keyspaceMetadata = validateAndGetKeyspace(schema);\n\n        UserType type = keyspaceMetadata.types.getNullable(bytes(typeName));\n        if (null == type)\n            throw ire(\"Type '%s.%s' doesn't exist\", keyspaceName, typeName);\n\n        return type;\n    }\n\n    protected UserType validateAndGetTypeField(Keyspaces schema,\n                                               String typeName,\n                                               FieldIdentifier fieldName)\n    {\n        UserType type = validateAndGetType(schema, typeName);\n\n        if (type.fieldPosition(fieldName) == -1)\n            throw ire(\"Field '%s' doesn't exist in type '%s.%s'\", fieldName, keyspaceName, typeName);\n\n        return type;\n    }\n\n    protected String effectiveDescription()\n    {","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/SchemaDescriptionStatement.java#L84-L120","documentation":"validateAndGetType looks up a user-defined type (UserType) in the keyspace metadata by name. When no type with that name exists in the resolved keyspace, it throws this InvalidRequestException instead of returning null.","triggerScenarios":"Executing a type-affecting statement (e.g. DESCRIBE TYPE myks.mytype or security labels on a type field) where mytype does not exist in the given keyspace; using a type that exists in another keyspace.","commonSituations":"Typos in the type name; forgetting to qualify with the keyspace when connected to a different keyspace; the type was dropped or never created; environment mismatch (dev vs prod schema).","solutions":["Check the type exists: SELECT type_name FROM system_schema.types WHERE keyspace_name = '<ks>';","Fully qualify the type with its keyspace (myks.mytype) or USE the correct keyspace first.","Recreate the missing type with CREATE TYPE if it was accidentally dropped."],"exampleFix":"// before\nDESCRIBE TYPE myks.custmer_type\n// after\nDESCRIBE TYPE myks.customer_type","handlingStrategy":"validation","validationCode":"SELECT type_name FROM system_schema.types WHERE keyspace_name = 'myks' AND type_name = 'mytype'; // must return a row before running type statements","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always keyspace-qualify type names in scripts.","Keep schema migrations in version control so types exist in every environment."],"tags":["cql","schema","user-defined-type","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}