{"record":{"id":"e4cff4c9988e4b82","repo":"AlistGo/alist","slug":"message","errorCode":null,"errorMessage":"{message}","messagePattern":"\\{message\\}","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/123/util.go","lineNumber":237,"sourceCode":"\t//\treturn nil, err\n\t//}\n\t//req.SetQueryParam(\"auth-key\", *authKey)\n\tres, err := req.Execute(method, GetApi(url))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbody := res.Body()\n\tcode := utils.Json.Get(body, \"code\").ToInt()\n\tif code != 0 {\n\t\tif !isRetry && code == 401 {\n\t\t\terr := d.login()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tisRetry = true\n\t\t\tgoto do\n\t\t}\n\t\treturn nil, errors.New(jsoniter.Get(body, \"message\").ToString())\n\t}\n\treturn body, nil\n}\n\nfunc (d *Pan123) unlockSafeBox(fileId int64) error {\n\tif _, ok := d.safeBoxUnlocked.Load(fileId); ok {\n\t\treturn nil\n\t}\n\tdata := base.Json{\"password\": d.SafePassword}\n\turl := fmt.Sprintf(\"%s?fileId=%d\", SafeBoxUnlock, fileId)\n\t_, err := d.Request(url, http.MethodPost, func(req *resty.Request) {\n\t\treq.SetBody(data)\n\t}, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\td.safeBoxUnlocked.Store(fileId, true)\n\treturn nil","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/123/util.go#L219-L255","documentation":"Returned by the strm link reader when link.URL is relative (does not start with http:// or https://) and the site base URL from common.GetApiUrl(nil) is empty, so the relative URL cannot be absolutized. The driver deliberately refuses to guess a host.","triggerScenarios":"A .strm file containing a site-relative path like \"/d/local/video.mp4\" or \"/proxy/file\", combined with a server configuration where the site URL setting is unset (fresh install, config migration, or programmatic context where the setting is not loaded).","commonSituations":"Running the server headless/embedded without the site-URL config value; .strm files exported from another instance using relative paths; containerized deployments where the URL env/config was dropped.","solutions":["Set the site URL in the program settings (the value common.GetApiUrl reads) and retry.","Prefer absolute URLs (scheme + host + path) inside .strm files so resolution never depends on server config.","If generating .strm files programmatically, always write the fully qualified URL at generation time."],"exampleFix":"# before (strm content)\n/d/local/video.mp4\n\n# after (strm content)\nhttps://media.example.com/d/local/video.mp4","handlingStrategy":"validation","validationCode":"if !strings.HasPrefix(link.URL, \"http://\") && !strings.HasPrefix(link.URL, \"https://\") {\n\tif common.GetApiUrl(nil) == \"\" {\n\t\treturn nil, fmt.Errorf(\"strm file uses relative URL but site URL is not configured\")\n\t}\n}","typeGuard":"func isAbsoluteHTTPURL(u string) bool {\n\treturn strings.HasPrefix(u, \"http://\") || strings.HasPrefix(u, \"https://\")\n}","tryCatchPattern":"if _, err := readStrmLink(ctx, link); err != nil && strings.Contains(err.Error(), \"relative url without site url\") {\n\t// set site URL config, then retry\n}","preventionTips":["Configure the site URL setting at deployment time.","Write absolute URLs into generated .strm files.","Validate strm contents during import/sync jobs."],"tags":["strm","relative-url","configuration","content"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}