hasura/graphql-engine · error

error fetching server config: %v

Error message

error fetching server config: %v

What it means

Thrown when resolving a type predicate (boolean expression) that must recurse into an object type, but the named custom object type cannot be found in the resolved metadata. This usually means the type was never tracked, was renamed, or resolution ordering dropped it.

Source

Thrown at cli/cli.go:259

	}
	defer r.Body.Close()

	if r.StatusCode != http.StatusOK {
		var horror hasuradb.HasuraError

		err := json.NewDecoder(r.Body).Decode(&horror)
		if err != nil {
			return errors.E(
				op,
				errors.KindHasuraAPI,
				stderrors.New("error unmarshalling fetching server config"),
			)
		}

		return errors.E(
			op,
			errors.KindHasuraAPI,
			fmt.Errorf("error fetching server config: %v", horror.Error()),
		)
	}

	return nil
}

// HasuraServerConfig is the type returned by the v1alpha1/config API
// TODO: Move this type to a client implementation for hasura.
type HasuraServerInternalConfig struct {
	ConsoleAssetsDir string `json:"console_assets_dir"`
}

// GetVersionEndpoint provides the url to contact the version API.
func (c *ServerConfig) GetVersionEndpoint() string {
	nurl := *c.ParsedEndpoint
	nurl.Path = path.Join(nurl.Path, c.APIPaths.Version)

	return nurl.String()

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Check the type name in the error exists and is tracked in metadata
  2. Fix typos or stale references in relationships/commands pointing to the missing type
  3. Re-apply complete metadata rather than partial updates
  4. Look for a prior ObjectTypeNotFound or tracking error that caused this type to be skipped

Example fix

// before
kind: relationship
name: articles
targetType: Artical # typo
// after
kind: relationship
name: articles
targetType: Article
Defensive patterns

Strategy: validation

Validate before calling

// Ensure every type referenced by relationships/commands exists in metadata
const missing = refs.filter(r => !metadata.types[r.targetType]);
if (missing.length) throw new Error(`Untracked types: ${missing.map(m => m.targetType)}`);

Type guard

const typeExists = (meta, name) => Object.prototype.hasOwnProperty.call(meta.types, name);

Try / catch

try { resolve(); } catch (e) { if (e?.code === 'ObjectTypeNotFound') suggestTracking(e.type_name); else throw e; }

Prevention

When it happens

Trigger: A filter predicate or boolean expression type references a CustomTypeName that is absent from the metadata's type map, e.g. a relationship target type that isn't tracked, or a command output type that was removed while predicates on it still exist.

Common situations: Renaming or untracking a type without updating relationships/commands that reference it; copy-paste typos in type names in metadata YAML/JSON; partial applies of metadata leaving dangling type references.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/ba80ed51b9022b4f. Report an issue: GitHub.