java.net.UnknownHostException: MacBook Pro: MacBook Pro: nodename nor servname provided, or not known

QOS.ch JIRA | Oliver Schrenk | 4 years ago
  1. 0

    This might be a won't-fix. If the HostName (`scutil --get HostName`) contains a whitespace the, logback will throw an error ``` 20:04:52,128 |-ERROR in ch.qos.logback.core.util.ContextUtil@36b37b66 - Failed to get local hostname java.net.UnknownHostException: MacBook Pro: MacBook Pro: nodename nor servname provided, or not known at java.net.UnknownHostException: MacBook Pro: MacBook Pro: nodename nor servname provided, or not known at at java.net.InetAddress.getLocalHost(InetAddress.java:1438) at at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32) at at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41) at at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:56) at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276) at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148) at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130) at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:157) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:143) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:106) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:56) at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148) at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84) at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54) at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128) at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107) at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281) at at com.srhub.nscrg.core.SpellsParserTest.<init>(SpellsParserTest.java:46) at at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:187) at at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236) at at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233) at at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.net.UnknownHostException: MacBook Pro: nodename nor servname provided, or not known at at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866) at at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258) at at java.net.InetAddress.getLocalHost(InetAddress.java:1434) at ... 43 common frames omitted ``` I don't even know if this is allowed [1] but OSX allows setting the HostName it directly via `scutil --set HostName "MacBook Pro"` [1] http://tools.ietf.org/html/rfc952

    QOS.ch JIRA | 4 years ago | Oliver Schrenk
    java.net.UnknownHostException: MacBook Pro: MacBook Pro: nodename nor servname provided, or not known
  2. 0

    This might be a won't-fix. If the HostName (`scutil --get HostName`) contains a whitespace the, logback will throw an error ``` 20:04:52,128 |-ERROR in ch.qos.logback.core.util.ContextUtil@36b37b66 - Failed to get local hostname java.net.UnknownHostException: MacBook Pro: MacBook Pro: nodename nor servname provided, or not known at java.net.UnknownHostException: MacBook Pro: MacBook Pro: nodename nor servname provided, or not known at at java.net.InetAddress.getLocalHost(InetAddress.java:1438) at at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32) at at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41) at at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:56) at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276) at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148) at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130) at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:157) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:143) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:106) at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:56) at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148) at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84) at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54) at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128) at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107) at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269) at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281) at at com.srhub.nscrg.core.SpellsParserTest.<init>(SpellsParserTest.java:46) at at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:187) at at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236) at at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233) at at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.net.UnknownHostException: MacBook Pro: nodename nor servname provided, or not known at at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866) at at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258) at at java.net.InetAddress.getLocalHost(InetAddress.java:1434) at ... 43 common frames omitted ``` I don't even know if this is allowed [1] but OSX allows setting the HostName it directly via `scutil --set HostName "MacBook Pro"` [1] http://tools.ietf.org/html/rfc952

    QOS.ch JIRA | 4 years ago | Oliver Schrenk
    java.net.UnknownHostException: MacBook Pro: MacBook Pro: nodename nor servname provided, or not known
  3. 0

    Mac OS X 10.9 Mavericks support?

    GitHub | 3 years ago | jonathancross
    java.net.UnknownHostException: $HOSTNAME: $HOSTNAME: nodename nor servname provided, or not known
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Logback throws exception with Java 7 on OSX 10.9 (dependency needs version bump)

    GitHub | 3 years ago | solussd
    java.net.UnknownHostException: sdpro: sdpro: nodename nor servname provided, or not known
  6. 0

    Failed to get local hostname on ubilinux

    GitHub | 2 years ago | shb256
    java.net.UnknownHostException: ubilinux: ubilinux: unknown error
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.UnknownHostException

    MacBook Pro: nodename nor servname provided, or not known

    at java.net.Inet6AddressImpl.lookupAllHostAddr()
  2. Java RT
    InetAddress.getLocalHost
    1. java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    2. java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866)
    3. java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258)
    4. java.net.InetAddress.getLocalHost(InetAddress.java:1434)
    4 frames
  3. Logback Core Module
    ContextUtil.addHostNameAsProperty
    1. ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32)
    2. ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41)
    2 frames
  4. Logback Classic Module
    ConfigurationAction.begin
    1. ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:56)
    1 frame
  5. Logback Core Module
    GenericConfigurator.doConfigure
    1. ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276)
    2. ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148)
    3. ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130)
    4. ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
    5. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:157)
    6. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:143)
    7. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:106)
    8. ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:56)
    8 frames
  6. Logback Classic Module
    ContextInitializer.autoConfig
    1. ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
    2. ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
    2 frames
  7. SLF4J LOG4J-12 Binding
    StaticLoggerBinder.<clinit>
    1. org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
    2. org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54)
    2 frames
  8. SLF4J API Module
    LoggerFactory.getLogger
    1. org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
    2. org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
    3. org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
    4. org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
    5. org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
    5 frames
  9. com.srhub.nscrg
    SpellsParserTest.<init>
    1. com.srhub.nscrg.core.SpellsParserTest.<init>(SpellsParserTest.java:46)
    1 frame
  10. Java RT
    Constructor.newInstance
    1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    4. java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    4 frames
  11. JUnit
    ParentRunner.run
    1. org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:187)
    2. org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
    3. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    4. org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
    5. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    7. org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    8. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    9. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    10. org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    11. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    12. org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    12 frames
  12. JUnit4 Runner
    JUnit4TestReference.run
    1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    1 frame
  13. JUnit3 Runner
    RemoteTestRunner.main
    1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    5 frames