You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kushagra Bindal <bi...@gmail.com> on 2019/12/04 05:19:13 UTC

host [:] is not valid error in catalina.out

Hi,

I tried to upgrade my tomcat on OpenAM from 8.5.24 to 9.0.29 version and I
got below error in catalina.out during startup itself.

[http-nio-8080-exec-7] org.apache.coyote.AbstractProcessor.parseHost The
host [:] is not valid
 Note: further occurrences of request parsing errors will be logged at
DEBUG level.
        java.lang.IllegalArgumentException
                at
org.apache.tomcat.util.http.parser.Host.parse(Host.java:78)
                at
org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)
                at
org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:294)
                at
org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:759)
                at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:343)
                at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
                at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)
                at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591)
                at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.lang.Thread.run(Thread.java:745)

Can someone please help in identifying the actual root cause of the failure.
-- 
Regards,
Kushagra Bindal

Re: host [:] is not valid error in catalina.out

Posted by Kushagra Bindal <bi...@gmail.com>.
Thanks Chris for your quick response. Please accept my apology for delayed
response as I was out of town.

As per my design we are already using nginx in front of tomcat. So a
request from browser will land on nginx & then it will redirect it to
tomcat.

We are having a location in nginx where we are appending $host &
$sever_port in host separated by :. What we have observed that, when a
request will come from browser then we are properly getting hostname and
server port. And hence we are getting proper url.

We do have a healthcheck call internally originated from nginx to tomcat to
check the health of the system, in this case we are not having any valid
$host & $server_port and hence only static : is passing to tomcat. In our
earlier version i.e. 8.5.24 it was supporting :, but now in 9.0.29 it is
not allowing and hence throwing 404.

So my ask is that if there is any flag or way by which we can handle this
specific scenario then it will be a great help.

Your thoughts and inputs are highly welcome.

On Fri, Dec 6, 2019, 3:41 AM Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Mark and Kushagra,
>
> On 12/5/19 13:11, Mark Thomas wrote:
> > On 05/12/2019 17:10, Kushagra Bindal wrote:
> >> Thanks Mark for your response.
> >>
> >> In which version tomcat has introduced these restrictions
> >
> > Check the changelog. Look for "validation".
> >
> >> and is there any available documentation around such cases which
> >> could help me in understanding the nature of restrictions.
> >
> > RFC 3986, section 3.2.2 and references.
>
> You may be able to work-around these issues with a reverse-proxy such
> as Apache httpd, nginx, etc.
>
> Using tools such as mod_rewrite (or simple tools, depending upon your
> needs), you should be able to "fix" broken clients' requests before
> they get to Tomcat.
>
> The real solution is to fix your apparently very broken clients.
>
> - -chris
>
> >> On Thu, Dec 5, 2019, 10:31 PM Mark Thomas <ma...@apache.org>
> >> wrote:
> >>
> >>> On 05/12/2019 16:58, Kushagra Bindal wrote:
> >>>> Hi Mark
> >>>>
> >>>> Yes that's correct that we are getting this error after
> >>>> startup. Actually in one of my url I am having extra : and
> >>>> thus resulting in failure. Same url was working properly in
> >>>> 8.5.24 version. Actually I can understand
> >>> that
> >>>> this is not a good practice to have extra : but making such
> >>>> changes could result into regression in application.
> >>>>
> >>>> So is there a way by which I can apply some setting like
> >>>> escape character or something which could help me in
> >>>> resolving this issue?
> >>>
> >>> Sorry, no. Requests with invalid host names are always
> >>> rejected.
> >>>
> >>> Mark
> >>>
> >>>
> >>>>
> >>>> On Wed, Dec 4, 2019, 4:23 PM Mark Thomas <ma...@apache.org>
> >>>> wrote:
> >>>>
> >>>>> On 04/12/2019 05:19, Kushagra Bindal wrote:
> >>>>>> Hi,
> >>>>>>
> >>>>>> I tried to upgrade my tomcat on OpenAM from 8.5.24 to
> >>>>>> 9.0.29 version
> >>> and
> >>>>> I
> >>>>>> got below error in catalina.out during startup itself.
> >>>>>
> >>>>> That stack trace shows that this error is in response to an
> >>>>> incoming request, not part of the start-up sequence.
> >>>>>
> >>>>>> [http-nio-8080-exec-7]
> >>>>>> org.apache.coyote.AbstractProcessor.parseHost
> >>> The
> >>>>>> host [:] is not valid
> >>>>>
> >>>>> You have a broken client that is presenting an invalid Host
> >>>>> header. If you want the error to go away, fix the broken
> >>>>> client.
> >>>>>
> >>>>> Mark
> >>>>>
> >>>>> ------------------------------------------------------------------
> - ---
> >>>>>
> >>>>>
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>>>> For additional commands, e-mail:
> >>>>> users-help@tomcat.apache.org
> >>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >>> --------------------------------------------------------------------
> - -
> >>>
> >>>
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>> For additional commands, e-mail: users-help@tomcat.apache.org
> >>>
> >>>
> >>
> >
> >
> > ---------------------------------------------------------------------
> >
> >
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3pgIwACgkQHPApP6U8
> pFjrrw/7BM39u/Z8BhWNOUKrKubmO9ENKV0ldCdSa/qoxTwPKXmDMa05Iiy1iQne
> OAp8SA3AfZMpAoTvfCEOy7ncB4rOdJTo+bSgOfErVdiBdYokkUehEFkYzaiaUpEA
> CknCzfcyWPM8rDZG1mCYm76kOe017sDCrcnV/nUcsdVqQ7fMY28k2PYBSrAziOfG
> rDSALl3DFObYDoznvV/qwfNP2Ns6Utd9+2qXctMFtjDrQDOY5j9Rn2BPJaCeqgOo
> HbjJYecC+dx9fV+v4Dc4CoC64u1LQzunBy7KIE/f9tuYoWtBur0xMoMc1+CqzSAQ
> fhWQtfcSUsvqVNh4OFvxJc0kvPZSkB6QDVpOAo74nKhe4PcnWfoMg0Lx6EtCjaUO
> 5JoLew404q+pKyhb/0txmrMsrAF+GCPXs4q6ft4bi7HjIirQUAgYc8Mk1WMI9cDx
> APN7G6FrU8Mcfg5qEaTywl0X5su5i+2XxXvOz6py5si2RZe0l7Gc4iLbml10SG+X
> cAIAh+QSCCZfCd7DNCPNrsrzFI0h2xgst8NKdL1pOjkK/40GMEi0voDktzjDhw+6
> S9GdGE9DTl/z3Mxtd52tlyqvFRenS7VYv6ftHyhx0doAxC+4ozBEDh/qInmmeMhH
> 2/IKZ3CqDfnfasUjNxsuqg/DXjWekzwkDrHkSYMif0SJZAg8zQA=
> =QpXg
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: host [:] is not valid error in catalina.out

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Mark and Kushagra,

On 12/5/19 13:11, Mark Thomas wrote:
> On 05/12/2019 17:10, Kushagra Bindal wrote:
>> Thanks Mark for your response.
>> 
>> In which version tomcat has introduced these restrictions
> 
> Check the changelog. Look for "validation".
> 
>> and is there any available documentation around such cases which 
>> could help me in understanding the nature of restrictions.
> 
> RFC 3986, section 3.2.2 and references.

You may be able to work-around these issues with a reverse-proxy such
as Apache httpd, nginx, etc.

Using tools such as mod_rewrite (or simple tools, depending upon your
needs), you should be able to "fix" broken clients' requests before
they get to Tomcat.

The real solution is to fix your apparently very broken clients.

- -chris

>> On Thu, Dec 5, 2019, 10:31 PM Mark Thomas <ma...@apache.org>
>> wrote:
>> 
>>> On 05/12/2019 16:58, Kushagra Bindal wrote:
>>>> Hi Mark
>>>> 
>>>> Yes that's correct that we are getting this error after
>>>> startup. Actually in one of my url I am having extra : and
>>>> thus resulting in failure. Same url was working properly in
>>>> 8.5.24 version. Actually I can understand
>>> that
>>>> this is not a good practice to have extra : but making such
>>>> changes could result into regression in application.
>>>> 
>>>> So is there a way by which I can apply some setting like
>>>> escape character or something which could help me in
>>>> resolving this issue?
>>> 
>>> Sorry, no. Requests with invalid host names are always
>>> rejected.
>>> 
>>> Mark
>>> 
>>> 
>>>> 
>>>> On Wed, Dec 4, 2019, 4:23 PM Mark Thomas <ma...@apache.org>
>>>> wrote:
>>>> 
>>>>> On 04/12/2019 05:19, Kushagra Bindal wrote:
>>>>>> Hi,
>>>>>> 
>>>>>> I tried to upgrade my tomcat on OpenAM from 8.5.24 to
>>>>>> 9.0.29 version
>>> and
>>>>> I
>>>>>> got below error in catalina.out during startup itself.
>>>>> 
>>>>> That stack trace shows that this error is in response to an
>>>>> incoming request, not part of the start-up sequence.
>>>>> 
>>>>>> [http-nio-8080-exec-7]
>>>>>> org.apache.coyote.AbstractProcessor.parseHost
>>> The
>>>>>> host [:] is not valid
>>>>> 
>>>>> You have a broken client that is presenting an invalid Host
>>>>> header. If you want the error to go away, fix the broken
>>>>> client.
>>>>> 
>>>>> Mark
>>>>> 
>>>>> ------------------------------------------------------------------
- ---
>>>>>
>>>>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail:
>>>>> users-help@tomcat.apache.org
>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>>> --------------------------------------------------------------------
- -
>>>
>>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>> 
>>> 
>> 
> 
> 
> ---------------------------------------------------------------------
>
> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3pgIwACgkQHPApP6U8
pFjrrw/7BM39u/Z8BhWNOUKrKubmO9ENKV0ldCdSa/qoxTwPKXmDMa05Iiy1iQne
OAp8SA3AfZMpAoTvfCEOy7ncB4rOdJTo+bSgOfErVdiBdYokkUehEFkYzaiaUpEA
CknCzfcyWPM8rDZG1mCYm76kOe017sDCrcnV/nUcsdVqQ7fMY28k2PYBSrAziOfG
rDSALl3DFObYDoznvV/qwfNP2Ns6Utd9+2qXctMFtjDrQDOY5j9Rn2BPJaCeqgOo
HbjJYecC+dx9fV+v4Dc4CoC64u1LQzunBy7KIE/f9tuYoWtBur0xMoMc1+CqzSAQ
fhWQtfcSUsvqVNh4OFvxJc0kvPZSkB6QDVpOAo74nKhe4PcnWfoMg0Lx6EtCjaUO
5JoLew404q+pKyhb/0txmrMsrAF+GCPXs4q6ft4bi7HjIirQUAgYc8Mk1WMI9cDx
APN7G6FrU8Mcfg5qEaTywl0X5su5i+2XxXvOz6py5si2RZe0l7Gc4iLbml10SG+X
cAIAh+QSCCZfCd7DNCPNrsrzFI0h2xgst8NKdL1pOjkK/40GMEi0voDktzjDhw+6
S9GdGE9DTl/z3Mxtd52tlyqvFRenS7VYv6ftHyhx0doAxC+4ozBEDh/qInmmeMhH
2/IKZ3CqDfnfasUjNxsuqg/DXjWekzwkDrHkSYMif0SJZAg8zQA=
=QpXg
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: host [:] is not valid error in catalina.out

