{"record":{"id":"dabd18e7e0e0e64b","repo":"hasura/graphql-engine","slug":"cannot-determine-name-of-database-for-which-curren","errorCode":null,"errorMessage":"cannot determine name of database for which current migrations / seed belong to, found 0 connected databases on hasura %v","messagePattern":"cannot determine name of database for which current migrations / seed belong to, found 0 connected databases on hasura (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/scripts/update-project-v3.go","lineNumber":121,"sourceCode":"\tif err != nil {\n\t\treturn errors.E(op, err)\n\t}\n\n\tif len(targetDatabase) == 0 {\n\t\tif len(sources) == 1 && sources[0] == \"default\" {\n\t\t\ttargetDatabase = sources[0]\n\t\t} else if len(sources) > 0 {\n\t\t\ttargetDatabase, err = util.GetSelectPrompt(\n\t\t\t\t\"what database does this current migrations / seeds belong to?\",\n\t\t\t\tsources,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.E(op, err)\n\t\t\t}\n\t\t} else {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\n\t\t\t\t\t\"cannot determine name of database for which current migrations / seed belong to, found 0 connected databases on hasura %v\",\n\t\t\t\t\tsources,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\n\topts.EC.Spinner.Start()\n\topts.EC.Spin(\"updating project... \")\n\n\tdefer opts.EC.Spinner.Stop()\n\n\tif len(sources) >= 1 {\n\t\topts.EC.Logger.Debug(\"start: copying state from hdb_catalog.schema_migrations\")\n\t\topts.EC.Spin(\"Moving state from hdb_catalog.schema_migrations \")\n\n\t\terr := CopyState(opts.EC, targetDatabase, targetDatabase)\n\t\tif err != nil {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/scripts/update-project-v3.go#L103-L139","documentation":"Thrown by scripts.UpdateProjectV3 when the CLI needs to infer which database the existing flat migrations/seed belong to, but the server reports zero connected databases (other than possibly the default). With V3, migrations live under migrations/<dbname>/, so a source database must be identifiable to move them into.","triggerScenarios":"Running update-project-v3 against a server whose source list contains no usable database sources — e.g. all sources were removed, only an MSSQL/other source type that isn't eligible, or the sources query returned empty.","commonSituations":"Fresh server with metadata but no data sources attached, sources deleted before migration, or connecting to the wrong (empty) environment.","solutions":["Add (or restore) at least one database source on the server (e.g. hasura msr... or via console: Data -> Connect Database) and retry","Verify you're pointed at the correct environment/endpoint that actually has your sources","If the project genuinely has no database, consider starting from a fresh V3 project instead of upgrading"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify at least one database source exists before upgrade:\nsources, err := ec.APIClient.V1Metadata.GetSources() // or list sources via API\nif err != nil { return err }\nif countDatabaseSources(sources) == 0 {\n\treturn errors.New(\"connect a database source before upgrading to V3\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Attach the target database source before running update-project-v3","Confirm you're pointing at the environment that owns your migrations"],"tags":["go","upgrade","metadata-v3","data-source","hasura-cli"],"backgroundTag":"no-database-source-connected","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}