Skip to content

Unable to run start-build after restarting my server #1650

Closed

Description

@smarterclayton

I restarted my server after running a few builds, and now start-build is broken:

$ osc start-build ruby-sample-build
F0408 18:52:44.617205   24019 startbuild.go:41] Error received from API: build "ruby-sample-build-3" already exists

This should never happen

$ osc get bc -o yaml
apiVersion: v1beta1
creationTimestamp: null
items:
- apiVersion: v1beta1
  kind: BuildConfig
  lastVersion: 4
  metadata:
    creationTimestamp: 2015-04-08T16:48:25Z
    labels:
      name: ruby-sample-build
      template: application-template-stibuild
    name: ruby-sample-build
    namespace: default
    resourceVersion: "16430"
    selfLink: /osapi/v1beta1/buildConfigs/ruby-sample-build?namespace=default
    uid: 12eb6b3c-de0f-11e4-9cef-080027c5bfa9
  parameters:
    output:
      to:
        kind: ImageStream
        name: origin-ruby-sample
    source:
      git:
        uri: git://github.com/openshift/ruby-hello-world.git
      type: Git
    strategy:
      stiStrategy:
        builderImage: openshift/ruby-20-centos7
        image: openshift/ruby-20-centos7
      type: STI
  triggers:
  - github:
      secret: secret101
    type: github
  - generic:
      secret: secret101
    type: generic
  - imageChange:
      from:
        name: ruby-20-centos7
      image: openshift/ruby-20-centos7
      imageRepositoryRef:
        name: ruby-20-centos7
      lastTriggeredImageID: openshift/ruby-20-centos7:latest
      tag: latest
    type: imageChange
kind: List
resourceVersion: 16463
$ osc get builds -o yaml
apiVersion: v1beta1
creationTimestamp: null
items:
- apiVersion: v1beta1
  completionTimestamp: 2015-04-08T18:50:12Z
  config:
    kind: BuildConfig
    name: ruby-sample-build
    namespace: default
  kind: Build
  metadata:
    creationTimestamp: 2015-04-08T18:43:53Z
    labels:
      buildconfig: ruby-sample-build
      name: ruby-sample-build
      template: application-template-stibuild
    name: ruby-sample-build-3
    namespace: default
    resourceVersion: "16223"
    selfLink: /osapi/v1beta1/builds/ruby-sample-build-3?namespace=default
    uid: 34b7250c-de1f-11e4-aca4-080027c5bfa9
  parameters:
    output:
      dockerImageReference: 172.30.17.133:5000/default/origin-ruby-sample
      imageTag: default/origin-ruby-sample
      registry: 172.30.17.133:5000
      to:
        kind: ImageStream
        name: origin-ruby-sample
    source:
      git:
        uri: git://github.com/openshift/ruby-hello-world.git
      type: Git
    strategy:
      stiStrategy:
        builderImage: openshift/ruby-20-centos7:latest
        image: openshift/ruby-20-centos7:latest
      type: STI
  status: Failed
- apiVersion: v1beta1
  completionTimestamp: 2015-04-08T18:50:12Z
  config:
    kind: BuildConfig
    name: ruby-sample-build
    namespace: default
  kind: Build
  metadata:
    creationTimestamp: 2015-04-08T18:46:22Z
    labels:
      buildconfig: ruby-sample-build
      name: ruby-sample-build
      template: application-template-stibuild
    name: ruby-sample-build-4
    namespace: default
    resourceVersion: "16216"
    selfLink: /osapi/v1beta1/builds/ruby-sample-build-4?namespace=default
    uid: 8d553178-de1f-11e4-aca4-080027c5bfa9
  parameters:
    output:
      dockerImageReference: 172.30.17.133:5000/default/origin-ruby-sample
      imageTag: default/origin-ruby-sample
      registry: 172.30.17.133:5000
      to:
        kind: ImageStream
        name: origin-ruby-sample
    source:
      git:
        uri: git://github.com/openshift/ruby-hello-world.git
      type: Git
    strategy:
      stiStrategy:
        builderImage: openshift/ruby-20-centos7:latest
        image: openshift/ruby-20-centos7:latest
      type: STI
  status: Failed
kind: List
resourceVersion: 16492

Activity

  1. added this to the 0.5.0 (beta3) milestone on Apr 8, 2015
  2. added
    kind/bug
    on Apr 8, 2015
  3. assigned and unassigned on Apr 8, 2015
  4. bparees commented on Apr 8, 2015

    @bparees
    Contributor

    that's pretty odd since the BC specifically shows LastVersion=4.

  5. smarterclayton commented on Apr 8, 2015

    @smarterclayton
    ContributorAuthor

    Can a controller update that? It's possible the controller was still processing on restart when I ran the command (it shouldn't have failed to start the build though).

    ----- Original Message -----

    that's pretty odd since the BC specifically shows LastVersion=4.


    Reply to this email directly or view it on GitHub:
    #1650 (comment)

  6. bparees commented on Apr 8, 2015

    @bparees
    Contributor

    I don't think the controller should be updating it, it should be updated when we create the build which is now the responsibility of the instantiate/clone endpoint. but @soltysh is the expert here since that's all his new code.

    i guess i'm wondering if you'd run start-build a second time, what would have happened. (would it have gotten "5" as i'd expect? and if so, who got "4"?)

  7. brenton commented on Apr 20, 2015

    @brenton
    Contributor

    @bparees, did something land in master to address this? I'm not seeing this issue in the latest OSE builds.

  8. bparees commented on Apr 20, 2015

    @bparees
    Contributor

    we got some etcd fixes, maybe that helped?

  9. bparees commented on Apr 20, 2015

    @bparees
    Contributor

    otherwise no, nothing that i know of was specifically targeted at or changed this flow.

  10. smarterclayton commented on Apr 20, 2015

    @smarterclayton
    ContributorAuthor

    This might have been fixed by andy's change to the trigger.

    ----- Original Message -----

    otherwise no, nothing that i know of was specifically targeted at or changed
    this flow.


    Reply to this email directly or view it on GitHub:
    #1650 (comment)

  11. ncdc commented on Apr 20, 2015

    @ncdc
    Contributor

    My change to the trigger ensures that the From image stream matches on both namespace and name, defaulting the namespace to the bc's namespace if it's not specified. Without my fix, builds would be created endlessly if you have 2 streams with the same name but in different namespaces. I'm not sure it would fix this?

  12. bparees commented on Apr 20, 2015

    @bparees
    Contributor

    @smarterclayton you mean the image change controller fix? what @ncdc just said as i was writing this. :)

  13. smarterclayton commented on Apr 24, 2015

    @smarterclayton
    ContributorAuthor

    Closing based on unreproducibility

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

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions