Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to push component created with beta3 version #1910

Closed
kadel opened this issue Jul 15, 2019 · 15 comments
Closed

unable to push component created with beta3 version #1910

kadel opened this issue Jul 15, 2019 · 15 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).

Comments

@kadel
Copy link
Member

kadel commented Jul 15, 2019

▶ cat .odo/config.yaml
kind: LocalConfig
apiversion: odo.openshift.io/v1alpha1
ComponentSettings:
  Type: java
  SourceLocation: ./
  SourceType: local
  Application: app
  Project: myproject
  Name: java-pfio

▶ odo push
 ✓  Creating project myproject
 ✓  Successfully created project myproject
Validation
 ✓  Validating component [5s]
 ✓  Checking component [116ms]

Configuration changes
 ✓  Initializing component
 ◑  Creating component ✗  Failed to create component with name java-pfio. Please use `odo config view` to view settings used to create component. Error: Service "java-pfio-app" is invalid: spec.ports: Required value
unable to create Service for java-pfio-app
github.com/openshift/odo/pkg/occlient.(*Client).CreateService
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/occlient/occlient.go:1253
github.com/openshift/odo/pkg/occlient.(*Client).BootstrapSupervisoredS2I
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/occlient/occlient.go:1207
github.com/openshift/odo/pkg/component.CreateFromPath
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:251
github.com/openshift/odo/pkg/component.CreateComponent
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:412
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).createCmpIfNotExistsAndApplyCmpConfig
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:84
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).Push
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:153
github.com/openshift/odo/pkg/odo/cli/component.(*PushOptions).Run
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:102
github.com/openshift/odo/pkg/odo/genericclioptions.GenericRun
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/genericclioptions/runnable.go:17
github.com/openshift/odo/pkg/odo/cli/component.NewCmdPush.func1
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:116
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:702
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).ExecuteC
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:783
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).Execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:736
main.main
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/cmd/odo/odo.go:65
runtime.main
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/proc.go:200
runtime.goexit
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/asm_amd64.s:1337
unable to create Service for java-pfio-app
github.com/openshift/odo/pkg/occlient.(*Client).BootstrapSupervisoredS2I
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/occlient/occlient.go:1209
github.com/openshift/odo/pkg/component.CreateFromPath
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:251
github.com/openshift/odo/pkg/component.CreateComponent
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:412
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).createCmpIfNotExistsAndApplyCmpConfig
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:84
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).Push
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:153
github.com/openshift/odo/pkg/odo/cli/component.(*PushOptions).Run
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:102
github.com/openshift/odo/pkg/odo/genericclioptions.GenericRun
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/genericclioptions/runnable.go:17
github.com/openshift/odo/pkg/odo/cli/component.NewCmdPush.func1
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:116
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:702
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).ExecuteC
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:783
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).Execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:736
main.main
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/cmd/odo/odo.go:65
runtime.main
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/proc.go:200
runtime.goexit
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/asm_amd64.s:1337
failed to create component with args {Name:java-pfio SourcePath:./ SourceRef: SourceType:local ImageName:java EnvVars:[] Ports:[] Resources:&ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},} ApplicationName:app Wait:false StorageToBeMounted:map[] StdOut:<nil>}
github.com/openshift/odo/pkg/component.CreateComponent
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:413
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).createCmpIfNotExistsAndApplyCmpConfig
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:84
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).Push
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:153
github.com/openshift/odo/pkg/odo/cli/component.(*PushOptions).Run
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:102
github.com/openshift/odo/pkg/odo/genericclioptions.GenericRun
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/genericclioptions/runnable.go:17
github.com/openshift/odo/pkg/odo/cli/component.NewCmdPush.func1
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:116
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:702
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).ExecuteC
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:783
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).Execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:736
main.main
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/cmd/odo/odo.go:65
runtime.main
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/proc.go:200
runtime.goexit
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/asm_amd64.s:1337

This is probably due to latest chnages in #1828

ping @surajnarwade

@surajnarwade
Copy link
Contributor

@kadel , can you point me to example java repo ?
because it works with nodejs and php for me

@surajnarwade
Copy link
Contributor

@kadel , your .odo/config.yaml doesn't have Ports section, how come ?
it should error out at odo create itself if there's no ports

@amitkrout
Copy link
Contributor

@kadel I am not able to reproduce this.

Steps i followed:

$ oc --request-timeout 5m import-image java --namespace=myproject --from=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift:1.5 --confirm