Posted by Mark Thomas <ma...@apache.org>.
On 05/12/2019 17:10, Kushagra Bindal wrote:
> Thanks Mark for your response.
> 
> In which version tomcat has introduced these restrictions

Check the changelog. Look for "validation".

> and is there any
> available documentation around such cases which could help me in
> understanding the nature of restrictions.

RFC 3986, section 3.2.2 and references.

Mark


> 
> On Thu, Dec 5, 2019, 10:31 PM Mark Thomas <ma...@apache.org> wrote:
> 
>> On 05/12/2019 16:58, Kushagra Bindal wrote:
>>> Hi Mark
>>>
>>> Yes that's correct that we are getting this error after startup. Actually
>>> in one of my url I am having extra : and thus resulting in failure. Same
>>> url was working properly in 8.5.24 version. Actually I can understand
>> that
>>> this is not a good practice to have extra : but making such changes could
>>> result into regression in application.
>>>
>>> So is there a way by which I can apply some setting like escape character
>>> or something which could help me in resolving this issue?
>>
>> Sorry, no. Requests with invalid host names are always rejected.
>>
>> Mark
>>
>>
>>>
>>> On Wed, Dec 4, 2019, 4:23 PM Mark Thomas <ma...@apache.org> wrote:
>>>
>>>> On 04/12/2019 05:19, Kushagra Bindal wrote:
>>>>> Hi,
>>>>>
>>>>> I tried to upgrade my tomcat on OpenAM from 8.5.24 to 9.0.29 version
>> and
>>>> I
>>>>> got below error in catalina.out during startup itself.
>>>>
>>>> That stack trace shows that this error is in response to an incoming
>>>> request, not part of the start-up sequence.
>>>>
>>>>> [http-nio-8080-exec-7] org.apache.coyote.AbstractProcessor.parseHost
>> The
>>>>> host [:] is not valid
>>>>
>>>> You have a broken client that is presenting an invalid Host header. If
>>>> you want the error to go away, fix the broken client.
>>>>
>>>> Mark
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: host [:] is not valid error in catalina.out

Posted by Kushagra Bindal <bi...@gmail.com>.
Thanks Mark for your response.

In which version tomcat has introduced these restrictions and is there any
available documentation around such cases which could help me in
understanding the nature of restrictions.

