{"record":{"id":"1cd27459b73fdf4a","repo":"hasura/graphql-engine","slug":"no-sql-files-found-in-s","errorCode":null,"errorMessage":"no SQL files found in %s","messagePattern":"no SQL files found in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/seed/apply.go","lineNumber":142,"sourceCode":"\t\tfor _, sql := range sqlAsBytes {\n\t\t\trequest := hasura.RequestBody{\n\t\t\t\tType: \"citus_run_sql\",\n\t\t\t\tArgs: hasura.CitusRunSQLInput{\n\t\t\t\t\tSQL:    string(sql),\n\t\t\t\t\tSource: source.Name,\n\t\t\t\t},\n\t\t\t}\n\t\t\targs = append(args, request)\n\t\t}\n\tdefault:\n\t\treturn errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"database %s of kind %s is not supported\", source.Name, source.Kind),\n\t\t)\n\t}\n\n\tif len(args) == 0 {\n\t\treturn errors.E(op, fmt.Errorf(\"no SQL files found in %s\", seedsDirectory))\n\t}\n\n\t_, err := d.SendBulk(args)\n\tif err != nil {\n\t\treturn errors.E(op, err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":124,"sourceCodeEnd":152,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/seed/apply.go#L124-L152","documentation":"ApplySeedsToDatabase collected no .sql seed files from the seeds directory and refuses to send an empty bulk request. It is thrown after the database kind check passes but before SendBulk, so a supported database with an empty (or non-matching) seeds folder triggers it. The path in the message is the resolved seedsDirectory passed in the options.","triggerScenarios":"Calling ApplySeedsToDatabase (usually via ApplyOnSource) with a seedOpts.SourceDirectory that contains no *.sql files, e.g. a missing, empty, or misnamed directory (files with wrong extension like .txt or .bak).","commonSituations":"Wrong --seeds path in CI, seeds directory never committed, seed files generated into a different folder, or a typo in the source directory name in the Hasura CLI config.","solutions":["Verify the seeds directory path passed in the seed options actually exists and contains .sql files","Check file extensions are lowercase .sql and files are readable","Generate at least one seed first (e.g. via seed.CreateSeedFile) before applying","If no seeds are expected, skip the apply step instead of calling ApplySeedsToDatabase"],"exampleFix":"// before\nseedOpts := seed.CreateSeedOpts{ SourceDirectory: \"seeds\" }\nerr := seed.ApplyOnSource(client, source, seedOpts, \"apply\")\n\n// after\nif entries, _ := os.ReadDir(\"seeds\"); !hasSQLFiles(entries) {\n    log.Println(\"no seeds to apply, skipping\")\n    return nil\n}\nerr := seed.ApplyOnSource(client, source, seedOpts, \"apply\")","handlingStrategy":"validation","validationCode":"entries, err := os.ReadDir(seedsDir)\nif err != nil { return err }\nhasSQL := false\nfor _, e := range entries {\n    if !e.IsDir() && strings.HasSuffix(e.Name(), \".sql\") { hasSQL = true; break }\n}\nif !hasSQL {\n    // skip apply instead of erroring\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the seeds directory for *.sql files before invoking apply","Automate seed generation so the directory is never empty in CI","Fail CI early with a clear message when the seeds path is misconfigured"],"tags":["seeds","filesystem","hasura-cli","sql"],"backgroundTag":"empty-input-directory","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}