$ oc annotate istag/java:latest --namespace=myproject tags=builder --overwrite

$ odo component create java
 ✓  Validating component [69ms]
Please use `odo push` command to create the component with source deployed

$ odo push
Validation
 ✓  Validating component [81ms]
 ✓  Checking component [3ms]

Configuration changes
 ✓  Initializing component
 ✓  Creating component [220ms]
 ✓  Applying configuration [0s]

Pushing to component java-uspf of type local
 ✓  Waiting for component to start [7s]
 ✓  Copying files to component [21s]
 ✓  Building component [1m27s]
 ✓  Changes successfully pushed to component
$ cat .odo/config.yaml kind: LocalConfig
apiversion: odo.openshift.io/v1alpha1
ComponentSettings:
  Type: java
  SourceLocation: ./
  SourceType: local
  Application: app
  Project: myproject
  Name: java-uspf

@kadel Can please provide the detail steps

@kadel , your .odo/config.yaml doesn't have Ports section, how come ?
it should error out at odo create itself if there's no ports

@surajnarwade See the config file i pasted above. That also does not have the Port section.

@surajnarwade
Copy link
Contributor

/me on latest master

$ odo version
odo v1.0.0-beta3 (HEAD)

Server: https://192.168.42.230:8443
Kubernetes: v1.11.0+d4cacc0
 $ odo component create java
 ✓  Validating component [111ms]
Please use `odo push` command to create the component with source deployed

$ odo push
Validation
 ✓  Validating component [115ms]
 ✓  Checking component [2ms]

Configuration changes
 ✓  Initializing component
 ✓  Creating component [354ms]
 ✓  Applying configuration [16494ns]

Pushing to component java-ckfl of type local
 ✓  Waiting for component to start [2m]
 ✓  Copying files to component [3s]
 ✓  Building component [3m]
 ✓  Changes successfully pushed to component

@amitkrout I followed your steps for java s2i image here's my localconfig with ports

kind: LocalConfig
apiversion: odo.openshift.io/v1alpha1
ComponentSettings:
  Type: java
  SourceLocation: ./
  SourceType: local
  Ports:
  - 8080/TCP
  - 8443/TCP
  - 8778/TCP
  Application: app
  Project: myproject
  Name: java-ckfl

cc @amitkrout @kadel

@amitkrout
Copy link
Contributor

/me on latest master
@amitkrout I followed your steps for java s2i image here's my localconfig with ports

I tested it on beta-3 bits. Then the changes of port info in the config file is not the part of beta-3 releases.

@surajnarwade
Copy link
Contributor

surajnarwade commented Jul 16, 2019

@amitkrout because there's no release after my PR got merged

@kadel
Copy link
Member Author

kadel commented Jul 16, 2019

To reproduce the issue you have to create a component using beta3 and then run push using the latest master.

@kadel
Copy link
Member Author

kadel commented Jul 16, 2019

  • ./odo-darwin-amd64 is released beta3 version
  • odo is master build

push expects the ports to be in the local config, but the older version was not adding it when --port was not used.

▶ ./odo-darwin-amd64 version
odo v1.0.0-beta3 (c2b402e3)

Server: https://xxxxx
Kubernetes: v1.14.0+65ef059


▶ ./odo-darwin-amd64 create java
 ✓  Validating component [5s]
Please use `odo push` command to create the component with source deployed

▶ cat .odo/config.yaml
kind: LocalConfig
apiversion: odo.openshift.io/v1alpha1
ComponentSettings:
  Type: java
  SourceLocation: ./
  SourceType: local
  Application: app
  Project: default
  Name: java-xfaw

▶ odo version
odo v1.0.0-beta3 (a0c530b1)

Server: xxxx
Kubernetes: v1.14.0+65ef059


▶ odo push
Validation
 ✓  Validating component [5s]
 ✓  Checking component [113ms]

Configuration changes
 ✓  Initializing component
 ◑  Creating component ✗  Failed to create component with name java-xfaw. Please use `odo config view` to view settings used to create component. Error: Service "java-xfaw-app" is invalid: spec.ports: Required value
