Sunk a few hours tracking down this problem....
At
https://github.com/google/nomulus/blob/master/java/google/registry/flows/domain/BaseDomainCreateFlow.java#L127 , you'll find code like the following:
protected String createFlowRepoId() {
// The domain name hasn't been validated yet, so if it's invalid, instead of throwing an error,
// simply leave the repoId blank (it won't be needed anyway as the flow will fail when
// validation fails later).
try {
Optional<InternetDomainName> tldParsed =
findTldForName(InternetDomainName.from(command.getFullyQualifiedDomainName()));
return tldParsed.isPresent()
? createDomainRoid(ObjectifyService.allocateId(), tldParsed.get().toString())
: null;
} catch (IllegalArgumentException e) {
return null;
}
}
We managed to get duplicate ROID suffixes (null) in two TLDs, which causes
createDomainRoid() to die with IllegalArgumentException, like so:
java.lang.IllegalArgumentException: value already present: null
at com.google.common.collect.HashBiMap.put(HashBiMap.java:282)
at com.google.common.collect.HashBiMap.put(HashBiMap.java:258)
at google.registry.model.RoidSuffixes$1$1.run(RoidSuffixes.java:40)
at google.registry.model.RoidSuffixes$1$1.run(RoidSuffixes.java:34)
at google.registry.model.ofy.Ofy.doTransactionless(Ofy.java:289)
at google.registry.model.RoidSuffixes$1.get(RoidSuffixes.java:34)
at google.registry.model.RoidSuffixes$1.get(RoidSuffixes.java:31)
at com.google.common.base.Suppliers$ExpiringMemoizingSupplier.get(Suppliers.java:199)
at google.registry.model.RoidSuffixes.getRoidSuffixForTld(RoidSuffixes.java:55)
at google.registry.model.EppResourceUtils.createDomainRoid(EppResourceUtils.java:58)
at google.registry.flows.domain.BaseDomainCreateFlow.createFlowRepoId(BaseDomainCreateFlow.java:126)
at google.registry.flows.ResourceCreateFlow.initRepoId(ResourceCreateFlow.java:49)
However, you wouldn't get to see
that stack trace because of the catch in
createFlowRepoId(). Instead, you'll get something like below because of the time-bomb created by the catch:
I don't know what to suggest, except to say that it seems exceptions are being used there to create "application logic", and thus subverting much (all?) of the value of the Preconditions checks.... Perhaps the validation of the tld/name should be done explicitly before getting to this point? In any case, the assumption stated in the comment, that "
it won't be needed anyway as the flow will fail when validation fails later," is wrong in this case. We can argue that "other" assumptions (duplicate ROIDS) were violated and so all bets are off, but the swallowing of the exception makes it really hard to track that mistake down....
-h