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

BR: PiTR unable to communicate with PD(etcd) via TLS #38775

Closed
db-will opened this issue Oct 31, 2022 · 9 comments
Closed

BR: PiTR unable to communicate with PD(etcd) via TLS #38775

db-will opened this issue Oct 31, 2022 · 9 comments
Assignees
Labels
affects-6.5 affects-6.6 affects-7.0 component/br This issue is related to BR of TiDB. severity/major type/bug The issue is confirmed as a bug.

Comments

@db-will
Copy link
Contributor

db-will commented Oct 31, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use v6.2 br backup and restore data to new cluster

2. What did you expect to see? (Required)

should be able to restore data to new cluster successfully

3. What did you see instead (Required)

Detail BR log in /var/log/br.log Error: restore log from A_CURRENT_TIMESTAMP to A_PAST_TIMESTAMP, but the current existed log from A_PAST_TIMESTAMP to A_PAST_TIMESTAMP: [BR:Common:ErrInvalidArgument]invalid argument

A_PAST_TIMESTAMP are the same timestamp point

4. What is your TiDB version? (Required)

6.2

@db-will db-will added the type/bug The issue is confirmed as a bug. label Oct 31, 2022
@db-will
Copy link
Contributor Author

db-will commented Oct 31, 2022

@3pointer

@3pointer
Copy link
Contributor

3pointer commented Nov 1, 2022

The root cause is checkpoint didn't moving forward.

And the reason of checkpoint didn't moving forward is TiKV didn't start watch task thread.

{"level":"WARN","caller":"errors.rs:135","message":"backup stream meet error","time":"xxx","err":"during connecting to the etcd: Etcd meet error transport error: transport error","context":"failed to start watch tasks"}

we should keep retrying to start the watch threads and I think we need add some check before we start log backup via br. @joccau

@3pointer 3pointer added the component/br This issue is related to BR of TiDB. label Nov 1, 2022
@3pointer 3pointer assigned 3pointer and joccau and unassigned 3pointer Nov 1, 2022
@YuJuncen
Copy link
Contributor

YuJuncen commented Nov 9, 2022

Are you using the client key with SEC1 EC format? For now, tonic supports PKCS #8 and RSA keys only.

You can use the following command to transform the SEC-1 EC key into PKCS #8 key:

openssl pkcs8 -in $key -nocrypt -topk8 -out $key.pk8

And we can try to use the new generated key then.

@3pointer
Copy link
Contributor

3pointer commented Nov 9, 2022

Are you using the client key with SEC1 EC format? For now, tonic supports PKCS #8 and RSA keys only.

You can use the following command to transform the SEC-1 EC key into PKCS #8 key:

openssl pkcs8 -in $key -nocrypt -topk8 -out $key.pk8

And we can try to use the new generated key then.

please give more information about why tonic not support SEC1 EC keys

@3pointer 3pointer assigned YuJuncen and unassigned joccau Nov 9, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 labels Nov 9, 2022
@YuJuncen
Copy link
Contributor

YuJuncen commented Nov 10, 2022

@3pointer Generally, it seems ring doesn't support SEC1-formatted EC keys for now (briansmith/ring#1456 not yet merged), and rustls have made a workaround (Aha, which is almost exactly the openssl convert command did.), however it seems tonic doesn't utilize the workaround for now.

@3pointer
Copy link
Contributor

It's more like these four DNS names *.adhoc2-tidb-peer , *.adhoc2-ticdc-peer ,*.adhoc2-tikv-peer,*.adhoc2-pd-peer cause webpki checks failed. See the issue briansmith/webpki#265.

A workaround is remove these four names out of SAN in certificate.

@YuJuncen YuJuncen removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. labels Nov 28, 2022
@joccau
Copy link
Member

joccau commented Dec 12, 2022

/close

@ti-chi-bot
Copy link
Member

@joccau: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@3pointer 3pointer changed the title BR: PiTR failed to continue backup after tikv disconnect with PD BR: PiTR unable to communicate with PD(etcd) via TLS Jan 25, 2023
@3pointer 3pointer reopened this Jan 25, 2023
@3pointer
Copy link
Contributor

3pointer commented Jan 25, 2023

we will get the error when use CA-bundle certificated. this affects v6.5.0

[2023/01/25 10:30:25.271 +08:00] [WARN] [errors.rs:155] ["backup stream meet error"] [verbose_err="Etcd(GRpcStatus(Status { code: Unknown, message: \"transport error\", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Custom { kind: Other, error: \"error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:ssl/record/rec_layer_s3.c:1544:SSL alert number 42\" }))) }))"] [err="Etcd meet error grpc request error: status: Unknown, message: \"transport error\", details: [], metadata: MetadataMap { headers: {} }"] [context="failed to get backup stream task"]

ti-chi-bot pushed a commit to tikv/tikv that referenced this issue Feb 4, 2023
ti-chi-bot added a commit to tikv/tikv that referenced this issue Feb 6, 2023
ref #13867, ref #14081, ref pingcap/tidb#38775

Signed-off-by: 3pointer <luancheng@pingcap.com>
Signed-off-by: 3pointer <qdlc2010@gmail.com>

Co-authored-by: 3pointer <luancheng@pingcap.com>
Co-authored-by: 3pointer <qdlc2010@gmail.com>
Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
@jebter jebter closed this as completed Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 affects-6.6 affects-7.0 component/br This issue is related to BR of TiDB. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

8 participants