Skip to content

Adjust exception chain from invalid URLs in URLCleaner / URLNormalizers#57

Open
lfoppiano wants to merge 4 commits into
ccfrom
bugfix/invalid-url-wat
Open

Adjust exception chain from invalid URLs in URLCleaner / URLNormalizers#57
lfoppiano wants to merge 4 commits into
ccfrom
bugfix/invalid-url-wat

Conversation

@lfoppiano

@lfoppiano lfoppiano commented Jun 3, 2026

Copy link
Copy Markdown

While processing the WAT file, the URLCleaner crawshed while encountering an invalid URL:

http://techsauce/%20global%20summit%202023%20%E0%B9%80%E0%B8%9B%E0%B9%87%E0%B8%99%E0%B8%87%E0%B8%B2%E0%B8%99%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%8A%E0%B8%B8%E0%B8%A1%E0%B8%A3%E0%B8%B0%E0%B8%94%E0%B8%B1%E0%B8%9A%E0%B9%82%E0%B8%A5%E0%B8%81%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%88%E0%B8%B1%E0%B8%94%E0%B8%82%E0%B8%B6%E0%B9%89%E0%B8%99%E0%B9%83%E0%B8%99%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%2016%E2%80%9317%20%E0%B8%AA%E0%B8%B4%E0%B8%87%E0%B8%AB%E0%B8%B2%E0%B8%84%E0%B8%A1%202566%20%E0%B8%93%20%E0%B8%A8%E0%B8%B9%E0%B8%99%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%8A%E0%B8%B8%E0%B8%A1%E0%B9%81%E0%B8%AB%E0%B9%88%E0%B8%87%E0%B8%8A%E0%B8%B2%E0%B8%95%E0%B8%B4%E0%B8%AA%E0%B8%B4%E0%B8%A3%E0%B8%B4%E0%B8%81%E0%B8%B4%E0%B8%95%E0%B8%B4%E0%B9%8C%20%E0%B8%81%E0%B8%A3%E0%B8%B8%E0%B8%87%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%AF%20%E0%B8%87%E0%B8%B2%E0%B8%99%E0%B8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0%B9%89%20nft%20gen2%20%E0%B8%8B%E0%B8%B6%E0%B9%88%E0%B8%87%E0%B9%80%E0%B8%9B%E0%B9%87%E0%B8%99%E0%B8%AA%E0%B9%88%E0%B8%A7%E0%B8%99%E0%B8%AB%E0%B8%99%E0%B8%B6%E0%B9%88%E0%B8%87%E0%B8%82%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%97%E0%B8%84%E0%B9%82%E0%B8%99%E0%B9%82%E0%B8%A5%E0%B8%A2%E0%B8%B5%20dynamic%20data%20layer%20%E0%B8%82%E0%B8%AD%E0%B8%87%E0%B8%97%E0%B8%B2%E0%B8%87%20six%20network%20%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%87%E0%B8%B2%E0%B8%99%20techsauce%20global%20summit%202023%20%E0%B9%84%E0%B8%94%E0%B9%89%E0%B9%80%E0%B8%9E%E0%B8%B4%E0%B9%88%E0%B8%A1%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%A1%E0%B8%B5%E0%B8%AA%E0%B9%88%E0%B8%A7%E0%B8%99%E0%B8%A3%E0%B9%88%E0%B8%A7%E0%B8%A1%E0%B8%82%E0%B8%AD%E0%B8%87%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89%20%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%8A%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%A1%E0%B8%95%E0%B9%88%E0%B8%AD%20nft%20%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%AA%E0%B8%9A%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%93%E0%B9%8C%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%88%E0%B8%B1%E0%B8%94%E0%B8%87%E0%B8%B2%E0%B8%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%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B8%AB%E0%B8%A5%E0%B8%B2%E0%B8%81%E0%B8%AB%E0%B8%A5%E0%B8%B2%E0%B8%A2%E0%B8%A1%E0%B8%B2%E0%B8%81%E0%B8%82%E0%B8%B6%E0%B9%89%E0%B8%99%20%20%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B2%E0%B8%A1%20six%20network%20%E0%B9%84%E0%B8%94%E0%B9%89%E0%B8%97%E0%B8%B5%E0%B9%88%20%20website%20l%20telegram%20l%20twitter%20l%20facebook%20l%20discord%20l%20medium/

