I have a couchbase server on an AWS EC2 instance, and I have a Golang app connected to it deployed on Elastic Beanstalk. My queries ran successfully (from the sdk), and returns the right data when called (from the golang api). I manually ran a Delete query from couchbase web admin, and I populated data again (from a seed method in the Go app). When I try the endpoints again it returns null
NB: I have a local server (same Go app), and I tried the endpoint again, this time connecting my Local Go app to the remote database, and the query works, it returns the data as expected.
Why isn’t it returning from the live app?
PS: Both local and live Go apps are on same version:
Both run the same set of queries: SELECT * FROM bucketname AS contents WHERE type = 'content'
I had restarted both the couchbase server, and my app’s server and waited over an hour, still no changes, what could be the cause of this?
@vsr1 I made the change, it didn’t work. Data returned is still null. Here’s the code I’m using to fetch data from couchbase:
query := gocb.NewN1qlQuery("SELECT * FROM bucketname AS contents WHERE type = 'content' ")
query.Consistency(gocb.RequestPlus)
rows, err := Bucket.ExecuteN1qlQuery(query, nil)
The most common problem we see in golang is not checking err. If you’re definitely doing that, then I might recommend setting up the verbose logger if possible and perhaps we can spot something.
One suspicion I have is perhaps there’s something about bootstrap with the beanstalk env. I don’t know that for sure-- I’m hoping the logging will give us more info.
Thanks @ingenthr I was able to figure out the cause, your suspicion was valid, Elastic Beanstalk wasn’t updating the container I had made the changes to the code to. I had to manually upload the config and updated the version number.
Glad you figured it out! If you have another moment, I’d be curious… was the logging helpful to this end, or did you have to dive in further with other diagnosis?
The answer might help the next person who lands on this thread from a search.
I wasn’t able to use the log package (go get couldn’t find it), What I did was update my queries to set consistency - query.Consistency(gocb.RequestPlus) and redeployed to Elastic Beanstalk