On Thu, Dec 5, 2019, 10:31 PM Mark Thomas <ma...@apache.org> wrote:

> On 05/12/2019 16:58, Kushagra Bindal wrote:
> > Hi Mark
> >
> > Yes that's correct that we are getting this error after startup. Actually
> > in one of my url I am having extra : and thus resulting in failure. Same
> > url was working properly in 8.5.24 version. Actually I can understand
> that
> > this is not a good practice to have extra : but making such changes could
> > result into regression in application.
> >
> > So is there a way by which I can apply some setting like escape character
> > or something which could help me in resolving this issue?
>
> Sorry, no. Requests with invalid host names are always rejected.
>
> Mark
>
>
> >
> > On Wed, Dec 4, 2019, 4:23 PM Mark Thomas <ma...@apache.org> wrote:
> >
> >> On 04/12/2019 05:19, Kushagra Bindal wrote:
> >>> Hi,
> >>>
> >>> I tried to upgrade my tomcat on OpenAM from 8.5.24 to 9.0.29 version
> and
> >> I
> >>> got below error in catalina.out during startup itself.
> >>
> >> That stack trace shows that this error is in response to an incoming
> >> request, not part of the start-up sequence.
> >>
> >>> [http-nio-8080-exec-7] org.apache.coyote.AbstractProcessor.parseHost
> The
> >>> host [:] is not valid
> >>
> >> You have a broken client that is presenting an invalid Host header. If
> >> you want the error to go away, fix the broken client.
> >>
> >> Mark
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: host [:] is not valid error in catalina.out

Posted by Mark Thomas <ma...@apache.org>.
On 05/12/2019 16:58, Kushagra Bindal wrote:
> Hi Mark
> 
> Yes that's correct that we are getting this error after startup. Actually
> in one of my url I am having extra : and thus resulting in failure. Same
> url was working properly in 8.5.24 version. Actually I can understand that
> this is not a good practice to have extra : but making such changes could
> result into regression in application.
> 
> So is there a way by which I can apply some setting like escape character
> or something which could help me in resolving this issue?

Sorry, no. Requests with invalid host names are always rejected.

Mark


> 
> On Wed, Dec 4, 2019, 4:23 PM Mark Thomas <ma...@apache.org> wrote:
> 
>> On 04/12/2019 05:19, Kushagra Bindal wrote:
>>> Hi,
>>>
>>> I tried to upgrade my tomcat on OpenAM from 8.5.24 to 9.0.29 version and
>> I
>>> got below error in catalina.out during startup itself.
>>
>> That stack trace shows that this error is in response to an incoming
>> request, not part of the start-up sequence.
>>
>>> [http-nio-8080-exec-7] org.apache.coyote.AbstractProcessor.parseHost The
>>> host [:] is not valid
>>
>> You have a broken client that is presenting an invalid Host header. If
>> you want the error to go away, fix the broken client.
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: host [:] is not valid error in catalina.out

Posted by Kushagra Bindal <bi...@gmail.com>.
Hi Mark

Yes that's correct that we are getting this error after startup. Actually
in one of my url I am having extra : and thus resulting in failure. Same
url was working properly in 8.5.24 version. Actually I can understand that
this is not a good practice to have extra : but making such changes could
result into regression in application.

So is there a way by which I can apply some setting like escape character
or something which could help me in resolving this issue?

On Wed, Dec 4, 2019, 4:23 PM Mark Thomas <ma...@apache.org> wrote:

> On 04/12/2019 05:19, Kushagra Bindal wrote:
> > Hi,
> >
> > I tried to upgrade my tomcat on OpenAM from 8.5.24 to 9.0.29 version and
> I
> > got below error in catalina.out during startup itself.
>
> That stack trace shows that this error is in response to an incoming
> request, not part of the start-up sequence.
>
> > [http-nio-8080-exec-7] org.apache.coyote.AbstractProcessor.parseHost The
> > host [:] is not valid
>
> You have a broken client that is presenting an invalid Host header. If
> you want the error to go away, fix the broken client.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: host [:] is not valid error in catalina.out

Posted by Mark Thomas <ma...@apache.org>.
On 04/12/2019 05:19, Kushagra Bindal wrote:
> Hi,
> 
> I tried to upgrade my tomcat on OpenAM from 8.5.24 to 9.0.29 version and I
> got below error in catalina.out during startup itself.

That stack trace shows that this error is in response to an incoming
request, not part of the start-up sequence.

> [http-nio-8080-exec-7] org.apache.coyote.AbstractProcessor.parseHost The
> host [:] is not valid

You have a broken client that is presenting an invalid Host header. If
you want the error to go away, fix the broken client.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org