apache / apache/dubbo

dubbo使用元数据中心,zookeeper地址如果太长,会报错Failed to save service store file

Open
#12,302 4 comments 0 reactions 0 assignees View on GitHub
help wanted type/bug
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

dubbo:3.2.0版本
zookeeper地址使用k8s headless地址:data-zookeeper-0.zookeepers.platform.svc.cluster.local:2181,data-zookeeper-
1.zookeepers.platform.svc.cluster.local:2181,data-zookeeper-2.zookeepers.platform.svc.cluster.local:2181

报错日志
2023-05-15 14:41:14.311 [TID:N/A] [DubboSaveMetadataReport-thread-1] WARN o.a.d.m.s.z.ZookeeperMetadataReport:? - [DUBBO] Failed to save service store file, cause: File name too long, dubbo version: 3.2.0, current host: 100.64.0.4, error code: 0-12. This may be caused by , go to https://dubbo.apache.org/faq/0/12 to find instructions.
java.io.IOException: File name too long
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(File.java:1035)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport.doSaveProperties(AbstractMetadataReport.java:171)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport.access$100(AbstractMetadataReport.java:83)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport$SaveProperties.run(AbstractMetadataReport.java:267)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2023-05-15 14:41:14.311 [TID:N/A] [DubboSaveMetadataReport-thread-1] WARN o.a.d.m.s.z.ZookeeperMetadataReport:? - [DUBBO] Failed to save service store file, cause: File name too long, dubbo version: 3.2.0, current host: 100.64.0.4, error code: 0-12. This may be caused by , go to https://dubbo.apache.org/faq/0/12 to find instructions.
java.io.IOException: File name too long
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(File.java:1035)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport.doSaveProperties(AbstractMetadataReport.java:171)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport.access$100(AbstractMetadataReport.java:83)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport$SaveProperties.run(AbstractMetadataReport.java:267)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2023-05-15 14:41:14.311 [TID:N/A] [DubboSaveMetadataReport-thread-1] WARN o.a.d.m.s.z.ZookeeperMetadataReport:? - [DUBBO] Failed to save service store file, cause: File name too long, dubbo version: 3.2.0, current host: 100.64.0.4, error code: 0-12. This may be caused by , go to https://dubbo.apache.org/faq/0/12 to find instructions.
java.io.IOException: File name too long
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(File.java:1035)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport.doSaveProperties(AbstractMetadataReport.java:171)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport.access$100(AbstractMetadataReport.java:83)
at org.apache.dubbo.metadata.report.support.AbstractMetadataReport$SaveProperties.run(AbstractMetadataReport.java:267)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

Contributor guide

Open the contributing guide

Research direction

Start with AbstractMetadataReport.doSaveProperties, identified in the stack trace, and inspect how the metadata store file name is derived from the ZooKeeper address. Reproduce the issue with the long headless-service address shown here, then verify the metadata report no longer fails with a file-name-length error and that existing shorter addresses still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.