Hi,
I'm using the Spring Cloud Config (Dalston.SR2) to use a git repo to get the application properties. All works fine till i try and use the /encrypt endpoint. With Dalston.SR2, the call to /encrypt ALWAYS comes back with a
{
"description": "No key was installed for encryption service",
"status": "NO_KEY"
}
I've made sure that the environment variable ENCRYPT_KEY is set properly.
If I change the version to Camden.SR5. The same configuration works fine and I can use both the /encrypt & /decrypt endpoints. I'm not sure if there's anything else that I need to do apart from
- Copy the JCE 8 files to
\jre\lib\security - Set the environment variable ENCRYPT_KEY
- Hit the /encrypt endpoint with a POST request
Here's a copy of my pom xml.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.photolove</groupId>
<artifactId>pl-config-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>pl-config-server</name>
<description>Application Config Server</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Dalston.SR2</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Any help is greatly appreciated. :-)
Cheers Kunal
Comment From: ryanjbaxter
Yes this is a known issue in Dalston.SR2. https://github.com/spring-cloud/spring-cloud-config/pull/760 You can either try Dalston.SR1 or Dalston.BUILD-SNAPSHOT. We will be releasing Dalston.SR3 shortly with the fix in it.
Comment From: jaurakunal
@ryanjbaxter Thanks for the tip :-)
Comment From: Fydon
@ryanjbaxter Was this fixed in Dalston.SR3, as I'm still receiving this error with that version?
Dalston.BUILD-SNAPSHOT is using Spring Cloud Config 1.3.3.BUILD-SNAPSHOT and I don't experiencing this problem with that version. There hasn't been a new release of Spring Cloud Config since Dalston.SR2.
Comment From: ryanjbaxter
@Fydon unfortunately we did not release spring cloud config for Dalston.SR3, it was a mistake on our part. The fix will be included in Dalston.SR4, sorry about that.
Comment From: Dr4K4n
just wanted to add that this is still an issue with Dalston.SR4. I've downgraded to Camden.SR7 for now. This also fixed another problem of mine. While using a keystore and {cipher}'d passwords, config server was returning the hash as the password, simply removing the {cipher} prefix.
Comment From: Fydon
@Dr4K4n This issue was fixed in Spring Cloud Config 1.3.3.BUILD-SNAPSHOT, which is now Spring Cloud Config v1.3.3.RELEASE, which is a part of Spring Cloud Dalston.SR4. Please try Dalston.SR4 again and see if you experience this issue.
Comment From: Dr4K4n
I've setup i little example project to illustrate the problem, simply build the application with maven und test with test.sh. On my machine it works with Dalston.SR4, but not with Camden.SR7. https://github.com/Dr4K4n/configserver-767
Comment From: Dr4K4n
I did some more testing with different Versions of Spring Cloud Config Working: 1.2.3 (Camden.SR7), 1.3.0, 1.3.1 (Dalston.SR1) Not Working: 1.3.2 (Dalston.SR2, Dalston.SR3), 1.3.3 (Dalston.SR4)
Comment From: Dr4K4n
I've further investigated, the underlying problem seems to be that the KeyProperties in EncryptionAutoConfiguration$DefaultTextEncryptorConfiguration are not read from my application.properties in the affected versions. Hope this info helps pinpointing the source of the problem, my knowledge ends here...
Comment From: spencergibb
Needs to be in bootstrap.properties
Comment From: mahg007
@spencergibb thanks.
Comment From: Nyamkhuub
if you write in the application yaml/properties, get this error. So, a simple solution is just creating bootstrap yaml/properties file.
Comment From: DonHamzovic
Hi everyone I have the same problem using java 11 and spring-cloud.version 2020.0.0-M5 is there any alternative version that works
Comment From: anikanchan
Try 20.0.0 for now.