Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 63BE6200B85 for ; Thu, 1 Sep 2016 00:16:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6198A160AB5; Wed, 31 Aug 2016 22:16:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 51F7A160AB4 for ; Thu, 1 Sep 2016 00:16:17 +0200 (CEST) Received: (qmail 1745 invoked by uid 500); 31 Aug 2016 22:16:16 -0000 Mailing-List: contact user-help@jclouds.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@jclouds.apache.org Delivered-To: mailing list user@jclouds.apache.org Received: (qmail 1730 invoked by uid 99); 31 Aug 2016 22:16:16 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Aug 2016 22:16:16 +0000 Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id DBF2E1A015B for ; Wed, 31 Aug 2016 22:16:15 +0000 (UTC) Received: by mail-wm0-f54.google.com with SMTP id w2so49998196wmd.0 for ; Wed, 31 Aug 2016 15:16:15 -0700 (PDT) X-Gm-Message-State: AE9vXwNxCvg/Uixk7i8PT9ZsQhsuOqrq63VAjCbI+0yTY4VWn1fEhfus0j/zCBAEQY6CpPOF400aknm8rGKZfQ== X-Received: by 10.28.207.197 with SMTP id f188mr12062113wmg.69.1472681774537; Wed, 31 Aug 2016 15:16:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.10.193 with HTTP; Wed, 31 Aug 2016 15:15:53 -0700 (PDT) In-Reply-To: <34501550.3568310.1472645549997.JavaMail.zimbra@redhat.com> References: <1281264188.3566406.1472643976039.JavaMail.zimbra@redhat.com> <34501550.3568310.1472645549997.JavaMail.zimbra@redhat.com> From: Ignasi Barrera Date: Thu, 1 Sep 2016 00:15:53 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: DnsNameValidator and EC2 To: "user@jclouds.apache.org" Cc: Josef Cacek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable archived-at: Wed, 31 Aug 2016 22:16:18 -0000 Hi Richard, Having a look at the DnsNameValidator, it looks like it is prepared to be configurable [1]. The problem is that the FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeat class (the one that uses the group prefix to generate names), instantiates it directly with fixed values. I'd suggest a different approach: * Change that strategy to not assign a DnsNameValidator by default, to let the Guice injector provide one. * Configure the min/max variables in the DnsNameValidator to be optionally injectable and assign the default values there. * Add constants for the min/max existing property names in the jcloud Constants class so they are more easily discoverable and configurable. This way we keep the current behavior but would be allowing users to set the min/max length as properties when creating the context, in case they need longer names. WDYT? [1] https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/j= clouds/predicates/validators/DnsNameValidator.java#L42-L43 [2] https://github.com/jclouds/jclouds/blob/8053abb5302641a6500cb3f46e7c9e5= 8de3b0ebe/compute/src/main/java/org/jclouds/compute/internal/FormatSharedNa= mesAndAppendUniqueStringToThoseWhichRepeat.java#L79 On 31 August 2016 at 14:12, Richard Janik wrote: > Hello everyone, > > I've run into [2] some time ago. First off, it's not a problem for me to = just shorten the group names. However, I've brought this up with a colleagu= e of mine and it's been suggested, that the limit of 63 characters is in th= ere due to [1], which is obsolete, and that maybe the limit could be remove= d. I searched briefly through the RFCs that update [1], but couldn't find a= ny clear proof that that the limit has been removed or is higher now. > > I've rebuilt JClouds with DnsNameValidator with its max value =3D 200. Th= e JClouds unit tests are passing and EC2 has no problems with long instance= names (~150 characters) either. Other cloud providers might have some issu= es with that, but I wouldn't know. > > So the question is: could the limit of 63 characters on DnsNameValidator = be removed or increased without impacting something I'm not aware of? If it= could be increased, how high can we go? If its there for a reason, what is= the reason? > > Thanks for any insights, > R. > > [1]: https://tools.ietf.org/html/rfc1035#section-2.3.4 > [2]: <<< stacktrace begin >>> > java.lang.IllegalArgumentException: Object 'a-very-long-node-group-name-t= hat-is-definitely-longer-than-sixty-three-characters-and-will-require-postp= rocessing' doesn't match dns naming constraints. Reason: Can't be null or e= mpty. Length must be 3 to 63 symbols.. > at org.jclouds.predicates.validators.DnsNameValidator.exception(D= nsNameValidator.java:74) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] > at org.jclouds.predicates.validators.DnsNameValidator.validate(Dn= sNameValidator.java:51) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] > at org.jclouds.predicates.validators.DnsNameValidator.validate(Dn= sNameValidator.java:36) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] > at org.jclouds.compute.internal.FormatSharedNamesAndAppendUniqueS= tringToThoseWhichRepeat.checkGroup(FormatSharedNamesAndAppendUniqueStringTo= ThoseWhichRepeat.java:124) ~[jclouds-compute-2.0.0-SNAPSHOT.jar:2.0.0-SNAPS= HOT] > at org.jclouds.compute.internal.FormatSharedNamesAndAppendUniqueS= tringToThoseWhichRepeat.sharedNameForGroup(FormatSharedNamesAndAppendUnique= StringToThoseWhichRepeat.java:120) ~[jclouds-compute-2.0.0-SNAPSHOT.jar:2.0= .0-SNAPSHOT] > at org.jclouds.ec2.compute.strategy.CreateKeyPairAndSecurityGroup= sAsNeededAndReturnRunOptions.getSecurityGroupsForTagAndOptions(CreateKeyPai= rAndSecurityGroupsAsNeededAndReturnRunOptions.java:168) ~[ec2-2.0.0-SNAPSHO= T.jar:2.0.0-SNAPSHOT] > at org.jclouds.aws.ec2.compute.strategy.CreateKeyPairPlacementAnd= SecurityGroupsAsNeededAndReturnRunOptions.addSecurityGroups(CreateKeyPairPl= acementAndSecurityGroupsAsNeededAndReturnRunOptions.java:199) ~[aws-ec2-2.0= .0-SNAPSHOT.jar:2.0.0-SNAPSHOT] > at org.jclouds.ec2.compute.strategy.CreateKeyPairAndSecurityGroup= sAsNeededAndReturnRunOptions.execute(CreateKeyPairAndSecurityGroupsAsNeeded= AndReturnRunOptions.java:80) ~[ec2-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] > at org.jclouds.aws.ec2.compute.strategy.CreateKeyPairPlacementAnd= SecurityGroupsAsNeededAndReturnRunOptions.execute(CreateKeyPairPlacementAnd= SecurityGroupsAsNeededAndReturnRunOptions.java:88) ~[aws-ec2-2.0.0-SNAPSHOT= .jar:2.0.0-SNAPSHOT] > at org.jclouds.aws.ec2.compute.strategy.CreateKeyPairPlacementAnd= SecurityGroupsAsNeededAndReturnRunOptions.execute(CreateKeyPairPlacementAnd= SecurityGroupsAsNeededAndReturnRunOptions.java:55) ~[aws-ec2-2.0.0-SNAPSHOT= .jar:2.0.0-SNAPSHOT] > at org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddT= oSet.createKeyPairAndSecurityGroupsAsNeededThenRunInstances(EC2CreateNodesI= nGroupThenAddToSet.java:213) ~[ec2-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] > at org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddT= oSet.runInstancesAndWarnOnInvisible(EC2CreateNodesInGroupThenAddToSet.java:= 151) ~[ec2-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] > at org.jclouds.ec2.compute.strategy.EC2CreateNodesInGroupThenAddT= oSet.execute(EC2CreateNodesInGroupThenAddToSet.java:132) ~[ec2-2.0.0-SNAPSH= OT.jar:2.0.0-SNAPSHOT] > at org.jclouds.compute.internal.BaseComputeService.createNodesInG= roup(BaseComputeService.java:217) ~[jclouds-compute-2.0.0-SNAPSHOT.jar:2.0.= 0-SNAPSHOT] > at org.jclouds.ec2.compute.EC2ComputeService.createNodesInGroup(E= C2ComputeService.java:148) ~[ec2-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT] > at org.wildfly.extras.sunstone.api.impl.AbstractJCloudsNode.creat= eNode(AbstractJCloudsNode.java:154) ~[classes/:na] > at org.wildfly.extras.sunstone.api.impl.ec2.EC2Node.(EC2Nod= e.java:81) ~[classes/:na] > at org.wildfly.extras.sunstone.api.impl.ec2.EC2CloudProvider.crea= teNodeInternal(EC2CloudProvider.java:74) ~[classes/:na] > at org.wildfly.extras.sunstone.api.impl.AbstractJCloudsCloudProvi= der.lambda$createNode$3(AbstractJCloudsCloudProvider.java:101) ~[classes/:n= a] > at org.wildfly.extras.sunstone.api.impl.AbstractJCloudsCloudProvi= der$$Lambda$9/2121317689.apply(Unknown Source) ~[na:na] > at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashM= ap.java:1853) ~[na:1.8.0_45] > at org.wildfly.extras.sunstone.api.impl.AbstractJCloudsCloudProvi= der.createNode(AbstractJCloudsCloudProvider.java:96) ~[classes/:na] > at org.wildfly.extras.sunstone.api.impl.AbstractJCloudsCloudProvi= der.createNode(AbstractJCloudsCloudProvider.java:84) ~[classes/:na] > at org.wildfly.extras.sunstone.tests.ec2.EC2LongNodeGroupTest.tes= tLongNodeGroup(EC2LongNodeGroupTest.java:36) ~[test-classes/:na] > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[= na:1.8.0_45] > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess= orImpl.java:62) ~[na:1.8.0_45] > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth= odAccessorImpl.java:43) ~[na:1.8.0_45] > at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45= ] > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Fr= ameworkMethod.java:50) [junit-4.12.jar:4.12] > at org.junit.internal.runners.model.ReflectiveCallable.run(Reflec= tiveCallable.java:12) [junit-4.12.jar:4.12] > at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fram= eworkMethod.java:47) [junit-4.12.jar:4.12] > at org.junit.internal.runners.statements.InvokeMethod.evaluate(In= vokeMethod.java:17) [junit-4.12.jar:4.12] > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) = [junit-4.12.jar:4.12] > at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4C= lassRunner.java:78) [junit-4.12.jar:4.12] > at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4C= lassRunner.java:57) [junit-4.12.jar:4.12] > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [j= unit-4.12.jar:4.12] > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71= ) [junit-4.12.jar:4.12] > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:2= 88) [junit-4.12.jar:4.12] > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58= ) [junit-4.12.jar:4.12] > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:26= 8) [junit-4.12.jar:4.12] > at org.junit.internal.runners.statements.RunBefores.evaluate(RunB= efores.java:26) [junit-4.12.jar:4.12] > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [jun= it-4.12.jar:4.12] > at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4= Provider.java:367) [surefire-junit4-2.19.1.jar:2.19.1] > at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRer= un(JUnit4Provider.java:274) [surefire-junit4-2.19.1.jar:2.19.1] > at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet= (JUnit4Provider.java:238) [surefire-junit4-2.19.1.jar:2.19.1] > at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4P= rovider.java:161) [surefire-junit4-2.19.1.jar:2.19.1] > at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderIn= SameClassLoader(ForkedBooter.java:290) [surefire-booter-2.19.1.jar:2.19.1] > at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProce= ss(ForkedBooter.java:242) [surefire-booter-2.19.1.jar:2.19.1] > at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoote= r.java:121) [surefire-booter-2.19.1.jar:2.19.1] > <<< stacktrace end >>>