vault-guides
vault-guides copied to clipboard
ExampleApp is loggin errors during start
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'
I got the same error. Have you solved the problem?
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...