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

ExampleApp is loggin errors during start #235

Open
ds4tech opened this issue Mar 13, 2020 · 2 comments
Open

ExampleApp is loggin errors during start #235

ds4tech opened this issue Mar 13, 2020 · 2 comments

Comments

@ds4tech
Copy link

ds4tech commented Mar 13, 2020

When starting the container on Minikube, the ExampleApp logs errors

k logs exampleapp-8d69ff48d-nc4zp

[2020-03-13 09:37:04] INFO WEBrick 1.4.2
[2020-03-13 09:37:04] INFO ruby 2.6.2 (2019-03-13) [x86_64-linux]
[2020-03-13 09:37:04] INFO WEBrick::HTTPServer#start: pid=1 port=8080
2020-03-13 09:37:47 - NoMethodError - undefined method []' for nil:NilClass: /app/lib/service.rb:51:in block in class:ExampleApp'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1635:in call' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1635:in block in compile!'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:987:in block (3 levels) in route!' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1006:in route_eval'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:987:in block (2 levels) in route!' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1035:in block in process_route'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1033:in catch' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1033:in process_route'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:985:in block in route!' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:984:in each'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:984:in route!' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1097:in block in dispatch!'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1071:in block in invoke' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1071:in catch'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1071:in invoke' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1094:in dispatch!'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:919:in block in call!' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1071:in block in invoke'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1071:in catch' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:1071:in invoke'
/usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:919:in call!' /usr/local/bundle/gems/sinatra-2.0.7/lib/sinatra/base.rb:908:in call'
/usr/local/bundle/gems/rack-protection-2.0.7/lib/rack/protection/xss_header.rb:18:in call' /usr/local/bundle/gems/rack-protection-2.0.7/lib/rack/protection/path_traversal.rb:16:in call'
/usr/local/bundle/gems/rack-protection-2.0.7/lib/rack/protection/json_csrf.rb:26:in call' /usr/local/bundle/gems/rack-protection-2.0.7/lib/rack/protection/base.rb:50:in call'
/usr/local/bundle/gems/rack-protection-2.0.7/lib/rack/protection/base.rb:50:in call' /usr/local/bundle/gems/rack-protection-2.0.7/lib/rack/protection/frame_options.rb:31:in call'

@chunlongliang-ibm
Copy link

I got the same error. Have you solved the problem?

@ghost
Copy link

ghost commented Jan 5, 2021

I had the same issue. The easiest way to debug this issue is probably to logon to the pod and try to login with curl:

$ kubectl exec -it webapp-7779d565c-nsx4p -n vault -- sh

cat /run/secrets/kubernetes.io/serviceaccount/token

curl --request POST --data '{"jwt": "<YOUR_TOKEN>", "role": "webapp"}' http://vault:8200/v1/auth/kubernetes/login

And verify the error.

Another way to debug this is to add more debug code to the container. Just my 5 (euro) cent...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants