<p>I'm at a real loss on this one. I've been attempting to get my application running with a replica set in Kubernetes for awhile. I'm setting: <code>spring.data.mongodb.uri=${MYAPP_MONGODB}:mongodb://localhost:27017/myapp</code>
in <code>application.properties</code> and using Spring Data to access my objects. </p>

<p>Locally using a local MongoDB container it works fine even if I set the env var to my remote databases locally I can connect to them and work just fine. But when I put the value of MYAPP_MONGODB into k8s secrets when the container boots I get quoted error from the title. The value is like this:</p>

<p><code>mongodb://myuser:mypasswd@1.1.1.1:27017,2.2.2.2:27017,3.3.3.3:27017,4.4.4.4:27017,5.5.5.5:27017/myapp</code> </p>

<p>I <a href="https://github.com/spring-projects/spring-data-mongodb/blob/master/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SimpleMongoDbFactory.java#L88" rel="nofollow noreferrer">reviewed the source</a> and still baffled as to why this is happening. Pulling the secret from the k8s environment it is correct. </p>

<p>Any help is much appreciated!</p>

<p>It sounds like your secret in k8s might be setup incorrectly. I would try uploading your secrets again and decoding them to make sure they are correct. Careful for random line breaks :)</p>
