Hi there,
I use this dependency in my project:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-trace</artifactId>
</dependency>
With
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-dependencies</artifactId>
<version>1.2.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
But at runtime I have a zipkin class not found exception:
ava.lang.NoClassDefFoundError: zipkin2.Endpoint$Builder
at java.base/java.lang.invoke.MethodType.throwNoClassDefFoundError(MethodType.java:380)
at java.base/java.lang.invoke.MethodType.vmResolveFromMethodDescriptorString(MethodType.java:362)
at java.base/java.lang.invoke.MethodHandle.sendResolveMethodHandle(MethodHandle.java:1227)
at java.base/java.lang.invoke.MethodHandle.getCPMethodHandleAt(Native Method)
at java.base/java.lang.invoke.MethodHandle.resolveInvokeDynamic(MethodHandle.java:1074)
at io.lettuce.core.tracing.BraveTracing$Builder.<init>(BraveTracing.java:112)
at io.lettuce.core.tracing.BraveTracing$Builder.<init>(BraveTracing.java:106)
at io.lettuce.core.tracing.BraveTracing.builder(BraveTracing.java:98)
at org.springframework.cloud.sleuth.autoconfig.instrument.redis.LazyTracing.braveTracing(TraceLettuceClientResourcesBeanPostProcessor.java:133)
at org.springframework.cloud.sleuth.autoconfig.instrument.redis.LazyTracing.isEnabled(TraceLettuceClientResourcesBeanPostProcessor.java:112)
at io.lettuce.core.RedisChannelHandler.<init>(RedisChannelHandler.java:88)
at io.lettuce.core.StatefulRedisConnectionImpl.<init>(StatefulRedisConnectionImpl.java:76)
at io.lettuce.core.RedisClient.newStatefulRedisConnection(RedisClient.java:661)
at io.lettuce.core.RedisClient.connectStandaloneAsync(RedisClient.java:277)
at io.lettuce.core.RedisClient.connect(RedisClient.java:211)
at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:115)
at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider$$Lambda$1215.0000000040947880.get(Unknown Source)
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:115)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1459)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1247)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1230)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedReactiveConnection(LettuceConnectionFactory.java:989)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:445)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:98)
at org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator$$Lambda$1187.00000000409473B0.get(Unknown Source)
at reactor.core.publisher.MonoSupplier.call(MonoSupplier.java:85)
at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:227)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadP
LogstashMarkersJsonProvider
?
Hi all, I have a Spring Boot application that I've deployed to Google App Engine. I'm trying to configure it to use secrets stored in GCP Secret Manager. I've added spring-cloud-gcp-starter-secretmanager:2.0.0
to my project and added this property to my application.ymldatabase-name: ${sm://projects/<my-project>/secrets/db-name}
However I know the secret isn't getting resolved because when I deploy and run the app, I see this in the logsorg.postgresql.util.PSQLException: FATAL: database "//projects/<my-project>/secrets/db-name" does not exist
I don't see any output specific to secretmanager, so I can't tell if I've misconfigured something and secretmanager isn't even getting invoked, or if it is getting invoked, and simply can't resolve the secret. I'm using the default properties listed here: https://cloud.spring.io/spring-cloud-static/spring-cloud-gcp/current/reference/html/#configuration-10 and I've already verified that my GAE service account has the correct access to the secrets.
Anyone know what the output I'm seeing might indicate? Thanks in advance.
@meltsufin Thank you. I need to make a correction to my post above though. It turns out my secrets in application.yml are getting resolved just fine. However I should have stated that the following configuration is located in bootstrap.yml
database-name: ${sm://projects/<my-project>/secrets/db-name}
So it's the secret in bootstrap.yml that's not getting resolved. I would rather add this configuration to application.yml and then I suspect all would be well. The problem is when I add the spring-cloud-gcp-starter-secretmanager:2.0.0
dependency to my project, I get this error when I try to run:
java.lang.IllegalArgumentException: A database name must be provided.
It seems that it wants the spring.cloud.gcp.sql.database-name
property defined in bootstrap.yml. When I move that configuration there, the app runs again. However, it seems I can't resolve the secret in bootstrap.yml.
Any idea why it wants database-name
defined in bootstrap.yml? Thanks again
spring-cloud-gcp-starter-data-firestore
library using Gradle. I created a project using start.spring.io which seems to have included the correct dependency management config, but when I try to use Firestore classes (e.g. FirestoreTemplate
), none of them can be found. The entire com.google.cloud.spring.data
package can't be found at all.
@wjohnst3 -- Hey, unfortunately right now the best we can do for defaulting is related to environment variables: example.secret=${MY_ENV_VARIABLE:${sm://application-secret/latest}}
i.e. if MY_ENV_VARIABLE
is set, use that, else use the secret.
We can try to support your use-case though. So in this case, if sm://my-secrete
does not exist, you want to default to empty string?
hi, we just worked out all the terraform necessary to provision a spring cloud eureka server on GCP. anybody at google or elsewhere have a place where we could post a blog or guide on how to do this? wasn’t obvious.
I think GCP Community could be great place for something like this. See: https://cloud.google.com/community/tutorials/write
Hi all, I have an application that needs to read from a GCP Firestore (native mode) database. I would like to use Spring Data repositories, however the only Repository interface I'm able to find for native mode is FirestoreReactiveRepository
.
The problem is that my application is non-reactive and I need the ability to access another non-reactive relational db. When I try to add spring-boot-starter-data-jpa
to my project, I get the following error:Reactive Repositories are not supported by JPA. Offending repository is <MyRepositoryWhichExtendsFiretoreReactiveRepository>
Does anyone know of another way to use Spring Data Repositories with Firestore in native mode bedsides using FirestoreReactiveRepository
? Thanks in advance!
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project spring-cloud-gcp-storage: Compilation failure
[ERROR] /home/spencer/workspace/spring/spring-cloud-gcp/spring-cloud-gcp-storage/src/main/java/org/springframework/cloud/gcp/storage/integration/filters/GcsPersistentAcceptOnceFileListFilter.java:[31,8] org.springframework.cloud.gcp.storage.integration.filters.GcsPersistentAcceptOnceFileListFilter is not abstract and does not override abstract method isDirectory(com.google.cloud.storage.BlobInfo) in org.springframework.integration.file.filters.AbstractDirectoryAwareFileListFilter
org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration
Failing for the past 11 builds (Since Failed#1 )
Took 2 min 16 sec.
add description
Error Message
I/O error
Stacktrace
com.google.cloud.datastore.DatastoreException: I/O error
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)
Caused by: com.google.datastore.v1.client.DatastoreException: I/O error
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)