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

failed to deploy uaa app to cloud foundry #783

Closed
rhinenoir opened this issue Mar 2, 2018 · 13 comments
Closed

failed to deploy uaa app to cloud foundry #783

rhinenoir opened this issue Mar 2, 2018 · 13 comments

Comments

@rhinenoir
Copy link

rhinenoir commented Mar 2, 2018

SECURITY NOTICE: If you have found a security problem in the UAA, please do not file a public github issue. Instead, please send an email to security@cloudfoundry.org

Thanks for taking the time to file an issue. You'll minimize back and forth and help us help you more effectively by answering all of the following questions as specifically and completely as you can.

What version of UAA are you running?

  • master branch the latest commit

What output do you see from curl <YOUR_UAA>/info -H'Accept: application/json'

  • FAILURE

How are you deploying the UAA?

I am deploying the UAA

  • deploy to cloudfoundry as web service

What did you do?

  • cf login -a api.run.pivotal.io
  • git clone git://github.com/cloudfoundry/uaa.git
  • cd uaa
  • ./gradlew :cloudfoundry-identity-uaa:war
  • cf push myuaarhine -m 1024M -p uaa/build/libs/cloudfoundry-identity-uaa-4.10.0.war --no-start
  • cf set-env myuaarhine SPRING_PROFILES_ACTIVE default
  • cf start myuaarhine
  • curl -H "Accept: application/json" myuaarhine.cfapps.io/login

What did you expect to see? What goal are you trying to achieve with the UAA?

  • expect to see like this:

{ "timestamp":"2014-09-15T18:25:04+0000", "app":{"version":"1.8.3"}, "commit_id":"git-metadata-not-found", "prompts":{"username":["text","Email"], "password":["password","Password"] } }

  • my goal is to create an admin account and enable diego_docker flag for a docker-base app

What did you see instead?

  • FAILURE

Please include UAA logs if available.

Sent from my PRO 6 using FastHub

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/155648641

The labels on this github issue will be updated when the story is started.

@jhamon
Copy link
Contributor

jhamon commented Mar 2, 2018

Can you share application logs from this crash?

@rhinenoir
Copy link
Author

@jhamon where are the log files?

@pbaletkeman
Copy link

@GARENFEATHER you can get to the logs by using the following command from the Cloud Foundry command line interface cf logs NameOfApp --recent. This will give you up to the last 150 lines of the log for that NameOfApp

Alternatively you can run cf logs NameOfApp while before and during the application request to get a live stream of the logs to get more log lines from your log

@raphaelschmitz
Copy link

raphaelschmitz commented Mar 15, 2018

Hi @letkemanpete78

I have the same problem:

(1)--recent logs:
2018-03-15T17:29:59.52+0100 [APP/PROC/WEB/0] OUT at java.lang.Thread.run(Thread.java:748)
2018-03-15T17:29:59.53+0100 [RTR/2] OUT uaa.cfapps.sap.hana.ondemand.com - [2018-03-15T16:29:29.532+0000] "GET /favicon.ico HTTP/1.1" 503 0 7 "https://uaa.cfapps.ondemand.com/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36" "10.0.72.0:51254" "10.0.138.29:65528" x_forwarded_for:"155.56.44.143, 10.0.72.0" x_forwarded_proto:"https" vcap_request_id:"0198a331-f383-4067-7785-5e3f589d326c" response_time:0.004803803 app_id:"b710ee17-2a73-4f42-adb9-0ed203ec6a15" app_index:"0" x_b3_traceid:"74e43b258bede6d5" x_b3_spanid:"74e43b258bede6d5" x_b3_parentspanid:"-"

(2) cf extended logs
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT [CONTAINER] .ContainerBase.[Catalina].[localhost].[/].[spring] SEVERE Servlet.service() for servlet [spring] in context with path [] threw exception
2018-03-15T17:42:48.50+0100 [RTR/7] OUT uaa.cfapps.sap.hana.ondemand.com - [2018-03-15T16:42:48.503+0000] "GET /favicon.ico HTTP/1.1" 503 0 7 "https://uaa.cfapps.sap.hana.ondemand.com/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36" "10.0.72.2:39772" "10.0.138.39:65528" x_forwarded_for:"155.56.44.143, 10.0.72.2" x_forwarded_proto:"https" vcap_request_id:"98bdae54-4d00-4df9-4de2-ee30caeb6891" response_time:0.003310761 app_id:"b710ee17-2a73-4f42-adb9-0ed203ec6a15" app_index:"0" x_b3_traceid:"da0a714ec80b0d55" x_b3_spanid:"da0a714ec80b0d55" x_b3_parentspanid:"-"
2018-03-15T17:42:48.50+0100 [RTR/7] OUT
2018-03-15T17:42:48.40+0100 [RTR/1] OUT uaa.cfapps.sap.hana.ondemand.com - [2018-03-15T16:42:48.400+0000] "GET /login HTTP/1.1" 503 0 7 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36" "10.0.72.2:55696" "10.0.138.39:65528" x_forwarded_for:"155.56.44.143, 10.0.72.2" x_forwarded_proto:"https" vcap_request_id:"8a4b23fd-df17-4f92-7e22-2194c1b1a4f5" response_time:0.003247943 app_id:"b710ee17-2a73-4f42-adb9-0ed203ec6a15" app_index:"0" x_b3_traceid:"1537f31cdf97bf49" x_b3_spanid:"1537f31cdf97bf49" x_b3_parentspanid:"-"
2018-03-15T17:42:48.40+0100 [RTR/1] OUT
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener or DispatcherServlet registered?
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:253)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:677)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
2018-03-15T17:42:48.40+0100 [APP/PROC/WEB/0] OUT at java.lang.Thread.run(Thread.java:748)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT [CONTAINER] .ContainerBase.[Catalina].[localhost].[/].[spring] SEVERE Servlet.service() for servlet [spring] in context with path [] threw exception
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener or DispatcherServlet registered?
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:253)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:677)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
2018-03-15T17:42:48.51+0100 [APP/PROC/WEB/0] OUT at java.lang.Thread.run(Thread.java:748)

I followed this procedure:
https://docs.cloudfoundry.org/concepts/architecture/uaa.html#custom-configuration

-> Deploy UAA to Cloud Foundry

best regards
Raphael

@pbaletkeman
Copy link

pbaletkeman commented Mar 15, 2018 via email

@raphaelschmitz
Copy link

HI @jhamon,

any updates or findings from your side?

best regards
Raphael

@pbaletkeman
Copy link

Sorry, I should clarify. I happened upon this and spoke up to let GARENFEATHER know how to get the logs.

I am experiencing an issue, but with a different UAA package which I'm going through on a training site.

@DennisDenuto
Copy link
Contributor

From the logs you attached it looks like your spring web context failed to initialize correctly. java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener or DispatcherServlet registered?

Can you follow the instructions from https://github.com/cloudfoundry/uaa#deploy-to-cloud-foundry?
A couple of points to keep in mind when following the above instructions:

  • Before pushing your app, please remember to update your uaa config with your database url + username + password.
  • Based on your log output, I think the command to generate your cf manifest will be: ./gradlew manifests -Dapp=uaa -Dapp-domain=cfapps.sap.hana.ondemand.com

@tnwang tnwang removed the accepted Accepted the issue label May 3, 2018
@rhinenoir
Copy link
Author

rhinenoir commented Jun 30, 2018

sorry for the too-late response @DennisDenuto
you said that I should update my uaa config with database url + username + password, which means an independent database is necessary for default UAA server?
should I start a db somewhere else and get related configs before pushing the UAA app?

@DennisDenuto
Copy link
Contributor

Hi @GARENFEATHER yup that should work.

@rhinenoir
Copy link
Author

rhinenoir commented Jun 30, 2018

@DennisDenuto I'm not deploying an independent db online.......
instead I tried running locally with correct mysql configs then got this

......
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:510)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:522)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
        at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:140)
        at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:101)
        at org.jacoco.agent.rt.internal_8ff85ea.PreMain.createRuntime(PreMain.java:55)
        at org.jacoco.agent.rt.internal_8ff85ea.PreMain.premain(PreMain.java:47)
        ... 6 more
Caused by: java.lang.NoSuchFieldException: $jacocoAccess
        at java.base/java.lang.Class.getField(Class.java:1958)
        at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
        ... 9 more
FATAL ERROR in native method: processing of -javaagent failed
Gradle Test Run :cloudfoundry-identity-client-lib:test took 3223ms
:cloudfoundry-identity-client-lib:test took 4118ms

reference: jacoco/jacoco#629
seems that jacoco didn't work well with my jdk10?

@shivansh
Copy link

shivansh commented Jul 30, 2019

From the logs you attached it looks like your spring web context failed to initialize correctly. java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener or DispatcherServlet registered?

Can you follow the instructions from https://github.com/cloudfoundry/uaa#deploy-to-cloud-foundry?
A couple of points to keep in mind when following the above instructions:

  • Before pushing your app, please remember to update your uaa config with your database url + username + password.
  • Based on your log output, I think the command to generate your cf manifest will be: ./gradlew manifests -Dapp=uaa -Dapp-domain=cfapps.sap.hana.ondemand.com

@DennisDenuto

I have a locally running postgresql instance (localhost:5432), and the corresponding db url in the manifest is jdbc:postgres://localhost:5432/postgres. However when deployed, the cloud foundry instance will look for postgres in it's own (VM) localhost instead of my system's localhost. The obvious fix for this will be to specify the url of a remotely deployed postgresql instance. Although just for curiosity, is there some way to make this work with a local db instance ?

For reference, our cf manifest is located here.

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

8 participants