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

metadata-report is not support a separate configuration password #9910

Closed
zhaoguhong opened this issue Apr 11, 2022 · 0 comments · Fixed by #9912
Closed

metadata-report is not support a separate configuration password #9910

zhaoguhong opened this issue Apr 11, 2022 · 0 comments · Fixed by #9912
Labels
type/bug Bugs to being fixed

Comments

@zhaoguhong
Copy link

zhaoguhong commented Apr 11, 2022

Environment

  • Dubbo version: 2.7.15
  • Operating System version: mac os 10.15.7
  • Java version: java 8

config

good

dubbo.metadata-report.address=redis://default:123456@11.6.0.4:6379

bad

dubbo.metadata-report.address=redis://11.6.0.4:6379
dubbo.metadata-report.username=default
dubbo.metadata-report.password=123456

error

Caused by: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.

How to Fix?

https://github.com/apache/dubbo/blob/3.0/dubbo-common/src/main/java/org/apache/dubbo/config/MetadataReportConfig.java

current

image

After Fix

    public URL toUrl() throws IllegalArgumentException {
        String address = this.getAddress();
        if (isEmpty(address)) {
            throw new IllegalArgumentException("The address of metadata report is invalid.");
        }
        Map<String, String> map = new HashMap<String, String>();
        URL url = URL.valueOf(address);
        // Issue : https://github.com/apache/dubbo/issues/6491
        // Append the parameters from address
        map.putAll(url.getParameters());
        // Append or overrides the properties as parameters
        appendParameters(map, this);
        // Normalize the parameters
        map.putAll(convert(map, null));
        // put the protocol of URL as the "metadata"
        map.put("metadata", url.getProtocol());
        return new URL("metadata",
            url.getUsername() == null ? this.getUsername() : url.getUsername(),
            url.getPassword() == null ? this.getPassword() : url.getPassword(),
            url.getHost(),
            url.getPort(this.getPort()),
            url.getPath(), map);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant