openshift / origin

Conformance test suite for OpenShift
http://www.openshift.org
Apache License 2.0
8.49k stars 4.7k forks source link

Error: Service "myphpapp" is invalid: spec.ports: required value when using STI #2231

Closed gshipley closed 9 years ago

gshipley commented 9 years ago

When using: https://raw.githubusercontent.com/openshift/origin/master/examples/image-streams/image-streams-centos7.json

for the image stream and trying to create a php application using: https://github.com/gshipley/simplephp.git

I get the above error.

gshipley commented 9 years ago
[gshipley@172 ~]$ osc new-app openshift/php-55-centos7 --code=https://github.com/gshipley/simplephp.git -o json --loglevel=5
I0513 23:04:58.740466   22423 newapp.go:105] No local Docker daemon detected: dial unix /var/run/docker.sock: no such file or directory
I0513 23:04:58.742540   22423 imagelookup.go:265] checking image stream openshift/php-55-centos7 with ref ""
I0513 23:04:58.759916   22423 imagelookup.go:130] checking Docker registry for "openshift/php-55-centos7"
I0513 23:04:58.759939   22423 client.go:207] Getting repository openshift/php-55-centos7 from {https  <nil> index.docker.io   }
I0513 23:04:59.355506   22423 imagelookup.go:148] found image: &docker.Image{ID:"a134784e02c4f6c08a47516c7dbee95276e961ab71a1e37239aae1c64a692b7b", Parent:"872cc6dcc2a8fbc495063e75432af2f61b6d199be93dd022c62e88d2d9e81b43", Comment:"", Created:time.Time{sec:63567129194, nsec:0x1d57bbe8, loc:(*time.Location)(0x2f303e0)}, Container:"", ContainerConfig:docker.Config{Hostname:"", Domainname:"", User:"", Memory:0, MemorySwap:0, CPUShares:0, CPUSet:"", AttachStdin:false, AttachStdout:false, AttachStderr:false, PortSpecs:[]string(nil), ExposedPorts:map[docker.Port]struct {}(nil), Tty:false, OpenStdin:false, StdinOnce:false, Env:[]string(nil), Cmd:[]string(nil), DNS:[]string(nil), Image:"", Volumes:map[string]struct {}(nil), VolumesFrom:"", WorkingDir:"", Entrypoint:[]string(nil), NetworkDisabled:false, SecurityOpts:[]string(nil), OnBuild:[]string(nil), Labels:map[string]string(nil)}, DockerVersion:"", Author:"Ben Parees <bparees@redhat.com>", Config:(*docker.Config)(0xc2082d5340), Architecture:"amd64", Size:194961781}
I0513 23:04:59.355880   22423 newapp.go:158] Image "openshift/php-55-centos7" is a builder, so a repository will be expected unless you also specify --build=docker
I0513 23:04:59.355895   22423 newapp.go:185] Using "https://github.com/gshipley/simplephp.git" as the source for build
I0513 23:04:59.355909   22423 newapp.go:359] Code [https://github.com/gshipley/simplephp.git]
I0513 23:04:59.355921   22423 newapp.go:360] Images [openshift/php-55-centos7]
I0513 23:04:59.355941   22423 newapp.go:283] found group: app.ComponentReferences{(*app.ComponentInput)(0xc20834af00)}
I0513 23:04:59.355953   22423 newapp.go:289] will use "openshift/php-55-centos7" as the base image for a source build of "https://github.com/gshipley/simplephp.git"
{
    "kind": "List",
    "creationTimestamp": null,
    "apiVersion": "v1beta1",
    "items": [
        {
            "kind": "Service",
            "id": "simplephp",
            "creationTimestamp": null,
            "apiVersion": "v1beta1",
            "port": 8080,
            "portName": "simplephp-tcp-8080",
            "protocol": "TCP",
            "containerPort": 8080,
            "selector": {
                "deploymentconfig": "simplephp"
            },
            "ports": [
                {
                    "name": "simplephp-tcp-8080",
                    "protocol": "TCP",
                    "port": 8080,
                    "containerPort": 8080
                }
            ]
        },
        {
            "kind": "ImageStream",
            "apiVersion": "v1beta1",
            "metadata": {
                "name": "simplephp",
                "creationTimestamp": null
            },
            "spec": {},
            "status": {
                "dockerImageRepository": ""
            }
        },
        {
            "kind": "BuildConfig",
            "apiVersion": "v1beta1",
            "metadata": {
                "name": "simplephp",
                "creationTimestamp": null
            },
            "triggers": [
                {
                    "type": "github",
                    "github": {
                        "secret": "H0_ozX6n8psbKwMjAQTi"
                    }
                },
                {
                    "type": "generic",
                    "generic": {
                        "secret": "9LZeZpgKxu7nPD6wDZn8"
                    }
                }
            ],
            "parameters": {
                "source": {
                    "type": "Git",
                    "git": {
                        "uri": "https://github.com/gshipley/simplephp.git"
                    }
                },
                "strategy": {
                    "type": "STI",
                    "stiStrategy": {
                        "builderImage": "openshift/php-55-centos7",
                        "image": "openshift/php-55-centos7",
                        "clean": true
                    }
                },
                "output": {
                    "to": {
                        "name": "simplephp"
                    }
                }
            }
        },
        {
            "kind": "DeploymentConfig",
            "apiVersion": "v1beta1",
            "metadata": {
                "name": "simplephp",
                "creationTimestamp": null
            },
            "triggers": [
                {
                    "type": "ConfigChange"
                },
                {
                    "type": "ImageChange",
                    "imageChangeParams": {
                        "automatic": true,
                        "containerNames": [
                            "simplephp"
                        ],
                        "from": {
                            "name": "simplephp"
                        },
                        "tag": "latest",
                        "lastTriggeredImage": ""
                    }
                }
            ],
            "template": {
                "strategy": {
                    "type": "Recreate"
                },
                "controllerTemplate": {
                    "replicas": 1,
                    "replicaSelector": {
                        "deploymentconfig": "simplephp"
                    },
                    "podTemplate": {
                        "desiredState": {
                            "manifest": {
                                "version": "v1beta2",
                                "id": "",
                                "volumes": null,
                                "containers": [
                                    {
                                        "name": "simplephp",
                                        "image": "library/simplephp:latest",
                                        "ports": [
                                            {
                                                "name": "simplephp-tcp-8080",
                                                "containerPort": 8080,
                                                "protocol": "TCP"
                                            }
                                        ],
                                        "resources": {},
                                        "imagePullPolicy": "",
                                        "capabilities": {}
                                    }
                                ],
                                "restartPolicy": {}
                            }
                        },
                        "labels": {
                            "deploymentconfig": "simplephp"
                        }
                    }
                }
            }
        }
    ]
}
smarterclayton commented 9 years ago

