pivotal-cf / PCC-Sample-App-PizzaStore

Example sample application which uses Pivotal Cloud Cache(PCC) as a service on Pivotal Cloud Foundry
Apache License 2.0
19 stars 19 forks source link

IllegalStateException: No service with tags [cloudcache, gemfire] was found #9

Closed sarojraju closed 5 years ago

sarojraju commented 5 years ago

Error Log Below :

2019-01-24T09:05:55.87-0500 [CELL/0] OUT Cell e750e5e7-b64b-4303-90fb-87b993b1e102 successfully created container for instance 1a3d5c8f-cbca-4ca8-769f-46d0 2019-01-24T09:05:58.79-0500 [CELL/0] OUT Starting health monitoring of container 2019-01-24T09:05:59.16-0500 [APP/PROC/WEB/0] OUT JVM Memory Configuration: -Xmx375814K -Xss1M -XX:ReservedCodeCacheSize=240M -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=160761K 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT [error 2019/01/24 14:06:10.056 UTC

tid=0x1] Application run failed 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT java.lang.IllegalStateException: No service with tags [cloudcache, gemfire] was found 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalStateException(RuntimeExceptionFactory.java:91) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalStateException(RuntimeExceptionFactory.java:77) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.geode.core.env.VcapPropertySource.lambda$findFirstCloudCacheServiceName$21(VcapPropertySource.java:196) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at java.util.Optional.orElseThrow(Optional.java:290) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.geode.core.env.VcapPropertySource.findFirstCloudCacheServiceName(VcapPropertySource.java:195) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.geode.core.env.VcapPropertySource.findFirstCloudCacheService(VcapPropertySource.java:167) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.geode.boot.autoconfigure.ClientSecurityAutoConfiguration$AutoConfiguredCloudSecurityEnvironmentPostProcessor.configureSecurityContext(ClientSecurityAutoConfiguration.java:164) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at java.util.Optional.ifPresent(Optional.java:159) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.geode.boot.autoconfigure.ClientSecurityAutoConfiguration$AutoConfiguredCloudSecurityEnvironmentPostProcessor.postProcessEnvironment(ClientSecurityAutoConfiguration.java:108) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:185) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:171) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:338) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.SpringApplication.run(SpringApplication.java:297) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.SpringApplication.run(SpringApplication.java:1230) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at io.pivotal.cloudcache.app.CloudcachePizzaStoreApplication.main(CloudcachePizzaStoreApplication.java:37) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at java.lang.reflect.Method.invoke(Method.java:498) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) 2019-01-24T09:06:10.06-0500 [APP/PROC/WEB/0] OUT at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) 2019-01-24T09:06:10.25-0500 [APP/PROC/WEB/0] OUT Exit status 1

cf-gitbot commented 5 years ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

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

ebeer commented 5 years ago

Can you elaborate? Which version of PCC were you using and which PCF version? Also - did this error occur after the application was bound to a service instance?

sarojraju commented 5 years ago

Version : PCF 2.4.1, PCC 1.6.1 I have followed all the steps that provided here (https://github.com/pivotal-cf/PCC-Sample-App-PizzaStore)

I have create the requried service instance and bind the application and while startin the application "cf start APP_NAME", it failed with the error. I have attempted to restage/bind the apps few times but it failed all the time..Seems to be some missing environment variable which required for this apps to be running.

srikanthmanvi commented 5 years ago

@sarojraju Can you share the list of dependencies you are using in your app ?

sarojraju commented 5 years ago

Below dependencies before starting the application : 1) created p-cloudcache sevice and attached it with the application. 2) Connected to the service instance using gfsh and created the region named as Pizza and Name per the docs.

davidjahn commented 5 years ago

@sarojraju can you please share the exact command you used to create a PCC service instance? also the exact commands you used to bind and push the app. thanks

sarojraju commented 5 years ago

cf create-service p-cloudcache PLAN_NAME SERVICE_INSTANCE ./gradlew build cf push --no-start cf bind-service APP_NAME SERVICE_INSTANCE

cf create-service-key pcc_pizza pizza-service-key cf service-key pcc_pizza pizza-service-key

keytool -import -alias foundation -file PAS_CERTIFICATE.CER -keystore saroj-tl.truststore -storetype JKS export JAVA_ARGS="-Djavax.net.ssl.trustStore=/home/centos/GEMFIRE/saroj-tl.truststore"

gfsh connect --use-http=true --use-ssl --skip-ssl-validation=true --url=https://***************/gemfire/v1 --user=clusteroperator* --password=***

Enter to skip the next 9 steps and it will ended up with result as SUcessfully connected

gfsh>create region --name=Pizza --type=REPLICATE gfsh>create region --name=Name --type=REPLICATE cf start APP_NAME cf apps

srikanthmanvi commented 5 years ago

Can you please retry by first creating the service key and then binding the app ?

davidjahn commented 5 years ago

@sarojraju can you also please print the out put of cf env MYAPP??? be sure to remove creds. thanks

sarojraju commented 5 years ago

After following the steps to bind the application after creating the serviceky has resolved the issue.