unable to create Service for java-xfaw-app
github.com/openshift/odo/pkg/occlient.(*Client).CreateService
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/occlient/occlient.go:1278
github.com/openshift/odo/pkg/occlient.(*Client).BootstrapSupervisoredS2I
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/occlient/occlient.go:1232
github.com/openshift/odo/pkg/component.CreateFromPath
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:251
github.com/openshift/odo/pkg/component.CreateComponent
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:412
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).createCmpIfNotExistsAndApplyCmpConfig
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:84
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).Push
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:153
github.com/openshift/odo/pkg/odo/cli/component.(*PushOptions).Run
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:102
github.com/openshift/odo/pkg/odo/genericclioptions.GenericRun
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/genericclioptions/runnable.go:17
github.com/openshift/odo/pkg/odo/cli/component.NewCmdPush.func1
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:116
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:702
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).ExecuteC
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:783
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).Execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:736
main.main
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/cmd/odo/odo.go:65
runtime.main
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/proc.go:200
runtime.goexit
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/asm_amd64.s:1337
unable to create Service for java-xfaw-app
github.com/openshift/odo/pkg/occlient.(*Client).BootstrapSupervisoredS2I
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/occlient/occlient.go:1234
github.com/openshift/odo/pkg/component.CreateFromPath
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:251
github.com/openshift/odo/pkg/component.CreateComponent
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:412
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).createCmpIfNotExistsAndApplyCmpConfig
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:84
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).Push
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:153
github.com/openshift/odo/pkg/odo/cli/component.(*PushOptions).Run
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:102
github.com/openshift/odo/pkg/odo/genericclioptions.GenericRun
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/genericclioptions/runnable.go:17
github.com/openshift/odo/pkg/odo/cli/component.NewCmdPush.func1
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:116
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:702
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).ExecuteC
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:783
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).Execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:736
main.main
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/cmd/odo/odo.go:65
runtime.main
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/proc.go:200
runtime.goexit
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/asm_amd64.s:1337
failed to create component with args {Name:java-xfaw SourcePath:./ SourceRef: SourceType:local ImageName:java EnvVars:[] Ports:[] Resources:&ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},} ApplicationName:app Wait:false StorageToBeMounted:map[] StdOut:<nil>}
github.com/openshift/odo/pkg/component.CreateComponent
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/component/component.go:413
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).createCmpIfNotExistsAndApplyCmpConfig
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:84
github.com/openshift/odo/pkg/odo/cli/component.(*CommonPushOptions).Push
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/common_push.go:153
github.com/openshift/odo/pkg/odo/cli/component.(*PushOptions).Run
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:102
github.com/openshift/odo/pkg/odo/genericclioptions.GenericRun
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/genericclioptions/runnable.go:17
github.com/openshift/odo/pkg/odo/cli/component.NewCmdPush.func1
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/pkg/odo/cli/component/push.go:116
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:702
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).ExecuteC
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:783
github.com/openshift/odo/vendor/github.com/spf13/cobra.(*Command).Execute
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/vendor/github.com/spf13/cobra/command.go:736
main.main
	/Users/tkral/Code/goenv/odo/src/github.com/openshift/odo/cmd/odo/odo.go:65
runtime.main
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/proc.go:200
runtime.goexit
	/usr/local/Cellar/go/1.12.5/libexec/src/runtime/asm_amd64.s:1337

▶

@kadel kadel added kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). labels Jul 16, 2019
@surajnarwade
Copy link
Contributor

@kadel , but things addressed in #1828 are expected right ?

  • odo create will look for ports in image and put it in localconfig and error out if there's no port
  • odo push should look for ports in localconfig instead of again making the API call

@kadel
Copy link
Member Author

kadel commented Jul 16, 2019

@kadel , but things addressed in #1828 are expected right ?

yes, overall what that PR is doing is right.
But we need to find a solution for this or document migration path.
Not breaking compatibility is always a better path.

What if odo push would lookup exposed image ports again if there are no ports specified in localconfig?

@surajnarwade
Copy link
Contributor

surajnarwade commented Jul 16, 2019

@kadel ,

odo create itself takes care, right it will error out if there's no port and ask user to provide ports

odo create java --port 8080

@surajnarwade
Copy link
Contributor

Though I agree with this 😺

Not breaking compatibility is always a better path.

@kadel
Copy link
Member Author

kadel commented Jul 16, 2019

odo create itself takes care, right it will error out if there's no port and ask the user to provide ports

the problem is that when the component was created with older odo versions (beta3 and older) push won't work.

@amitkrout
Copy link
Contributor

We need to include some upgrade path test in our test.

@girishramnani
Copy link
Contributor

adapter will be released with beta4 so we dont need to provide a upgrade path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
None yet
Development

No branches or pull requests

4 participants