Exception:

2026-06-02 18:24:42,146 WARN [main] mapred.YarnChild: Exception running child : com.ibm.icu.util.ICUInputTooLongException: input too long: 1255 UTF-16 code units
        at com.ibm.icu.impl.Punycode.encode(Punycode.java:135)
        at com.ibm.icu.impl.UTS46.processLabel(UTS46.java:469)
        at com.ibm.icu.impl.UTS46.processUnicode(UTS46.java:257)
        at com.ibm.icu.impl.UTS46.process(UTS46.java:193)
        at com.ibm.icu.impl.UTS46.nameToASCII(UTS46.java:53)
        at org.apache.nutch.util.URLUtil.convertIDNA2008(URLUtil.java:679)
        at org.apache.nutch.net.urlnormalizer.basic.BasicURLNormalizer.normalizeHostName(BasicURLNormalizer.java:434)
        at org.apache.nutch.net.urlnormalizer.basic.BasicURLNormalizer.normalize(BasicURLNormalizer.java:194)
        at org.apache.nutch.net.URLNormalizers.normalize(URLNormalizers.java:316)
        at org.commoncrawl.tools.UrlCleaner$UrlCleanerMapper.map(UrlCleaner.java:136)
        at org.commoncrawl.tools.UrlCleaner$UrlCleanerMapper.map(UrlCleaner.java:84)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:800)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:348)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:178)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:172)

The exception com.ibm.icu.util.ICUInputTooLongException: input too long: 1255 UTF-16 code units was thrown by ICU Punycode.encodeURLUtil.convertIDNA2008BasicURLNormalizer.normalizeHostNameUrlCleaner.map.

Reason, is that ICUInputTooLongException is unchecked. So convertIDNA2008 only handled the soft idnaInfo.hasErrors() path, and the mapper caught only MalformedURLException, so the exception escaped → task died → 4 retries → job FAILED. (The neighboring convertIDNA2003 already guarded IllegalArgumentException/IndexOutOfBoundsException; the 2008 variant did not.)

Fix: We wrapped the idna.nameTo* calls in convertIDNA2008 and convert ICU's unchecked exceptions to MalformedURLException, with initCause and LOG.debug. The UTS46 + Punycode path throws three unrelated unchecked types, so catch all of them: catch (ICUException | IllegalArgumentException | IllegalStateException e) (ICUException covers ICUInputTooLongException; IllegalArgumentException comes from UTS46, IllegalStateException from Punycode; the referenced StringPrepParseException is checked and cannot escape). The mapper then rejects the URL (increments the rejected counter) and the job survives.

@lfoppiano lfoppiano marked this pull request as ready for review June 3, 2026 09:41
@lfoppiano lfoppiano changed the title Bugfix/invalid url wat Adjust exception chain from invalid URLs in URLCleaner / URLNormalizers Jun 3, 2026
@lfoppiano lfoppiano requested a review from Copilot June 3, 2026 09:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens Nutch’s IDNA2008 hostname conversion so that unchecked ICU exceptions (e.g., from UTS46/Punycode) are converted into MalformedURLException, allowing callers like BasicURLNormalizer/URLCleaner to reject bad URLs instead of crashing a task.

Changes:

  • Wrap ICU IDNA.nameToASCII/nameToUnicode in URLUtil.convertIDNA2008 with a try/catch to translate unchecked ICU/UTS46/Punycode exceptions into MalformedURLException (with cause attached).
  • Add a regression test intended to cover an invalid host case derived from a recent crawl sample.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/java/org/apache/nutch/util/URLUtil.java Converts unchecked ICU exceptions during IDNA2008 conversion into MalformedURLException to prevent task crashes.
src/test/org/apache/nutch/util/TestURLUtil.java Adds a regression test for invalid-host handling in convertIDNA2008.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/org/apache/nutch/util/TestURLUtil.java Outdated

@sebastian-nagel sebastian-nagel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @lfoppiano! Good catch!

Would you mind to push this fix upstream? As usual, needs a Jira issue and PR. For the upstream test a "neutral" dummy URL would be preferable. Or even better: multiple URLs to test for the various runtime exceptions thrown by ICU. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants