oasisprotocol / oasisprotocol/oasis-core
Oasis Remote Signer doesn't terminate on user request
Open
Nobody has claimed this yet.
c:bug
- Dominant language
- Go
- Stars
- 369
- Forks
- 151
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
SUMMARY
The Oasis Remote Signer doesn't terminate when a user presses Ctrl+C.
ISSUE TYPE
- Bug Report
STEPS TO REPRODUCE
oasis-remote-signer-dev --datadir remote-signer --signer.backend composite --signer.composite.backends 1:file,2:file,3:file,4:plugin --signer.plugin.name ledger --signer.plugin.path $LEDGER_SIGNER_PATH --signer.plugin.config $LEDGER_SIGNER_CONF --client.certificate remote-signer/remote_signer_client_cert.pem --grpc.port $GRPC_PORT --log.level DEBUG
ACTUAL RESULTS
ts=2020-08-04T11:06:26.402136648Z level=debug module=oasis-node caller=common.go:104 msg="common initialization complete"
level=info module=grpc/remote-signer caller=grpc.go:463 ts=2020-08-04T11:06:29.455389578Z msg="starting gRPC server"
level=info module=grpc/remote-signer caller=grpc.go:478 ts=2020-08-04T11:06:29.455824949Z msg="gRPC server started" network=tcp address=:9187
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:06:49.67167788Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=3 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: [APDU_CODE_CONDITIONS_NOT_SATISFIED] Conditions of use not satisfied"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:07:48.610725764Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=5 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:07:50.132669536Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=6 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:07:52.289415885Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=7 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:07:55.499604365Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=8 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:07:59.704899139Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=9 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:08:06.267843171Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=10 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:08:13.868416696Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=11 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:08:26.086327334Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=12 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:08:36.894758435Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=13 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:08:48.534554436Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=14 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:09:22.792091064Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=15 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:09:50.452286607Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=16 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: hidapi: unknown failure"
^Cts=2020-08-04T11:10:28.980609579Z level=info module=remote-signer caller=service_manager.go:57 msg="user requested termination"
^C^Clevel=info module=grpc caller=log.go:30 ts=2020-08-04T11:15:20.092668718Z msg="transport: loopyWriter.run returning. connection error: desc = \"transport is closing\""
level=error module=grpc/remote-signer caller=grpc.go:202 ts=2020-08-04T11:34:34.961415213Z msg="request failed" method=/oasis-core.RemoteSigner/Sign req_seq=4 err="signature/signer/plugin: failed to sign: ledger: failed to sign message: ledger/oasis: failed to sign: Cannot deserialize the packet. Header information is missing."
level=warn module=grpc caller=logging.go:73 ts=2020-08-04T11:34:34.963486443Z msg="grpc: Server.processUnaryRPC failed to write status: connection error: desc = \"transport is closing\""
ts=2020-08-04T11:34:34.963597945Z level=debug module=remote-signer caller=service_manager.go:78 msg="begining cleanup"
ts=2020-08-04T11:34:34.963631829Z level=debug module=remote-signer caller=service_manager.go:81 msg="cleaning up" svc=grpc/remote-signer
ts=2020-08-04T11:34:34.963682316Z level=debug module=remote-signer caller=service_manager.go:87 msg="finished cleanup"
Note that Oasis Remote Signer only exited after unplugging the Ledger device.
EXPECTED RESULTS
The Oasis Remote Signer would terminate after a user pressed Ctrl+C (^C in the logs).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the remote signer's termination handling in service_manager.go and the gRPC remote-signer startup in grpc.go, then reproduce the issue with the oasis-remote-signer-dev command shown. Done means the process exits after one Ctrl+C without requiring the Ledger device to be unplugged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100