java.lang.IllegalArgumentException: The character [_] is never valid in a domain name.
Asked by danielnascimento:

After installing a confluence in a new Ubuntu server using a binary option I start to receive the following error

What should be done, once I followed all tutorial's steps.

**Type** Exception Report

**Message** The character \[_\] is never valid in a domain name.

**Description** The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

**Exception**

```
java.lang.IllegalArgumentException: The character [_] is never valid in a domain name.	org.apache.tomcat.util.http.parser.HttpParser$DomainParseState.next(HttpParser.java:926)	org.apache.tomcat.util.http.parser.HttpParser.readHostDomainName(HttpParser.java:822)	org.apache.tomcat.util.http.parser.Host.parse(Host.java:71)	org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)	org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:273)	org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:809)	org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384)	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)	java.lang.Thread.run(Thread.java:748)
```

**Note** The full stack trace of the root cause is available in the server logs.

06-Sep-2018 04:52:34.313 INFO \[localhost-startStop-2\] org.springframework.context.support.DefaultLifecycleProcessor.start Starting beans in phase 2147483647  
06-Sep-2018 04:52:34.395 INFO \[localhost-startStop-2\] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization completed in 3395 ms  
06-Sep-2018 04:52:48.468 INFO \[main\] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler \["http-nio-8090"\]  
06-Sep-2018 04:52:48.503 INFO \[main\] org.apache.catalina.startup.Catalina.start Server startup in 21870 ms  
06-Sep-2018 04:52:51.413 INFO \[http-nio-8090-exec-1\] org.apache.coyote.AbstractProcessor.parseHost The host \[confluence_server\] is not valid  
Note: further occurrences of request parsing errors will be logged at DEBUG level.  
java.lang.IllegalArgumentException: The character \[_\] is never valid in a domain name.  
at org.apache.tomcat.util.http.parser.HttpParser$DomainParseState.next(HttpParser.java:926)  
at org.apache.tomcat.util.http.parser.HttpParser.readHostDomainName(HttpParser.java:822)  
at org.apache.tomcat.util.http.parser.Host.parse(Host.java:71)  
at org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)  
at org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:273)  
at org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:809)  
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384)  
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)  
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)  
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)  
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)  
at java.lang.Thread.run(Thread.java:748)


Answers:
author: Igor M.
body: Check server.xml file on your Confluence installation and that you can correctly resolve localhost from etc/hosts file.

How are you starting Confluence, which script you are using?


Tags: confluence-server

server