Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upLots of IDN::Idna::IdnaError in puma log #4496
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheKinrar
Aug 2, 2017
Collaborator
I've made a temporary "fix" by rescuing IDN::Idna::IdnaError at https://github.com/tootsuite/mastodon/blob/v1.5.0/app/lib/formatter.rb#L107
def link_to_url(entity)
normalized_url = Addressable::URI.parse(entity[:url]).normalize
html_attrs = { target: '_blank', rel: 'nofollow noopener' }
Twitter::Autolink.send(:link_to_text, entity, link_html(entity[:url]), normalized_url, html_attrs)
rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError
encode(entity[:url])
endLocal timeline loads now but I have still no idea what's causing this error
|
I've made a temporary "fix" by rescuing def link_to_url(entity)
normalized_url = Addressable::URI.parse(entity[:url]).normalize
html_attrs = { target: '_blank', rel: 'nofollow noopener' }
Twitter::Autolink.send(:link_to_text, entity, link_html(entity[:url]), normalized_url, html_attrs)
rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError
encode(entity[:url])
endLocal timeline loads now but I have still no idea what's causing this error |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ykzts
Aug 2, 2017
Collaborator
Do you know what URL causes that problem?
Also, I think your solution is very good. Please send a pull request if you do not mind.
|
Do you know what URL causes that problem? Also, I think your solution is very good. Please send a pull request if you do not mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheKinrar
Aug 2, 2017
Collaborator
http://🌹🌹🌹.ws is one of the URL causing problem
So I suppose this is because of the characters inside?
I'm okay with sending a PR but I'm not sure this cannot be fixed by an other, better, way.
|
So I suppose this is because of the characters inside? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ykzts
Aug 2, 2017
Collaborator
I see. It seems that this is happening because libidn does not support Unicode containing emoji.
|
I see. It seems that this is happening because |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nullkal
Aug 2, 2017
Collaborator
I tried to encode 🌹🌹🌹.ws using idn command and it throws an error during string preparation, too. So, it's definitely libidn's problem.
$ idn
libidn 1.33
Copyright 2002-2015 Simon Josefsson.
GNU Libidn is free software with ABSOLUTELY NO WARRANTY. For more
information about these matters, see <http://www.gnu.org/licenses/>.
Type each input string on a line by itself, terminated by a newline character.
🌹🌹🌹.ws
idn: idna_to_ascii_4z: String preparation failed
|
I tried to encode
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheKinrar
Aug 2, 2017
Collaborator
So, should I make a PR anyway if this is not caused by Mastodon itself?
|
So, should I make a PR anyway if this is not caused by Mastodon itself? |
ykzts
added
the
bug
label
Aug 2, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nullkal
Aug 2, 2017
Collaborator
With --allow-unassigned I can successfully encode 🌹🌹🌹.ws.
$ idn 🌹🌹🌹.ws --allow-unassigned
xn--2h8haa.ws
|
With
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
This bug is starting from #4212. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
TheKinrar
Aug 2, 2017
Collaborator
🌹🌹🌹.ws should not be a valid domain name in fact as it contains unassigned code points.
I'm not sure we should care about handling invalid domain names.
On the other part, the strange thing is I can resolve this domain. But it should not be valid.
|
I'm not sure we should care about handling invalid domain names. |
nullkal
referenced this issue
in sporkmonger/addressable
Aug 2, 2017
Merged
Specify ALLOW_UNASSIGNED flags in Addressable::IDNA.to_ascii/to_unicode #266
added a commit
to TheKinrar/mastodon
that referenced
this issue
Aug 2, 2017
TheKinrar
referenced this issue
Aug 2, 2017
Merged
Don't throw while normalizing invalid domain names #4499
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nullkal
Aug 2, 2017
Collaborator
It seems libidn 1.x, which ruby-idn uses, treats characters which is not specified in RFC3454, as unassigned code points. The most ideal solution is to use libidn2, which regards IDNA2008, instead of libidn 1.x.
|
It seems libidn 1.x, which ruby-idn uses, treats characters which is not specified in RFC3454, as unassigned code points. The most ideal solution is to use libidn2, which regards IDNA2008, instead of libidn 1.x. |
Gargron
closed this
in
#4499
Aug 2, 2017
added a commit
that referenced
this issue
Aug 2, 2017
added a commit
to mosaxiv/mastodon
that referenced
this issue
Aug 6, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unarist
Aug 6, 2017
Collaborator
Strictly speaking, symbols and emojis including 🌹 are "disallowed" in IDNA2008, but allowed in TR46 for compatibility during the transition phase.
http://unicode.org/faq/idn.html
So IDN2_TRANSITIONAL flag will be needed even if it uses libidn2.
|
Strictly speaking, symbols and emojis including http://unicode.org/faq/idn.html So |
TheKinrar commentedAug 2, 2017
•
edited
Edited 1 time
-
TheKinrar
edited Aug 2, 2017 (most recent)
Users of the instance report 500 error codes and issues with the local timeline only.
Nothing wrong on my side so it seems like it does not impact every user.
In puma's log I have a lot of errors like these:
master(If you're a user, don't worry about this).