Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用NameingServer作为注册中心,seata-sevre启动报错:vGroupMappingManager is NOT init #7015

Closed
1 task done
EdaZhang opened this issue Nov 19, 2024 · 4 comments · Fixed by #7025
Closed
1 task done
Labels
type: bug Category issues or prs related to bug.

Comments

@EdaZhang
Copy link

EdaZhang commented Nov 19, 2024

  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

使用NameingServer作为注册中心,seata-sevre启动报错:vGroupMappingManager is NOT init

Ⅱ. Describe what happened

image

Caused by: org.apache.seata.common.exception.ShouldNeverHappenException: vGroupMappingManager is NOT init!
	at org.apache.seata.server.session.SessionHolder.getRootVGroupMappingManager(SessionHolder.java:302)
	at org.apache.seata.server.controller.VGroupMappingController.init(VGroupMappingController.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
	... 18 common frames omitted

Ⅲ. Describe what you expected to happen

seata-server可以正常启动

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. 直接使用 apache/seata-server:2.2.0 镜像 (直接跑 github上的 2.2.0的源码都有这个问题)
  2. 直接使用 application.example.yml中的配置

Minimal yet complete reproducer code (or URL to code):

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • seata-server: apache/seata-server:2.2.0
@funky-eyes
Copy link
Contributor

store.mode是什么?

@EdaZhang
Copy link
Author

EdaZhang commented Nov 19, 2024

@funky-eyes 你好 db 模式和 file 模式我都试过 都不可以,报错的信息都是: vGroupMappingManager is NOT init!

db

我使用 apache/seata-server:2.2.0 的镜像 并挂载了mysql驱动,使用 dokcer compose 和以下配置方式启动

server:
  port: 7091

spring:
  application:
    name: seata-server

logging:
  config: classpath:logback-spring.xml
  file:
    path: /data/java/logs

console:
  user:
    username: seata
    password: seata
    
seata:
  config:
    type: file
  registry:
    type: seata
    seata:
      server-addr: 127.0.0.1:8081
      cluster: default
      namespace: public
      heartbeat-period: 5000
  store:
    mode: db
    db:
      datasource: druid
      db-type: mysql
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: aaa
      user: aaa
      password: aaa
      min-conn: 10
      max-conn: 100
      global-table: global_table
      branch-table: branch_table
      lock-table: lock_table
      distributed-lock-table: distributed_lock
      vgroup-table: vgroup_table
      query-limit: 1000
      max-wait: 5000
  metrics:
    enabled: false
    registry-type: compact
    exporter-list: prometheus
    exporter-prometheus-port: 9898
  security:
    secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
    tokenValidityInMilliseconds: 1800000
    csrf-ignore-urls: /metadata/v1/**
    ignore:
      urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.jpeg,/**/*.ico,/api/v1/auth/login,/version.json,/health,/error

file模式的配置

我在 github 下载 2.2.0 的源码后直接从 example.yml 中复制以下的配置启动 server依然报错

server:
  port: 7091

spring:
  application:
    name: seata-server

logging:
  config: classpath:logback-spring.xml
  file:
    path: ${log.home:${user.home}/logs/seata}
  extend:
    logstash-appender:
      destination: 127.0.0.1:4560
    kafka-appender:
      bootstrap-servers: 127.0.0.1:9092
      topic: logback_to_logstash

console:
  user:
    username: seata
    password: seata
seata:
  config:
    type: file
  registry:
    type: seata
    seata:
      server-addr: 127.0.0.1:8081
      cluster: default
      namespace: public
      heartbeat-period: 5000
  store:
    mode: file
  security:
    secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
    tokenValidityInMilliseconds: 1800000
    csrf-ignore-urls: /metadata/v1/**
    ignore:
      urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.jpeg,/**/*.ico,/api/v1/auth/login,/version.json,/health,/error,/vgroup/v1/**
      

@funky-eyes funky-eyes added the type: bug Category issues or prs related to bug. label Nov 19, 2024
@funky-eyes
Copy link
Contributor

这个bug存在,再namingserver合并后,被其他的pr影响了启动顺序,目前正在排查原因中(虽然修复的方法也比较简单)

@EdaZhang
Copy link
Author

@funky-eyes 想请教一下需要改下哪里? 不想引入其他的注册中心,如果修改起来简单的话,我想本地打个镜像先用着。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants