{"record":{"id":"23bed4d5143157a3","repo":"cayleygraph/cayley","slug":"could-not-get-resource-s-v","errorCode":null,"errorMessage":"could not get resource <%s>: %v","messagePattern":"could not get resource <(.+?)>: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/load.go","lineNumber":66,"sourceCode":"\tif path == \"-\" {\n\t\tr = os.Stdin\n\t} else if u, err := url.Parse(path); err != nil || u.Scheme == \"file\" || u.Scheme == \"\" {\n\t\t// Don't alter relative URL path or non-URL path parameter.\n\t\tif u.Scheme != \"\" && err == nil {\n\t\t\t// Recovery heuristic for mistyping \"file://path/to/file\".\n\t\t\tpath = filepath.Join(u.Host, u.Path)\n\t\t}\n\t\tf, err := os.Open(path)\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, err\n\t\t} else if err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not open file %q: %v\", path, err)\n\t\t}\n\t\tr, c = f, f\n\t} else {\n\t\tres, err := http.Get(path)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not get resource <%s>: %v\", u, err)\n\t\t}\n\t\t// TODO(dennwc): save content type for format auto-detection\n\t\tr, c = res.Body, res.Body\n\t}\n\n\tr, err := decompressor.New(r)\n\tif err != nil {\n\t\tif c != nil {\n\t\t\tc.Close()\n\t\t}\n\t\tif err == io.EOF {\n\t\t\treturn nopCloser{quad.NewReader(nil)}, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tvar qr quad.ReadCloser\n\tswitch typ {","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/cayleygraph/cayley/blob/81dcd7d73e45136bc0d01802a8ba4685d8a533eb/internal/load.go#L48-L84","documentation":"QuadReaderFor treats a path with a URL scheme as a remote resource and fetches it with http.Get. If the HTTP request itself fails at the transport level (DNS failure, connection refused, TLS error, timeouts), the error is wrapped as this message with the URL and cause.","triggerScenarios":"Loading data from http:// or https:// URLs when the server is unreachable, the hostname doesn't resolve, or the TLS handshake fails.","commonSituations":"Behind a firewall/proxy without proxy env vars set; typo in hostname; remote server down; self-signed certificates rejected by the Go HTTP client.","solutions":["Check the wrapped cause for DNS/connection/TLS specifics","Verify the URL is reachable (curl the same URL from the host)","Configure HTTP(S)_PROXY env vars if a proxy is required","If you only intended a local file, remove the URL scheme so it is treated as a path"],"exampleFix":"// before\n./cayley load --data http://exmaple.com/data.nq # DNS typo\n// after\n./cayley load --data http://example.com/data.nq","handlingStrategy":"retry","validationCode":"u, err := url.Parse(path)\nif err == nil && u.Scheme != \"\" {\n    resp, err := http.Head(path)\n    if err != nil || resp.StatusCode >= 400 {\n        return fmt.Errorf(\"data URL unreachable: %v\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":"r, err := internal.QuadReaderFor(ctx, path)\nif err != nil && strings.Contains(err.Error(), \"could not get resource\") {\n    // back off and retry; or fall back to a local copy\n}","preventionTips":["Pre-download remote datasets to local files before loading","Set HTTP(S)_PROXY when behind a proxy","Use curl/HEAD checks in deployment scripts before starting loads"],"tags":["http","network","url"],"backgroundTag":"http-request-failed","analyzedSha":"81dcd7d73e45136bc0d01802a8ba4685d8a533eb","analyzedAt":"2026-09-06T06:14:12.358Z","contentChangedAt":"2026-09-06T06:14:12.358Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}