mongock / mongock

Lightweight Java based migration tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Majority read concern is not enabled

ibrahimyolbir opened this issue · comments

Description

I am getting the error message 'Majority read concern is not enabled.' even though I have majority enabled as below

application.yaml

  mongo-db:
    write-concern:
      w: majority
      w-timeout-ms: 300000
      journal: true
    read-concern: majority
    read-preference: primary

Fulloutput

{
   "@timestamp":"2022-11-30T07:50:36.557Z",
   "@version":"1",
   "message":"Registering converter from class java.time.LocalDateTime to class org.joda.time.LocalDateTime as 
reading converter although it doesn't convert from a store-supported type; You might want to check your annotation
 setup at the converter implementation",
   "logger_name":"org.springframework.data.convert.CustomConversions",
   "thread_name":"main",
   "level":"WARN",
   "level_value":30000
}{
   "@timestamp":"2022-11-30T07:50:37.098Z",
   "@version":"1",
   "message":"Exception encountered during context initialization - cancelling refresh attempt: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistSummaries': 
Invocation of init method failed; nested exception is org.springframework.data.mongodb.UncategorizedMongoDbException: 

Query failed with error code 148 with name 'ReadConcernMajorityNotEnabled' and error message 'Majority read concern is not
 enabled.' on server 10.253.11.5:27017; nested exception is com.mongodb.MongoQueryException: Query failed with error code
 148 with name 'ReadConcernMajorityNotEnabled' and error message 'Majority read concern is not enabled.' on server 
10.253.11.5:27017",
   "logger_name":"org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext",
   "thread_name":"main",
   "level":"WARN",
   "level_value":30000
} 

PRIORITY

CRITICAL

Version and environment

Mongock

  • Mongock version: 5.1.6
  • Spring Boot project
  • Using annotation approach

Environment

  • Framework and libraries versions. Especially those that affect directly to Mongock(Spring, Spring data, MongoDB driver, etc.)
  • Infrastructure: Kubernetes, Docker, SO, etc.

Steps to Reproduce

  1. Run application

Behaviour

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

How often the bug happens: [What percentage of the time does it reproduce?]
100%

Link to repository using Mongock

[While not mandatory, accessing to the real code that uses Mongock, would help to solve the issue]

Additional context

[Any additional information, logs, screenshots, configuration or data that might be necessary to reproduce or understand the issue]

Hello @ibrahimyolbir ,

that message is telling you that Majority read concern is not enable in your MongoDB server. Please take a look if this link can help you

@ibrahimyolbir , Did that link help you?

We decide to close this issue as we don't see any activity. Please reopen it if needed.