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

导入polaris_server.sql 后启动服务失败,字段类型不兼容 #2

Open
pemako opened this issue Jul 18, 2023 · 5 comments
Open
Labels
question Further information is requested

Comments

@pemako
Copy link

pemako commented Jul 18, 2023

  • polaris 的版本 v1.17.2
  • store-postgresql main 最新代码
  • 存储配置内容如下
store:
  name: postgresqlStore
  option:
    master:
      dbType: "postgres"
      dbName: "polaris_server"
      dbUser: "mako"
      dbPwd: ""
      dbAddr: "127.0.0.1"
      dbPort: "5432"
      maxOpenConns: -1
      maxIdleConns: -1
      connMaxLifetime: 300 # Unit second
      txIsolationLevel: 2 #LevelReadCommitted
  • 启动服务的时候报错如下
[ERROR] register polaris service fail: store layer exception: getService err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported

# polaris-cache-error.log
2023-07-18T11:12:35.777051Z	error	cache	cache/service.go:192	[Cache][Service] update services err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported

# polaris-default-error.log
2023-07-18T11:12:35.776558Z	error	postgresql/service.go:1098	[Store][database] fetch service rows scan err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.776908Z	error	postgresql/service.go:864	[Store][database] call fetch service rows err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.776964Z	error	postgresql/service.go:755	[Store][database] get more service main err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.777004Z	error	postgresql/service.go:405	[Store][database] get more service+meta err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.785119Z	error	postgresql/service.go:1098	[Store][database] fetch service rows scan err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.786578Z	error	bootstrap/server.go:544	self register err: store layer exception: getService err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported

#  polaris-default.log
2023-07-18T11:12:35.640475Z	info	bootstrap/server.go:490	[Bootstrap] get local host: 127.0.0.1
2023-07-18T11:12:35.740330Z	info	postgresql/base_db.go:100	[Store][database] db set conn max life time: 300
2023-07-18T11:12:35.744784Z	info	postgresql/base_db.go:100	[Store][database] db set conn max life time: 300
2023-07-18T11:12:35.744840Z	info	postgresql/default.go:126	[Store][database] connect the database successfully
2023-07-18T11:12:35.744890Z	info	bootstrap/server.go:388	[Bootstrap] get bootstrap order config: map[key:sz open:true]
2023-07-18T11:12:35.744907Z	info	bootstrap/server.go:396	bootstrap start in order with key: sz
2023-07-18T11:12:35.746952Z	info	postgresql/transaction.go:67	[Store][database] get rand int: 730
2023-07-18T11:12:35.746991Z	info	postgresql/transaction.go:70	[Store][database] update start lock_id: 1, lock_key: sz, lock server: 127.0.0.1
2023-07-18T11:12:35.747517Z	info	bootstrap/server.go:429	lock bootstrap success
2023-07-18T11:12:35.756304Z	info	postgresql/admin.go:350	[Store][database] change from leader to follower (polaris.checker)
2023-07-18T11:12:35.756357Z	info	postgresql/admin.go:245	[Store][database] leader election started (polaris.checker)
2023-07-18T11:12:35.763291Z	info	job/job.go:68	[Maintain][Job] job (DeleteUnHealthyInstance) not enable
2023-07-18T11:12:35.763332Z	info	job/job.go:68	[Maintain][Job] job (DeleteEmptyAutoCreatedService) not enable
2023-07-18T11:12:35.764587Z	info	postgresql/admin.go:350	[Store][database] change from leader to follower (MaintainJob.CleanDeletedInstances)
2023-07-18T11:12:35.764642Z	info	postgresql/admin.go:245	[Store][database] leader election started (MaintainJob.CleanDeletedInstances)
2023-07-18T11:12:35.765352Z	info	postgresql/admin.go:350	[Store][database] change from leader to follower (MaintainJob.CleanDeletedClients)
2023-07-18T11:12:35.765397Z	info	postgresql/admin.go:245	[Store][database] leader election started (MaintainJob.CleanDeletedClients)
2023-07-18T11:12:35.776558Z	error	postgresql/service.go:1098	[Store][database] fetch service rows scan err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.776908Z	error	postgresql/service.go:864	[Store][database] call fetch service rows err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.776964Z	error	postgresql/service.go:755	[Store][database] get more service main err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.777004Z	error	postgresql/service.go:405	[Store][database] get more service+meta err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.777790Z	info	base/base_worker.go:105	[APICall] base stats need sleep 25s
2023-07-18T11:12:35.781996Z	info	base/base_worker.go:105	[APICall] base stats need sleep 25s
2023-07-18T11:12:35.782770Z	info	eurekaserver/server.go:254	[EUREKA] custom eureka parameters: map[]
2023-07-18T11:12:35.782830Z	info	eurekaserver/server.go:310	start EurekaServer
2023-07-18T11:12:35.785119Z	error	postgresql/service.go:1098	[Store][database] fetch service rows scan err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported
2023-07-18T11:12:35.786578Z	error	bootstrap/server.go:544	self register err: store layer exception: getService err: sql: Scan error on column index 11, name "ports": converting NULL to string is unsupported

# polaris-naming-error.log
2023-07-18T11:12:35.786290Z	error	naming	service/instance.go:147	[Instance] create service if absent fail : code:<value:500001 > info:<value:"store layer exception: getService err: sql: Scan error on column index 11, name \"ports\": converting NULL to string is unsupported" > , req : service:<value:"polaris.checker" > namespace:<value:"Polaris" > host:<value:"127.0.0.1" > port:<value:8091 > protocol:<value:"grpc" > version:<value:"v0.1.0" > enable_health_check:<value:true > health_check:<type:HEARTBEAT heartbeat:<ttl:<value:5 > > > isolate:<> metadata:<key:"build-revision" value:"v0.1.0" > metadata:<key:"polaris_service" value:"polaris.checker" > 

@pemako pemako added the question Further information is requested label Jul 18, 2023
@pemako
Copy link
Author

pemako commented Jul 18, 2023

对应的 healthcheck 配置的 checkers.name = heartbeatLeader 可以解决这个问题,使用 heartbeatMemory 时会导致上述的错误

@pemako pemako closed this as completed Jul 18, 2023
@chuntaojun chuntaojun reopened this Jul 18, 2023
@chuntaojun
Copy link
Collaborator

都应的 healthcheck 配置的 checkers.name = heartbeatLeader 可以解决这个问题,使用 heartbeatMemory 时会导致上述的错误

我理解这个确实是一个bug,不管怎么设置都不应该有这个报错

@pemako
Copy link
Author

pemako commented Jul 18, 2023

确实是有问题,重新测试了下无论 healthcheck.checkers.name 设置为 heartbeatLeader 还是 heartbeatMemory 都会导致服务启动不了。上面那次启动成功的示例复现不了了。

@bingxindan
Copy link
Collaborator

确实是有问题,重新测试了下无论 healthcheck.checkers.name 设置为 heartbeatLeader 还是 heartbeatMemory 都会导致服务启动不了。上面那次启动成功的示例复现不了了。

这是我的bug,已经修复好了,使用最新版的postgresql插件就可以了。谢谢您的反馈!

@bingxindan
Copy link
Collaborator

确实是有问题,重新测试了下无论 healthcheck.checkers.name 设置为 heartbeatLeader 还是 heartbeatMemory 都会导致服务启动不了。上面那次启动成功的示例复现不了了。

方便的话,可以加个微信,我快速帮您解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants