## 1900617 gateway error detail is not passed along in raised exception
# TEST CASE BIONIC 
Version tested - 0.2.1-1ubuntu0.18.04.1

1. use Bionic series lxc container
2. Enable proposed repo in /etc/apt/sources.list
3. deb http://archive.ubuntu.com/ubuntu focal-proposed main universe
4. sudo apt-get update
5. apt install etcd-client
6. apt-get install python-etcd3gw
7. wget 
https://github.com/etcd-io/etcd/releases/download/v3.3.13/etcd-v3.3.13-linux-amd64.tar.gz
8. tar -xvf etcd-v3.3.13-linux-amd64.tar.gz
9. openssl req -x509 -keyout localhost.key -newkey rsa:4096 -nodes -sha256 -out 
localhost.crt
10. ./etcd --name infra0 --data-dir infra0 --cert-file=/root/localhost.crt 
--key-file=/root/localhost.key --advertise-client-urls=https://127.0.0.1:2379 
--listen-client-urls=https://127.0.0.1:2379 --debug=true
11. etcdctl --endpoints https://127.0.0.1:2379 --ca-file=localhost.crt 
--cert-file=localhost.crt --key-file=localhost.key --debug --output extended 
user add root
12. etcdctl --endpoints https://127.0.0.1:2379 --ca-file=localhost.crt 
--cert-file=localhost.crt --key-file=localhost.key --debug --output extended 
auth enable
13. etcdctl --endpoints https://127.0.0.1:2379 --ca-file=localhost.crt 
--cert-file=localhost.crt --key-file=localhost.key --debug --output extended 
member list
14. root@bionic:~# etcdctl --endpoints https://127.0.0.1:2379 
--ca-file=localhost.crt --cert-file=localhost.crt --key-file=localhost.key 
--debug --output extended member remove 8e9e05c52164694d
start to sync cluster using endpoints(https://127.0.0.1:2379)
cURL Command: curl -X GET https://127.0.0.1:2379/v2/members
got endpoints(https://127.0.0.1:2379) after sync
Cluster-Endpoints: https://127.0.0.1:2379
cURL Command: curl -X GET https://127.0.0.1:2379/v2/members
cURL Command: curl -X DELETE https://127.0.0.1:2379/v2/members/8e9e05c52164694d
Received an error trying to remove member 8e9e05c52164694d: unexpected status 
code 401

The status code is what is being checked and send back to the console from code 
client.py
```
if resp.status_code != requests.codes['ok']:
raise exceptions.Etcd3Exception(resp.reason, resp.text)
```
If we're not a 200 response, then post the Exception to console.


VERIFICATION DONE
Exception response codes are posted to console.


Troubleshooting -
cURL Command: curl -X GET https://127.0.0.1:2379/v2/auth/roles/admin
cURL Command: curl -X PUT https://127.0.0.1:2379/v2/auth/roles/admin -d 
"{\"role\":\"admin\",\"permissions\":{\"kv\":{\"read\":null,\"write\":null}}}"
client: etcd cluster is unavailable or misconfigured; error #0: x509: cannot 
validate certificate for 127.0.0.1 because it doesn't contain any IP SANs

### add this to /etc/ssl/openssl.cnf
[ v3_ca ]
subjectAltName=IP:127.0.0.1

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1900617

Title:
  gateway error detail is not passed along in raised exception

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-etcd3gw/+bug/1900617/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to