alibaba/nacos · error · JoranException

Could not close input stream

Error message

Could not close input stream

What it means

Error "Could not close input stream" thrown in alibaba/nacos.

Source

Thrown at logger-adapter-impl/logback-adapter-12/src/main/java/com/alibaba/nacos/logger/adapter/logback12/NacosLogbackConfiguratorAdapterV1.java:91

            in = urlConnection.getInputStream();
            if (hasNewDoConfigureApi()) {
                doConfigure(in, url.toExternalForm());
            } else {
                // adapter old version of logback below 1.1.10
                doConfigure(in);
            }
        } catch (IOException ioe) {
            String errMsg = "Could not open URL [" + url + "].";
            addError(errMsg, ioe);
            throw new JoranException(errMsg, ioe);
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ioe) {
                    String errMsg = "Could not close input stream";
                    addError(errMsg, ioe);
                    throw new JoranException(errMsg, ioe);
                }
            }
        }
    }
    
    /**
     * Since logback 1.1.10, Add new doConfigure API with sax systemId and use this API to do configure.
     *
     * @return {@code true} when logback is upper 1.1.10, otherwise {@code false}
     */
    private boolean hasNewDoConfigureApi() {
        try {
            this.getClass().getMethod("doConfigure", InputStream.class, String.class);
            return true;
        } catch (NoSuchMethodException e) {
            return false;
        }
    }

View on GitHub (pinned to 9b989acdf1)

Solutions

  1. Review the input and runtime state for logback stream close failed, correct the reported problem, and retry.

When it happens

Trigger: Thrown at logger-adapter-impl/logback-adapter-12/src/main/java/com/alibaba/nacos/logger/adapter/logback12/NacosLogbackConfiguratorAdapterV1.java:91 when the library encounters an invalid state.

Common situations: Closing the logging configuration input stream failed.


AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14). Data as JSON: /api/errors/430877178f27f2b7. Report an issue: GitHub.