{"record":{"id":"70e11d47a9b77257","repo":"AlistGo/alist","slug":"owner-and-repo-are-required","errorCode":null,"errorMessage":"owner and repo are required","messagePattern":"owner and repo are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/gitee/driver.go","lineNumber":46,"sourceCode":"}\n\nfunc (d *Gitee) GetAddition() driver.Additional {\n\treturn &d.Addition\n}\n\nfunc (d *Gitee) Init(ctx context.Context) error {\n\td.RootFolderPath = utils.FixAndCleanPath(d.RootFolderPath)\n\td.Endpoint = strings.TrimSpace(d.Endpoint)\n\tif d.Endpoint == \"\" {\n\t\td.Endpoint = \"https://gitee.com/api/v5\"\n\t}\n\td.Endpoint = strings.TrimSuffix(d.Endpoint, \"/\")\n\td.Owner = strings.TrimSpace(d.Owner)\n\td.Repo = strings.TrimSpace(d.Repo)\n\td.Token = strings.TrimSpace(d.Token)\n\td.DownloadProxy = strings.TrimSpace(d.DownloadProxy)\n\tif d.Owner == \"\" || d.Repo == \"\" {\n\t\treturn errors.New(\"owner and repo are required\")\n\t}\n\td.client = base.NewRestyClient().\n\t\tSetBaseURL(d.Endpoint).\n\t\tSetHeader(\"Accept\", \"application/json\")\n\trepo, err := d.getRepo()\n\tif err != nil {\n\t\treturn err\n\t}\n\td.Ref = strings.TrimSpace(d.Ref)\n\tif d.Ref == \"\" {\n\t\td.Ref = repo.DefaultBranch\n\t}\n\treturn nil\n}\n\nfunc (d *Gitee) Drop(ctx context.Context) error {\n\treturn nil\n}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/gitee/driver.go#L28-L64","documentation":"Gitee driver initialization validates that both the Owner and Repo configuration fields are set after trimming whitespace; if either is empty, Init fails immediately with this error before any API call is made. It prevents constructing an invalid base URL like /api/v5/repos//contents.","triggerScenarios":"Adding or updating a Gitee storage mount where the 'owner' or 'repo' addition field is empty or contains only whitespace. drivers/gitee/driver.go:46 in Init().","commonSituations":"User filled the root folder path but left owner/repo blank; a copy of an existing storage config with the fields cleared; leading/trailing spaces or an invisible character making the field effectively empty after TrimSpace.","solutions":["Open the storage configuration for the Gitee mount and fill in both the owner (user or org name) and repo fields.","Confirm the values against the Gitee URL: https://gitee.com/<owner>/<repo>.","Re-save the storage so Init runs again and validates cleanly."],"exampleFix":"// before: storage config with empty fields\nOwner: \"\",\nRepo: \"my-repo\"\n\n// after\nOwner: \"my-org\",\nRepo: \"my-repo\"","handlingStrategy":"validation","validationCode":"owner := strings.TrimSpace(cfg.Owner)\nrepo := strings.TrimSpace(cfg.Repo)\nif owner == \"\" || repo == \"\" {\n    return fmt.Errorf(\"gitee storage needs owner and repo, got owner=%q repo=%q\", owner, repo)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate owner/repo in the UI or config layer before mounting.","Derive owner/repo from the pasted Gitee URL to avoid typos.","Fail fast on mount instead of at first request."],"tags":["gitee","config","validation","init","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}