The bug was fixed on Origin,but for the latest build of OSE,the bug still could be reproduced.Clone this bug to OSE to track. $openshift version openshift v3.0.1.0-338-g9dfce43 kubernetes v1.0.0 +++ This bug was initially created as a clone of Bug #1241392 +++ Description of problem: On web console,try to create the application using source code,but it failed. The error is: Cannot create DeploymentConfig ruby-hello-world. DeploymentConfig "ruby-hello-world" is invalid: template.controllerTemplate.template.spec.containers[0].ports[0].name: invalid value 'ruby-hello-world-tcp-8080': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hypens cannot be adjacent to other hyphens): e.g. "http" Version-Release number of selected component (if applicable): devenv-fedora_1961 How reproducible: Always Steps to Reproduce: 1.Create application using source code on web console 2. 3. Actual results: Failed to create ruby-hello-world in project wsuntest Cannot create DeploymentConfig ruby-hello-world. DeploymentConfig "ruby-hello-world" is invalid: template.controllerTemplate.template.spec.containers[0].ports[0].name: invalid value 'ruby-hello-world-tcp-8080': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hypens cannot be adjacent to other hyphens): e.g. "http" Expected results: Could create the application successfully Additional info: Could create the app using source code via oc $ oc new-app openshift/ruby-20-centos7~https://github.com/openshift/ruby-hello-world.git -n wsuntest --config=openshift.local.config/master/admin.kubeconfig imagestreams/ruby-20-centos7 imagestreams/ruby-hello-world buildconfigs/ruby-hello-world deploymentconfigs/ruby-hello-world services/ruby-hello-world A build was created - you can run `oc start-build ruby-hello-world` to start it. Service "ruby-hello-world" created at 172.30.82.227 with port mappings 8080. --- Additional comment from weiwei jiang on 2015-07-09 03:57:27 EDT --- Management console doesn't check if the port.name exceed the limitation. https://github.com/openshift/origin/blob/master/assets/app/scripts/services/applicationGenerator.js#L58 And `oc new-app` will guarantee the port.name is a valid IANA_SVC_NAME. https://github.com/openshift/origin/blob/master/pkg/generate/app/app.go#L343 So should the Management console do the same things like oc to generate a valid name? --- Additional comment from Samuel Padgett on 2015-07-17 09:23:43 EDT --- There appears to be a problem with build configs as well: Cannot create BuildConfig nodejs-example. BuildConfig "nodejs-example" is invalid: spec.output.to.kind: required value --- Additional comment from Samuel Padgett on 2015-07-17 10:05:24 EDT --- https://github.com/openshift/origin/pull/3752 --- Additional comment from Wei Sun on 2015-07-20 00:57:25 EDT --- Checked this bug in devenv_fedora_2024,now could create the application successfully using source code on web console. After the bug is moved to ON_QA,we will verify it. --- Additional comment from Wei Sun on 2015-07-20 21:51:30 EDT --- Verified this bug in devenv-fedora_2032. Now the application could be created successfully.
As default, After setup ose env, there is some xpass-templates, when using those template to create application, always failed with error.(all the xpass-template have this issue) steps: 1. Login ose env 2. Create application using xpaas-templates example select "eap6-basic-sti" template, click create 3.Met some error: Cannot create DeploymentConfig eap-app. DeploymentConfig "eap-app" is invalid: [template.controllerTemplate.template.spec.containers[0].ports[0].name: invalid value 'eap-app-tcp-8080': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hyphens cannot be adjacent to other hyphens): e.g. "http", template.controllerTemplate.template.spec.containers[0].ports[1].name: invalid value 'eap-app-ping-8888': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hyphens cannot be adjacent to other hyphens): e.g. "http"] Cannot create BuildConfig eap-app. BuildConfig "eap-app" is invalid: [triggers[0].type: invalid value 'github': invalid trigger type, triggers[1].type: invalid value 'generic': invalid trigger type, triggers[2].type: invalid value 'imageChange': invalid trigger type, spec.output.to.kind: required value]
Tested this bug in the latest OSE env(openshift v3.0.1.0-388-g51e9da7 and kubernetes v1.0.0),now could create the application using https://github.com/openshift/nodejs-ex and https://github.com/openshift/ruby-hello-world.git. But for xpaas-tempaltes,such as eap6-basic-sti,the application still could not be created successfully. The error: Failed to create eap6-basic-sti in project wsun Hide details Cannot create DeploymentConfig eap-app. DeploymentConfig "eap-app" is invalid: [template.controllerTemplate.template.spec.containers[0].ports[0].name: invalid value 'eap-app-tcp-8080': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hyphens cannot be adjacent to other hyphens): e.g. "http", template.controllerTemplate.template.spec.containers[0].ports[1].name: invalid value 'eap-app-ping-8888': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hyphens cannot be adjacent to other hyphens): e.g. "http"] Cannot create BuildConfig eap-app. BuildConfig "eap-app" is invalid: [triggers[0].type: invalid value 'github': invalid trigger type, triggers[1].type: invalid value 'generic': invalid trigger type, triggers[2].type: invalid value 'imageChange': invalid trigger type, spec.output.to.kind: required value]
I can reproduce in origin.
The template has the long names for deployment config. We're not generating them. "ports": [ { "name": "${APPLICATION_NAME}-tcp-8080", "containerPort": 8080, "protocol": "TCP" }, { "name": "${APPLICATION_NAME}-ping-8888", "containerPort": 8888, "protocol": "TCP" } ], https://github.com/jboss-openshift/application-templates/blob/master/eap/eap6-basic-sti.json#L264
Kevin or Rob can you change the way you name your ports to be a fixed short value like: https://github.com/openshift/cakephp-ex/blob/master/openshift/templates/cakephp.json#L26-L32 ?
Scott, we'll need to pick up new xpaas templates after this change is made.
There's also an error about triggers. Cannot create BuildConfig eap-app. BuildConfig "eap-app" is invalid: [triggers[0].type: invalid value 'github': invalid trigger type, triggers[1].type: invalid value 'generic': invalid trigger type, triggers[2].type: invalid value 'imageChange': invalid trigger type, spec.output.to.kind: required value]
I think that one may be a bug on our side along the same lines as the conversion issue I need to investigate. I believe we were supposed to continue converting lowercase values to uppercase.
I've updated the templates. I'm not quite sure what the release process for them is, but feel free to give the versions in the master branch of jboss-openshift/application-templates a try.
Thanks Rob! Assigning to Scott to pull the new versions.
Rob/Kevin, Can you do a new tag/release in github? I'm still working on pulling in content into the RPM but the route I'm going now depends on having a release tarball from github.
I can do that, but I'm not sure what to tag it as. Looks like our next planned release is 1.1.0. I've tagged it as ose-v1.0.1 which I hope is OK.
(fyi there was also a bug in that we should have been tolerating the lowercase trigger type names. i'm fixing that as part of: https://github.com/openshift/origin/issues/3754)
I updated the build config sections for the lower case trigger types and added kind=ImageStreamTag to the output section as well.
(In reply to Rob Cernich from comment #13) > I can do that, but I'm not sure what to tag it as. Looks like our next > planned release is 1.1.0. I've tagged it as ose-v1.0.1 which I hope is OK. That's fine.
We weren't able to get the json data into the openshift rpm in time for this so we've simply updated the content in ansible. Anyone performing a new install after this point or re-running ansible with the latest code should have the correct data in /usr/share/openshift/examples. Anyone wishing to update the data stored in the openshift project can run the following : # oc create -n openshift -f /usr/share/openshift/examples/xpaas-templates/ # oc replace -n openshift -f /usr/share/openshift/examples/xpaas-templates/
Will check this bug after the bug https://bugzilla.redhat.com/show_bug.cgi?id=1247461 is fixed.
Now could create the application successfully with xpass-templates , so verified this bug. # openshift version openshift v3.0.1.0-503-g7cc6deb kubernetes v1.0.0
This fix has not been shipped on openshift-master-3.0.1.0-1.git.525.eddc479.el7ose.x86_64 ? I and my customer are hitting same error during creating eap6-basic-sti with 3.0.1.0. Additionally, due to this bug, replicationController which created on v3.0.0.1 can't be deleted after update to v3.0.1.0. Please let me confirm if this fix has been shipped or not.
Here is my tested version and logs: Version: === [joe@ose3-master examples]$ oc version oc v3.0.1.0-525-geddc479 kubernetes v1.0.0 [joe@ose3-master examples]$ rpm -qa |grep openshift openshift-sdn-node-0.4-3.git.27.2dcf461.el7ose.x86_64 tuned-profiles-openshift-node-3.0.1.0-1.git.525.eddc479.el7ose.x86_64 openshift-node-3.0.1.0-1.git.525.eddc479.el7ose.x86_64 openshift-master-3.0.1.0-1.git.525.eddc479.el7ose.x86_64 openshift-sdn-0.4-3.git.27.2dcf461.el7ose.x86_64 openshift-sdn-master-0.4-3.git.27.2dcf461.el7ose.x86_64 openshift-3.0.1.0-1.git.525.eddc479.el7ose.x86_64 openshift-sdn-ovs-3.0.1.0-1.git.525.eddc479.el7ose.x86_64 Logs: ==== [joe@ose3-master examples]$ oc new-app --template=eap6-basic-sti services/eap-app-http-service services/eap-app-https-service services/eap-app-ping routes/eap-app-http-route routes/eap-app-https-route imagestreams/eap-app Error: BuildConfig "eap-app" is invalid: spec.source.git.uri: required value Error: DeploymentConfig "eap-app" is invalid: [template.controllerTemplate.template.spec.containers[0].ports[0].name: invalid value 'eap-app-tcp-8080': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hyphens cannot be adjacent to other hyphens): e.g. "http", template.controllerTemplate.template.spec.containers[0].ports[1].name: invalid value 'eap-app-tcp-8443': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hyphens cannot be adjacent to other hyphens): e.g. "http", template.controllerTemplate.template.spec.containers[0].ports[2].name: invalid value 'eap-app-ping-8888': must be an IANA_SVC_NAME (at most 15 characters, matching regex [a-z0-9]([a-z0-9-]*[a-z0-9])*, it must contain at least one letter [a-z], and hyphens cannot be adjacent to other hyphens): e.g. "http"]
> Additionally, due to this bug, replicationController which created on v3.0.0.1 can't be deleted after update to v3.0.1.0. As for this issue, when I try to scale down to the pod, it causes timed out. [joe@ose3-master ~]$ oc scale --replicas=0 rc ruby-example-2 error: timed out waiting for the condition To fix this, I have to modify rc. ASIS --- ports: - containerPort: 8080 name: ruby-example-tcp-8080 TOBE --- ports: - containerPort: 8080 name: short-8080 [joe@ose3-master ~]$ oc scale --replicas=0 rc ruby-example-2 scaled
The root of this issue is related with template definition, but not openshift binary. I guess your customer was updating env to the latest v3.0.1.0, but missed to update template. Please refer to comment 17, that means if user re-install env with that latest ansible script, he should not encounter such issue. If user do NOT want to have to re-installed the whole env, run the follow command should fix such issues. # oc replace -n openshift -f https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/xpaas-templates/eap6-basic-sti.json templates/eap6-basic-sti At my side, install a fresh env, can not reproduce this issue. $ oc new-app --template=eap6-basic-sti services/eap-app services/eap-app-ping routes/eap-app-http-route imagestreams/eap-app buildconfigs/eap-app deploymentconfigs/eap-app Service "eap-app" created at 172.30.130.140 with port mappings 8080. Service "eap-app-ping" created at None with port mappings 8888. A build was created - you can run `oc start-build eap-app` to start it. Run 'oc status' to view your app. This is my "eap6-basic-sti" template definition, customer could run the same command to have a check if there is any difference. $ oc get template eap6-basic-sti -n openshift -o yaml apiVersion: v1 kind: Template labels: template: eap6-basic-sti metadata: annotations: description: Application template for EAP 6 applications built using STI. iconClass: icon-jboss creationTimestamp: 2015-08-03T00:52:24Z name: eap6-basic-sti namespace: openshift resourceVersion: "223" selfLink: /osapi/v1beta3/namespaces/openshift/templates/eap6-basic-sti uid: e7c2f7a0-3979-11e5-8607-fa163e70f276 objects: - apiVersion: v1 kind: Service metadata: annotations: description: The web server's http port. labels: application: ${APPLICATION_NAME} name: ${APPLICATION_NAME} spec: ports: - port: 8080 targetPort: 8080 selector: deploymentConfig: ${APPLICATION_NAME} - apiVersion: v1 kind: Service metadata: annotations: description: Ping service for clustered applications. labels: application: ${APPLICATION_NAME} name: ${APPLICATION_NAME}-ping spec: portalIP: None ports: - port: 8888 targetPort: 8888 selector: deploymentConfig: ${APPLICATION_NAME} - apiVersion: v1 id: ${APPLICATION_NAME}-http-route kind: Route metadata: annotations: description: Route for application's http service. labels: application: ${APPLICATION_NAME} name: ${APPLICATION_NAME}-http-route spec: host: ${APPLICATION_HOSTNAME} to: name: ${APPLICATION_NAME} - apiVersion: v1 kind: ImageStream metadata: labels: application: ${APPLICATION_NAME} name: ${APPLICATION_NAME} - apiVersion: v1 kind: BuildConfig metadata: labels: application: ${APPLICATION_NAME} name: ${APPLICATION_NAME} spec: output: to: kind: ImageStreamTag name: ${APPLICATION_NAME}:latest source: contextDir: ${GIT_CONTEXT_DIR} git: ref: ${GIT_REF} uri: ${GIT_URI} type: Git strategy: sourceStrategy: from: kind: ImageStreamTag name: jboss-eap6-openshift:${EAP_RELEASE} namespace: openshift type: Source triggers: - github: secret: ${GITHUB_TRIGGER_SECRET} type: GitHub - generic: secret: ${GENERIC_TRIGGER_SECRET} type: Generic - imageChange: {} type: ImageChange - apiVersion: v1 kind: DeploymentConfig metadata: labels: application: ${APPLICATION_NAME} name: ${APPLICATION_NAME} spec: replicas: 1 selector: deploymentConfig: ${APPLICATION_NAME} strategy: type: Recreate template: metadata: labels: application: ${APPLICATION_NAME} deploymentConfig: ${APPLICATION_NAME} name: ${APPLICATION_NAME} spec: containers: - env: - name: OPENSHIFT_DNS_PING_SERVICE_NAME value: ${APPLICATION_NAME}-ping - name: OPENSHIFT_DNS_PING_SERVICE_PORT value: "8888" - name: HORNETQ_CLUSTER_PASSWORD value: ${HORNETQ_CLUSTER_PASSWORD} - name: HORNETQ_QUEUES value: ${HORNETQ_QUEUES} - name: HORNETQ_TOPICS value: ${HORNETQ_TOPICS} image: ${APPLICATION_NAME} imagePullPolicy: Always name: ${APPLICATION_NAME} ports: - containerPort: 8080 name: http protocol: TCP - containerPort: 8888 name: ping protocol: TCP readinessProbe: exec: command: - /bin/bash - -c - /opt/eap/bin/readinessProbe.sh triggers: - imageChangeParams: automatic: true containerNames: - ${APPLICATION_NAME} from: kind: ImageStream name: ${APPLICATION_NAME} type: ImageChange parameters: - description: EAP Release version, e.g. 6.4, etc. name: EAP_RELEASE value: "6.4" - description: The name for the application. name: APPLICATION_NAME value: eap-app - description: 'Custom hostname for service routes. Leave blank for default hostname, e.g.: <application-name>.<project>.<default-domain-suffix>' name: APPLICATION_HOSTNAME - description: Git source URI for application name: GIT_URI value: https://github.com/jboss-developer/jboss-eap-quickstarts - description: Git branch/tag reference name: GIT_REF value: 6.4.x - description: Path within Git project to build; empty for root project directory. name: GIT_CONTEXT_DIR value: kitchensink - description: Queue names name: HORNETQ_QUEUES - description: Topic names name: HORNETQ_TOPICS - description: HornetQ cluster admin password from: '[a-zA-Z0-9]{8}' generate: expression name: HORNETQ_CLUSTER_PASSWORD - description: Github trigger secret from: '[a-zA-Z0-9]{8}' generate: expression name: GITHUB_TRIGGER_SECRET - description: Generic build trigger secret from: '[a-zA-Z0-9]{8}' generate: expression name: GENERIC_TRIGGER_SECRET
OK, I think I understand the cause of this issue. Can we really update exiting templates by this procedure? https://docs.openshift.com/enterprise/3.0/admin_guide/upgrades.html#updating-the-default-image-streams-and-templates As Johnny did, we can update by the command below, but I think the doc's procedure is not possible. > # oc replace -n openshift -f https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/xpaas-templates/eap6-basic-sti.json templates/eap6-basic-sti
In the doc, the following sentences are mentioned: Running the latest installer will copy newer files into place, but it does not currently update the openshift project. Re-run the latest installer would download the latest template files from github/opoenshift/openshift-ansible to overwrite the existing templates files in /usr/share/openshift/examples/, I think the doc's procedure should be right. You could have a try to get a final confirm.
I also think re-running installer will download new templates, but are you sure there is no side effect of the re-running installer? Also, as far as I read Scott's comment#17, he intends to let us use only ansible installer, not "sh <(curl -s https://install.openshift.com/ose/)", right? So, my questions are: 1. We are sure that re-running installer has no side effects? 2. Re-running installer means re-run ansible installer? Or quick-installer? Or Both?
I just tried to re-run ansible installer (user have to using the same ansible hosts file when installing the env for the first time.), it overwrote template files using the latest templates, did a smoke testing, no side effects is found.
Thank you for your testing. But, could you please consider if we can provide templates as tar or zip file officially? I think it is better to re-run ansible.
(In reply to Kenjiro Nakayama from comment #28) > Thank you for your testing. But, could you please consider if we can provide > templates as tar or zip file officially? I think it is better to re-run > ansible. Agree, it is more cleaner way. Let us wait for Scott's comments
Kenjiro, The xPaas teams are working on a way to deliver the examples in a zip file. I'll chekc with them on status.
Thank you Scott, Since this is customer's request, I opened new BZ ticket as RFE. https://bugzilla.redhat.com/show_bug.cgi?id=1253521
Kevin Conner <kevin.conner> updated the status of jira CLOUD-142 to Closed