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

API Server panics when Devfile Volume component has no ephemeral field set #7079

Closed
rm3l opened this issue Sep 8, 2023 · 0 comments · Fixed by #7080
Closed

API Server panics when Devfile Volume component has no ephemeral field set #7079

rm3l opened this issue Sep 8, 2023 · 0 comments · Fixed by #7080
Assignees
Labels
area/dev Issues or PRs related to `odo dev` area/Dev-UI Issues or PRs related to the odo dev Web UI, a.k.a Devfile Builder 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)).
Milestone

Comments

@rm3l
Copy link
Member

rm3l commented Sep 8, 2023

/kind bug
/area dev
/area Web-UI

What versions of software are you using?

Operating System:
Fedora 38, kernel 6.4.14-200.fc38.x86_64

Output of odo version:

odo v3.14.0 (56b868d16)

How did you run odo exactly?

odo init \
  --name java-wildfly \
  --devfile java-wildfly-bootable-jar \
  --devfile-registry DefaultDevfileRegistry \
  --starter microprofile-config

odo dev

Navigate to the Web UI.

Actual behavior

Web UI is not able to load the Devfile:
image

And looking at the odo dev logs, we can see the following stacktrace:

2023/09/08 11:19:07 http: panic serving 127.0.0.1:52286: runtime error: invalid memory address or nil pointer dereference                                                                      
goroutine 118 [running]:                                                                       
net/http.(*conn).serve.func1()                                                                 
        /home/asoro/.asdf/installs/golang/1.19.6/go/src/net/http/server.go:1850 +0xbf                                                                                                          
panic({0x3159380, 0x5b84b40})                                                                                                                                                                  
        /home/asoro/.asdf/installs/golang/1.19.6/go/src/runtime/panic.go:890 +0x262                                                                                                            
github.com/redhat-developer/odo/pkg/apiserver-impl/devstate.(*DevfileState).getVolumes(0xc00057e150?)
        /home/asoro/work/projects/odo/pkg/apiserver-impl/devstate/content.go:322 +0x17d                                                                                                        
github.com/redhat-developer/odo/pkg/apiserver-impl/devstate.(*DevfileState).GetContent(_)                                                                                                      
        /home/asoro/work/projects/odo/pkg/apiserver-impl/devstate/content.go:50 +0x1f3
github.com/redhat-developer/odo/pkg/apiserver-impl/devstate.(*DevfileState).SetDevfileContent(_, {_, _})
        /home/asoro/work/projects/odo/pkg/apiserver-impl/devstate/state.go:46 +0x35a                                                                                                           
github.com/redhat-developer/odo/pkg/apiserver-impl.(*DevstateApiService).DevstateDevfilePut(0xc000d80000?, {0x2f55ee0?, 0xc000ccd370?}, {{0xc000d80000?, 0x8?}})
        /home/asoro/work/projects/odo/pkg/apiserver-impl/devstate.go:274 +0x69
github.com/redhat-developer/odo/pkg/apiserver-gen/go.(*DevstateApiController).DevstateDevfilePut(0xc000c090f8, {0x47b6990, 0xc0009c41c0}, 0xc00015e500)
        /home/asoro/work/projects/odo/pkg/apiserver-gen/go/api_devstate.go:529 +0x1be
net/http.HandlerFunc.ServeHTTP(0x7f91a8eb8108?, {0x47b6990?, 0xc0009c41c0?}, 0x0?)
        /home/asoro/.asdf/installs/golang/1.19.6/go/src/net/http/server.go:2109 +0x2f
github.com/redhat-developer/odo/pkg/apiserver-gen/go.Logger.func1({0x47b6990, 0xc0009c41c0}, 0xc00015e500)
        /home/asoro/work/projects/odo/pkg/apiserver-gen/go/logger.go:23 +0x9e
net/http.HandlerFunc.ServeHTTP(0xc0001b7e00?, {0x47b6990?, 0xc0009c41c0?}, 0xc0004d19e0?)
        /home/asoro/.asdf/installs/golang/1.19.6/go/src/net/http/server.go:2109 +0x2f
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00041afc0, {0x47b6990, 0xc0009c41c0}, 0xc0009fe700)
        /home/asoro/work/projects/odo/vendor/github.com/gorilla/mux/mux.go:210 +0x1cf
net/http.serverHandler.ServeHTTP({0x47a3af0?}, {0x47b6990, 0xc0009c41c0}, 0xc0009fe700)
        /home/asoro/.asdf/installs/golang/1.19.6/go/src/net/http/server.go:2947 +0x30c
net/http.(*conn).serve(0xc000907b80, {0x47b86f8, 0xc000b16120})
        /home/asoro/.asdf/installs/golang/1.19.6/go/src/net/http/server.go:1991 +0x607
created by net/http.(*Server).Serve
        /home/asoro/.asdf/installs/golang/1.19.6/go/src/net/http/server.go:3102 +0x4db

Expected behavior

No panic ;-) And users should be able to use the Web UI against this Devfile.

Any logs, error output, etc?

@openshift-ci openshift-ci bot added kind/bug Categorizes issue or PR as related to a bug. area/dev Issues or PRs related to `odo dev` area/Dev-UI Issues or PRs related to the odo dev Web UI, a.k.a Devfile Builder labels Sep 8, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Sep 8, 2023
@rm3l rm3l removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Sep 8, 2023
@rm3l rm3l changed the title API Server panics when trying to serve java-wildfly Devfile API Server panics when trying to serve java-wildfly-bootable-jar Devfile Sep 8, 2023
@rm3l rm3l self-assigned this Sep 8, 2023
@rm3l rm3l moved this to In Progress 🚧 in odo Project Sep 8, 2023
@rm3l rm3l moved this from In Progress 🚧 to In Review 👀 in odo Project Sep 8, 2023
@rm3l rm3l added this to the v3.15.0 🚀 milestone Sep 8, 2023
@github-project-automation github-project-automation bot moved this from In Review 👀 to Done ✅ in odo Project Sep 8, 2023
@rm3l rm3l changed the title API Server panics when trying to serve java-wildfly-bootable-jar Devfile API Server panics when Devfile Volume component has no ephemeral field set Sep 9, 2023
@rm3l rm3l added the priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev Issues or PRs related to `odo dev` area/Dev-UI Issues or PRs related to the odo dev Web UI, a.k.a Devfile Builder 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
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant