Bug 1357668 - Cannot create EAP quick start application - invalid imagestreamtag
Summary: Cannot create EAP quick start application - invalid imagestreamtag
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: openshift-controller-manager
Version: 3.3.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Michail Kargakis
QA Contact: zhou ying
URL:
Whiteboard:
: 1358898 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-18 19:58 UTC by Mike Fiedler
Modified: 2017-03-08 18:26 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
We were defaulting the type for ImageChangeTriggers in deployment configs unconditionally to ImageStreamTag. Fixtures that were using ImageStream would be invalidated once validation would come across a trigger of ImageStreamTag type and an ImageStream value. We changed defaulting to default to ImageStreamTag iff there is no type specified. Otherwise, if a type is specified, it is handled correctly by conversion in order to maintain backwards comp and transform old data.
Clone Of:
Environment:
Last Closed: 2016-09-27 09:40:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLOUD-853 0 Major Resolved ImageChange trigger in deploy config requires ImageStreamTag, not ImageStream reference 2018-06-11 00:53:29 UTC
Red Hat Product Errata RHBA-2016:1933 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 13:24:36 UTC

Description Mike Fiedler 2016-07-18 19:58:29 UTC
Description of problem:

Trying to create the eap-app quickstarts from a template fails with:

error: DeploymentConfig "eap-app" is invalid: spec.triggers[0].imageChangeParams.from.name: Invalid value: "eap-app": invalid ImageStreamTag: eap-app


Version-Release number of selected component (if applicable): 3.3.0.6


How reproducible: always


Steps to Reproduce:
1.  oc new-app --template eap64-basic-s2i

Actual results:

error: DeploymentConfig "eap-app" is invalid: spec.triggers[0].imageChangeParams.from.name: Invalid value: "eap-app": invalid ImageStreamTag: eap-app

Expected results:

Successful app creation and initial build started

Comment 1 Ben Parees 2016-07-18 20:04:03 UTC
Where did you get your template from?  the template I see has an ImageStream for the trigger, not an imagestreamtag:
https://github.com/jboss-openshift/application-templates/blob/master/eap/eap64-basic-s2i.json#L236

which admittedly is a little weird (i think that means it defaults to latest on the imagestream).

Comment 2 Mike Fiedler 2016-07-18 20:11:15 UTC
It was the one created in the openshift namespace during install (BYO playbook) 

root@ip-172-31-18-111: ~/svt/openshift_scalability/content/golang # oc get template eap64-basic-s2i -o yaml -n openshift
apiVersion: v1
kind: Template
labels:
  template: eap64-basic-s2i
  xpaas: 1.2.0
metadata:
  annotations:
    description: Application template for EAP 6 applications built using S2I.
    iconClass: icon-jboss
    tags: eap,javaee,java,jboss,xpaas
    version: 1.2.0
  creationTimestamp: 2016-07-18T18:33:27Z
  name: eap64-basic-s2i
  namespace: openshift
  resourceVersion: "382"
  selfLink: /oapi/v1/namespaces/openshift/templates/eap64-basic-s2i
  uid: 1e7bdd22-4d16-11e6-a2c8-020b345ecfd3
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
  id: ${APPLICATION_NAME}-http
  kind: Route
  metadata:
    annotations:
      description: Route for application's http service.
    labels:
      application: ${APPLICATION_NAME}
    name: ${APPLICATION_NAME}
  spec:
    host: ${HOSTNAME_HTTP}
    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: ${CONTEXT_DIR}
      git:
        ref: ${SOURCE_REPOSITORY_REF}
        uri: ${SOURCE_REPOSITORY_URL}
      type: Git
    strategy:
      sourceStrategy:
        forcePull: true
        from:
          kind: ImageStreamTag
          name: jboss-eap64-openshift:1.2
          namespace: ${IMAGE_STREAM_NAMESPACE}
      type: Source
    triggers:
    - github:
        secret: ${GITHUB_WEBHOOK_SECRET}
      type: GitHub
    - generic:
        secret: ${GENERIC_WEBHOOK_SECRET}
      type: Generic
    - imageChange: {}
      type: ImageChange
    - type: ConfigChange
