Why Upgrading Dubbo 2.6 to 2.7 Can Trigger ‘No Provider’ Errors and How to Resolve Them
Upgrading a Dubbo consumer from 2.6.6 to 2.7.3 can break version matching with providers, leading to “No provider” errors, and the article explains the root cause, code differences, and why the 2.7.7 fix may still fail.
Problem Replay
A provider using Dubbo 2.6.6 declares its service version with <dubbo:provider version="1.0.0"/>, and a consumer (also 2.6.6) references it with matching version="1.0.0". After upgrading the consumer to Dubbo 2.7.3, the pre‑release test reports No provider errors.
Root Cause Analysis
The URL registered in Zookeeper looks like:
dubbo://10.0.0.6:20880/com.newboo.basic.api.SampleService?anyhost=true&application=ddog-provider-this-two&bind.ip=10.0.0.6&bind.port=20880&default.version=1.0.0&dubbo=2.0.2&generic=false&interface=com.newboo.basic.api.SampleService&methods=getByUid&owner=roshilikang&pid=82799&qos.accept.foreign.ip=true&qos.enable=true&side=provider×tamp=1616848403414The URL lacks a plain version parameter and only contains default.version. Dubbo matches services by comparing the version fields of provider and consumer URLs (see org.apache.dubbo.common.utils.UrlUtils.isMatch), so the missing version causes the mismatch.
In Dubbo 2.6.6, URL.getParameter(String key) falls back to default.{key} when the key is absent, allowing default.version to satisfy the version check. The method looks like:
public String getParameter(String key) {
String value = parameters.get(key);
if (value == null || value.length() == 0) {
value = parameters.get(Constants.DEFAULT_KEY_PREFIX + key);
}
return value;
}In Dubbo 2.7.3, the implementation is stricter:
public String getParameter(String key) {
return parameters.get(key);
}Thus, the consumer in 2.7.3 cannot find a version field and throws the error.
Attempted Fixes
An issue (https://github.com/apache/dubbo/issues/5948) notes that version matching was fixed in 2.7.7 by adding compatibility logic to URL.valueOf. However, debugging shows that not all URL objects are created via valueOf; subscription parsing uses URLStrParser.parseEncodedStr, so the fix does not apply to this scenario.
Consequently, even with Dubbo 2.7.7 the error persists.
Takeaway
When upgrading Dubbo, ensure that provider URLs expose a plain version parameter or that consumers are aligned to the same version‑handling logic. Otherwise, mismatched version fields will lead to “No provider” failures, especially for other fields like group or timeout that share the same compatibility issue.
Xiao Lou's Tech Notes
Backend technology sharing, architecture design, performance optimization, source code reading, troubleshooting, and pitfall practices
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
