{"record":{"id":"d141bd58ab5f10f8","repo":"pinpoint-apm/pinpoint","slug":"error-opening-stream","errorCode":null,"errorMessage":"Error opening stream : ","messagePattern":"Error opening stream : ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"agent-module/plugins-loader/src/main/java/com/navercorp/pinpoint/loader/plugins/trace/yaml/TraceMetadataProviderYamlParser.java","lineNumber":75,"sourceCode":"            } catch (Exception e) {\n                throw new IllegalStateException(\"Invalid type provider definition : \" + url.toString(), e);\n            }\n        } catch (IOException e) {\n            throw new IllegalStateException(\"IOException parsing \" + url.toExternalForm(), e);\n        }\n    }\n\n    private ParsedTraceMetadata parse0(URL metaUrl) throws IOException {\n        try (InputStream inputStream = metaUrl.openStream()) {\n            ParsedTraceMetadata parsedTraceMetadata = mapper.readValue(inputStream, ParsedTraceMetadata.class);\n            if (parsedTraceMetadata == null) {\n                logger.warn(\"Empty type provider definition. Skipping : {}\", metaUrl.toExternalForm());\n            }\n            return parsedTraceMetadata;\n        } catch (JsonParseException | JsonMappingException e) {\n            throw new IllegalStateException(\"Error parsing yml : \" + metaUrl, e);\n        } catch (IOException e) {\n            throw new IllegalStateException(\"Error opening stream : \" + metaUrl, e);\n        }\n    }\n\n    private String getTypeProviderId(URL metaUrl) {\n        try {\n            URLConnection urlConnection = metaUrl.openConnection();\n            if (urlConnection instanceof JarURLConnection) {\n                JarURLConnection jarUrlConnection = (JarURLConnection) urlConnection;\n                String jarFileName = new File(jarUrlConnection.getJarFile().getName()).getName();\n                String entryFileName = new File(jarUrlConnection.getEntryName()).getName();\n                return jarFileName + \":\" + entryFileName;\n            }\n        } catch (IOException e) {\n            logger.warn(\"Error opening : \" + metaUrl, e);\n            return metaUrl.toExternalForm();\n        }\n        return metaUrl.toExternalForm();\n    }","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/plugins-loader/src/main/java/com/navercorp/pinpoint/loader/plugins/trace/yaml/TraceMetadataProviderYamlParser.java#L57-L93","documentation":"parse0(URL) opens an InputStream from the provider URL; if opening the stream throws a plain IOException (anything that is not a Jackson parse/mapping error), it is wrapped in IllegalStateException('Error opening stream : ' + metaUrl).","triggerScenarios":"metaUrl.openStream() fails: the resource does not exist at that URL, the jar/file is unreadable, or a network-based URL is unreachable.","commonSituations":"Typo in the packaged resource path; META-INF resource not copied into the jar; file: URL pointing to a deleted file; connection issues for http: URLs.","solutions":["Verify the URL exists (Files.exists for file: URLs; curl for remote URLs)","Check the resource is included in the built plugin jar","Fix the resource path/package declaration","Check filesystem permissions or network reachability"],"exampleFix":"// before: file never packaged\ngetResource(\"/provider.yml\")\n// after: correct resource path\ngetResource(\"/pinpoint/metadata/type-provider.yml\")","handlingStrategy":"try-catch","validationCode":"URL url = getClass().getResource(path);\nif (url == null) {\n    throw new FileNotFoundException(\"type provider not found: \" + path);\n}\ntry (InputStream in = url.openStream()) { /* probes availability */ }","typeGuard":null,"tryCatchPattern":"try {\n    parser.parse(url);\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Error opening stream\")) {\n        // check URL existence/permissions/reachability before retrying\n    }\n}","preventionTips":["Null-check getResource() results","Confirm resource inclusion in the artifact","Check file permissions for file: URLs"],"tags":["io","url","resource-not-found","plugin"],"backgroundTag":"file-open-failed","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}