- 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_KUBE_PING_LABELS
            value: application=${APPLICATION_NAME}
          - name: OPENSHIFT_KUBE_PING_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: HORNETQ_CLUSTER_PASSWORD
            value: ${HORNETQ_CLUSTER_PASSWORD}
          - name: HORNETQ_QUEUES
            value: ${HORNETQ_QUEUES}
          - name: HORNETQ_TOPICS
            value: ${HORNETQ_TOPICS}
          - name: JGROUPS_CLUSTER_PASSWORD
            value: ${JGROUPS_CLUSTER_PASSWORD}
          image: ${APPLICATION_NAME}
          imagePullPolicy: Always
          livenessProbe:
            exec:
              command:
              - /bin/bash
              - -c
              - /opt/eap/bin/livenessProbe.sh
          name: ${APPLICATION_NAME}
          ports:
          - containerPort: 8778
            name: jolokia
            protocol: TCP
          - containerPort: 8080
            name: http
            protocol: TCP
          - containerPort: 8888
            name: ping
            protocol: TCP
          readinessProbe:
            exec:
              command:
              - /bin/bash
              - -c
              - /opt/eap/bin/readinessProbe.sh
        terminationGracePeriodSeconds: 60
    triggers:
    - imageChangeParams:
        automatic: true
        containerNames:
        - ${APPLICATION_NAME}
        from:
          kind: ImageStream
          name: ${APPLICATION_NAME}
      type: ImageChange
    - type: ConfigChange
parameters:
- description: The name for the application.
  name: APPLICATION_NAME
  required: true
  value: eap-app
- description: 'Custom hostname for http service route.  Leave blank for default hostname,
    e.g.: <application-name>-<project>.<default-domain-suffix>'
  name: HOSTNAME_HTTP
- description: Git source URI for application
  name: SOURCE_REPOSITORY_URL
  required: true
  value: https://github.com/jboss-developer/jboss-eap-quickstarts
- description: Git branch/tag reference
  name: SOURCE_REPOSITORY_REF
  value: 6.4.x
- description: Path within Git project to build; empty for root project directory.
  name: 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
  required: true
- description: GitHub trigger secret
  from: '[a-zA-Z0-9]{8}'
  generate: expression
  name: GITHUB_WEBHOOK_SECRET
  required: true
- description: Generic build trigger secret
  from: '[a-zA-Z0-9]{8}'
  generate: expression
  name: GENERIC_WEBHOOK_SECRET
  required: true
- description: Namespace in which the ImageStreams for Red Hat Middleware images are
    installed. These ImageStreams are normally installed in the openshift namespace.
    You should only need to modify this if you've installed the ImageStreams in a
    different namespace/project.
  name: IMAGE_STREAM_NAMESPACE
  required: true
  value: openshift
- description: JGroups cluster password
  from: '[a-zA-Z0-9]{8}'
  generate: expression
  name: JGROUPS_CLUSTER_PASSWORD
  required: true

Comment 3 Ben Parees 2016-07-18 20:16:26 UTC
i think this is a bug in the template, but i'm not sure why you're the first to hit it.  The API for deploymentconfigs says the From reference must be to an ImageStreamTag, not an ImageStream.

Also the error message is not good if it's trying to tell you "you used an ImageStream but you have to use an ImageStreamTag", so CCing Michalis.

Comment 4 Ben Parees 2016-07-18 20:21:25 UTC
actually i'm sending this to the platform team...  if this used to work, it needs to keep working.  (and if it's not going to work, the error message needs to make it clearer the it's the type of reference that is the problem, not the "eap-app" value.

Comment 5 Rob Cernich 2016-07-18 20:43:55 UTC
if this is something that needs to be fixed in the templates, which it appears it is, we should probably fix it quickly as we're rolling out updates this week and next.

Comment 6 Rob Cernich 2016-07-18 20:46:34 UTC
creating issue in CLOUD jira to track this.

Comment 7 Michail Kargakis 2016-07-19 15:41:49 UTC
The ImageStreamTag name needs to change and include the tag (":latest"). I would also suggest changing "ImageStream" to "ImageStreamTag". The error message is fixed in https://github.com/openshift/origin/pull/9925

Comment 8 Michail Kargakis 2016-07-19 16:00:24 UTC
Opened https://github.com/jboss-openshift/application-templates/pull/190 too

Comment 9 Ben Parees 2016-07-19 16:27:43 UTC
Michail, the ImageStream type needs to be supported, it was previously supported, which is why this template used to work.  There even exists conversion logic in deployments to convert an ImageStream type to an ImageStreamTag by appending :latest.

so we've broken api compatibility.

