question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.23] Error parsing address from Jetty with ipv6

See original GitHub issue

Running http4s 0.23.0-RC1 with Jetty and IPv6 crashes with the following:

ERROR org.http4s.servlet.Http4sServlet - Error processing request
java.util.NoSuchElementException: None.get

The issue is that Jetty returns the following addresses:

req.getLocalAddr -> "[0:0:0:0:0:0:0:1]"
req.getRemoteAddr -> "[0:0:0:0:0:0:0:1]"

This crashes the following parsing IpAddress.fromString(req.getRemoteAddr).getin Http4sServlet. Is brackets on the address considered an error on the parsing side or on Jetty’s side?

A temporary workaround for us is to force ipv4 with -Djava.net.preferIPv4Stack=true.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
rossabakercommented, Sep 4, 2021

I’m sorry. That stripBracketsFromAddr already fixes this, and it wasn’t linked, so I neglected to close it. I’ll look for another one.

0reactions
san-codingcommented, Sep 5, 2021

I’m sorry. That stripBracketsFromAddr already fixes this, and it wasn’t linked, so I neglected to close it. I’ll look for another one.

Ohh okay , thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bind Jetty to IPv6 address - Stack Overflow
If you haven't found a solution, here it is. Change the NIO connector with the IO one. Instead of using "org.mortbay.jetty.nio.
Read more >
error parsing IPv6 address in InternalHosts - Launchpad Bugs
I noticed several bugs with how parsing of the InternalHosts file is done. First of all exceptions are silently ignored, ...
Read more >
Changelog - http4s
This release is binary compatible with the 0.23.x series. What's Changed . http4s-core . Prettify error messages when parsing by @danicheg...
Read more >
[JSPT-106] IPv6 support with or without brackets around address
It was IDP-1694, it's been addressed. I strongly disagree with Jetty on this and they are misunderstanding what the brackets mean. Brackets ...
Read more >
1484034 – glibc: Stricter IPv6 address parser - Red Hat Bugzilla
4 (so it has the same bug). ip6tables uses the glibc parser as well, so the change could cause ip6tables to reject invalid...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found