Docker Issue in Spring Boot with Couchbase
I try to run my app as Spring Boot with Couchbase on Docker
Here is my docker-compose.yml
I already install couchbase in my local computer.
I got this error shown below
How can I fix it?
35 Replies
⌛
This post has been reserved for your question.
Hey @direct_x_34! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Can you show the full error message/stack trace?
What is your couchbase connection string?
Is that you? https://stackoverflow.com/q/79214286/10871900
Stack Overflow
Docker Connection Issue for Spring Boot with Couchbase
I want to run my app as Spring Boot with Couchbase in local and on Docker
Here is .env shown below
COUCHBASE_USERNAME=Administrator
COUCHBASE_PASSWORD=123456
COUCHBASE_BUCKET=todo_list
COUCHBASE_HO...
Yeah, you're right.
lol
Can you check these two things?
And can you show your
CouchbaseConfig
class?
The
This is expected if the there is no DNS SRV record associated with the hostname in the connection string. Will now try to bootstrap directly from the given hostname. To suppress this message, specify an IP address instead of a hostname (for example: 127.0.0.1 instead of localhost), specify more than one hostname, or set the io.enableDnsSrv
client setting to false.
is "just" a warning, the error is shown later
In what you shared in the SO post, it goes on with
Authentication Failure - Potential causes: invalid credentials or if LDAP is enabled ensure PLAIN SASL mechanism is exclusively used on the PasswordAuthenticator (insecure) or TLS is used (recommended) {"bucket":"todo_list","circuitBreaker":"DISABLED","coreId":"0x1450b18f00000001","remote":"couchbase:11210","status":"UNKNOWN","type":"KV","xerror":{"ref":"b96586b3-65ae-4b33-9d5e-abb73869e6f9"}} {"bucket":"todo_list","circuitBreaker":"DISABLED","coreId":"0x1450b18f00000001","remote":"couchbase:11210","type":"KV"}so it seems like a credential issue
you might want to check https://stackoverflow.com/q/45619687/10871900
Stack Overflow
couchbase java Authentication Failure issue
I have created json document 'test' inside couchbase bucket 'SAMPLE' which is remote .
URL for couchbase is http://testcouch.employee.com:8091/index.html
-- IP is 124.10.0.2
UserName for couch:
it could also be weird things like quotes in your password in some way: https://stackoverflow.com/a/70210245/10871900
Stack Overflow
Password masking only works for JDBC Connectors
We have set our Kafka Connect to be able to read credentials from a file, instead of giving them directly in connector config. This is how a login part of connector config looks like:
"conne...
I defined it but nothing changed.
I have no issue when I run it in local.
So it only happens when deploying it? How are you deploying it? Are you using Docker compose there as well?
As I said, the thing about DNS SRV seems to just be a warning
I use docker-compose
Also for deployment? So both the application and the DB are deployed on the same machine?
I try to run it on Docker.
With or without Docker compose (where the issue happens)
How do you run it on the device where the issue happens?
And I recommend checking the authentication/password - can you really authenticate to your production couchbase with the credentials used by the application?
As I said before, I can connect Couchbase in my local. The problem is related with not working Spring Boot with Couchbase on Docker.
Here is the result when I work with it in local @dan1st
Does it work with docker compose on your device?
It cannot run on Docker.
I'm unsure what you mean with "local" - does it mean "on your computer without Docker compose" or does it mean "on your computer with docker compose"?
Do you mean with Docker on your device?
And when saying Docker, I assume you are just running
docker-compose up
, right?I try to do the same thing in Docker.
meaning with or without Docker compose?
@dan1st With Docker. I have no problem when I work with local. Here are logs
I forgot to share this image
So the issue occurs when running with Docker on your local machine
How are you running it with Docker?
Can you show the full stack trace?
I think it might have an issue with the couchbase password...
Here is the full log?
I use the same password for Couchbase in both local and Docker part.
How are you specifying the password when running locally?
COUCHBASE_USERNAME=Administrator
COUCHBASE_PASSWORD=123456
COUCHBASE_BUCKET=todo_list
COUCHBASE_HOST=127.0.0.1
Here is my .env
I used it both in local and Docker
@dan1st
Do you mean a .env file or environment variables?
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
@dan1st This is .env file as you can see.
What is loading the .env file?
You have a .env file locally but not with Docker?
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.