Comment 10 Michail Kargakis 2016-07-20 07:38:20 UTC
The correct value here is to have an "ImageStreamTag" but "ImageStream" will continue to work because we are defaulting unconditionally to "ImageStreamTag" in order to transform old data (remember https://github.com/openshift/origin/issues/2511 ?)

Comment 11 openshift-github-bot 2016-07-20 09:05:51 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/6b2111311cf3b3aa53a975b9f939a9277915d0d2
Bug 1357668: update error message on invalid tags in ICTs

Comment 12 Mike Fiedler 2016-07-20 11:19:05 UTC
Needs to be in MODIFIED until it is in a puddle

Comment 13 Ben Parees 2016-07-20 14:28:49 UTC
based on IRC discussion i think this needs to go back to assigned so the api-breaking new defaulting logic can be removed.

Comment 14 Michail Kargakis 2016-07-20 14:30:38 UTC
Fix is in the queue: https://github.com/openshift/origin/pull/9952

Comment 15 Ben Parees 2016-07-21 17:53:57 UTC
*** Bug 1358898 has been marked as a duplicate of this bug. ***

Comment 16 zhou ying 2016-08-01 05:26:12 UTC
Confirmed with aim :devenv-rhel7_4707,the issue has fixed.
openshift version
openshift v1.3.0-alpha.2+f6f7de3
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git


[root@ip-172-18-14-122 amd64]# oc new-app --template eap64-basic-s2i
--> Deploying template "eap64-basic-s2i" in project "openshift"

     eap64-basic-s2i
     ---------
     Application template for EAP 6 applications built using S2I.

     * With parameters:
        * APPLICATION_NAME=eap-app
        * HOSTNAME_HTTP=
        * SOURCE_REPOSITORY_URL=https://github.com/jboss-developer/jboss-eap-quickstarts
        * SOURCE_REPOSITORY_REF=6.4.x
        * CONTEXT_DIR=kitchensink
        * HORNETQ_QUEUES=
        * HORNETQ_TOPICS=
        * HORNETQ_CLUSTER_PASSWORD=gyuntw2n # generated
        * GITHUB_WEBHOOK_SECRET=smGkqICx # generated
        * GENERIC_WEBHOOK_SECRET=vKEprG2Y # generated
        * IMAGE_STREAM_NAMESPACE=openshift
        * JGROUPS_CLUSTER_PASSWORD=rLfRfI3R # generated
        * AUTO_DEPLOY_EXPLODED=false

--> Creating resources with label app=eap-app ...
    service "eap-app" created
    route "eap-app" created
    imagestream "eap-app" created
    buildconfig "eap-app" created
    deploymentconfig "eap-app" created
--> Success
    Build scheduled, use 'oc logs -f bc/eap-app' to track its progress.
    Run 'oc status' to view your app.

Comment 17 Troy Dawson 2016-08-03 20:26:32 UTC
This bug was verified against an origin build, not an OSE build.
This should be in OSE v3.3.0.14 and newer.

Comment 19 zhou ying 2016-08-04 04:52:05 UTC
Confirmed with ose3.3.0.14, the issue has fixed:
[root@zhouy testjson]# oc version
oc v3.3.0.14
kubernetes v1.3.0+57fb9ac
features: Basic-Auth GSSAPI Kerberos SPNEGO


OpenShift v3.3.0.14
Kubernetes v1.3.0+57fb9ac


[root@zhouy testjson]# oc new-app --template eap64-basic-s2i
--> Deploying template "eap64-basic-s2i" in project "openshift"

     eap64-basic-s2i
     ---------
     Application template for EAP 6 applications built using S2I.

     * With parameters:
        * APPLICATION_NAME=eap-app
        * HOSTNAME_HTTP=
        * SOURCE_REPOSITORY_URL=https://github.com/jboss-developer/jboss-eap-quickstarts
        * SOURCE_REPOSITORY_REF=6.4.x
        * CONTEXT_DIR=kitchensink
        * HORNETQ_QUEUES=
        * HORNETQ_TOPICS=
        * HORNETQ_CLUSTER_PASSWORD=Vaxbmn8e # generated
        * GITHUB_WEBHOOK_SECRET=fuQQ2REy # generated
        * GENERIC_WEBHOOK_SECRET=GdpJ77Ke # generated
        * IMAGE_STREAM_NAMESPACE=openshift
        * JGROUPS_CLUSTER_PASSWORD=o43v4exs # generated
        * AUTO_DEPLOY_EXPLODED=false

--> Creating resources with label app=eap-app ...
    service "eap-app" created
    route "eap-app" created
    imagestream "eap-app" created
    buildconfig "eap-app" created
    deploymentconfig "eap-app" created
--> Success
    Build scheduled, use 'oc logs -f bc/eap-app' to track its progress.
    Run 'oc status' to view your app.
[root@zhouy testjson]# oc get build
NAME        TYPE      FROM          STATUS     STARTED             DURATION
eap-app-1   Source    Git@8d9b0b3   Complete   About an hour ago   9m37s

Comment 21 errata-xmlrpc 2016-09-27 09:40:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1933


Note You need to log in before you can comment on or make changes to this bug.