Hrm, can't reproduce this. Not sure why, the error is pretty clear cut. I wonder if we failed to load something the first time, but the second time it worked.

spadgett commented 9 years ago

@sspeiche Ran into this, too. See #2216

0xmichalis commented 9 years ago

@gshipley are you sure you are running on the latest master? I am not able to reproduce this as well and the line numbers of our logs differ:

$ osc new-app openshift/php-55-centos7 --code=https://github.com/gshipley/simplephp.git --loglevel=5
I0514 11:39:13.155099   13294 imagelookup.go:265] checking image stream openshift/php-55-centos7 with ref ""
I0514 11:39:13.189982   13294 templatelookup.go:28] checking template test/openshift/php-55-centos7
I0514 11:39:13.191864   13294 templatelookup.go:28] checking template openshift/openshift/php-55-centos7
I0514 11:39:13.193099   13294 templatelookup.go:28] checking template default/openshift/php-55-centos7
I0514 11:39:13.195027   13294 imagelookup.go:34] checking local Docker daemon for "openshift/php-55-centos7"
I0514 11:39:13.227758   13294 imagelookup.go:131] checking Docker registry for "openshift/php-55-centos7"
I0514 11:39:13.228764   13294 client.go:219] Getting repository openshift/php-55-centos7 from {https  <nil> index.docker.io   }
I0514 11:39:15.526917   13294 imagelookup.go:149] found image: &docker.Image{ID:"a134784e02c4f6c08a47516c7dbee95276e961ab71a1e37239aae1c64a692b7b", Parent:"872cc6dcc2a8fbc495063e75432af2f61b6d199be93dd022c62e88d2d9e81b43", Comment:"", Created:time.Time{sec:63567129194, nsec:492289000, loc:(*time.Location)(0x29aa9a0)}, Container:"", ContainerConfig:docker.Config{Hostname:"", Domainname:"", User:"", Memory:0, MemorySwap:0, CPUShares:0, CPUSet:"", AttachStdin:false, AttachStdout:false, AttachStderr:false, PortSpecs:[]string(nil), ExposedPorts:map[docker.Port]struct {}(nil), Tty:false, OpenStdin:false, StdinOnce:false, Env:[]string(nil), Cmd:[]string(nil), DNS:[]string(nil), Image:"", Volumes:map[string]struct {}(nil), VolumesFrom:"", WorkingDir:"", Entrypoint:[]string(nil), NetworkDisabled:false, SecurityOpts:[]string(nil), OnBuild:[]string(nil), Labels:map[string]string(nil)}, DockerVersion:"", Author:"Ben Parees <bparees@redhat.com>", Config:(*docker.Config)(0xc2086e0580), Architecture:"amd64", Size:194961781}
I0514 11:39:15.528602   13294 newapp.go:187] Image "openshift/php-55-centos7" is a builder, so a repository will be expected unless you also specify --build=docker
I0514 11:39:15.528753   13294 newapp.go:230] Using "https://github.com/gshipley/simplephp.git" as the source for build
I0514 11:39:15.528849   13294 newapp.go:441] Code [https://github.com/gshipley/simplephp.git]
I0514 11:39:15.528870   13294 newapp.go:442] Components openshift/php-55-centos7
I0514 11:39:15.529205   13294 newapp.go:327] found group: app.ComponentReferences{(*app.ComponentInput)(0xc208438720)}
I0514 11:39:15.529298   13294 newapp.go:335] will use "openshift/php-55-centos7" as the base image for a source build of "https://github.com/gshipley/simplephp.git"
imageStreams/php-55-centos7
imageStreams/simplephp
buildConfigs/simplephp
I0514 11:39:15.589692   13294 defaults.go:202] creating security context for container simplephp
I0514 11:39:15.590085   13294 defaults.go:207] downward merge of container.Capabilities for container simplephp
I0514 11:39:15.590330   13294 defaults.go:226] downward merge of container.Privileged for container simplephp
deploymentConfigs/simplephp
services/simplephp
A build was created - you can run `osc start-build simplephp` to start it.
Service "simplephp" created at 172.30.220.198 with port mappings 8080.
[vagrant@openshiftdev ruby]$ osc start-build simplephp
simplephp-1
0xmichalis commented 9 years ago

eg.

I0513 23:04:58.759916   22423 imagelookup.go:130] checking Docker registry for "openshift/php-55-centos7"

and

I0514 11:39:13.227758   13294 imagelookup.go:131] checking Docker registry for "openshift/php-55-centos7"