Uploaded image for project: 'WildFly WIP'
  1. WildFly WIP
  2. WFWIP-57

MalformedInputException is thrown in case config-source dir contains binaries

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • MP Config
    • None

      Management operation for adding a config-source dir fails with MalformedInputException in case that the dir contains some binaries.
      reproduce

      TEST_DIR=/tmp/test_dir
      mkdir -p $TEST_DIR
      head -c 1K </dev/urandom > ${TEST_DIR}/random.data
      echo 'value' > ${TEST_DIR}/my.property
      
      sh wildfly-14.0.0.Beta1-SNAPSHOT/bin/standalone.sh &
      sh wildfly-14.0.0.Beta1-SNAPSHOT/bin/jboss-cli.sh -c "/subsystem=microprofile-config-smallrye/config-source=config:add(dir=${TEST_DIR})"
      

      expected
      Binaries and e.g. corrupted files (log?) are ignored.

      actual

      12:53:59,083 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("add") failed - address: ([
          ("subsystem" => "microprofile-config-smallrye"),
          ("config-source" => "asd")
      ]): java.io.UncheckedIOException: java.nio.charset.MalformedInputException: Input length = 1
      	at java.io.BufferedReader$1.hasNext(BufferedReader.java:574)
      	at java.util.Iterator.forEachRemaining(Iterator.java:115)
      	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      	at io.smallrye.config.DirConfigSource.readContent(DirConfigSource.java:72)
      	at io.smallrye.config.DirConfigSource.scan(DirConfigSource.java:60)
      	at io.smallrye.config.DirConfigSource.<init>(DirConfigSource.java:46)
      	at org.wildfly.extension.microprofile.config.smallrye.ConfigSourceDefinition$1.performRuntime(ConfigSourceDefinition.java:120)
      ...
      

              jmesnil1@redhat.com Jeff Mesnil
              pkremens@redhat.com Petr Kremensky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: