edgelesssys / edgelessdb

EdgelessDB is a MySQL-compatible database for confidential computing. It runs entirely inside a secure enclave and comes with advanced features for collaboration, recovery, and access control.
https://edgeless.systems/products/edgelessdb
GNU General Public License v2.0
170 stars 17 forks source link

Instructions how to debug edgelessdb? #54

Closed beejones closed 3 years ago

beejones commented 3 years ago

Hi,

Thanks your for your great project. I am trying to debug edgelessdb. Are there any instructions how to do this?

I tried the following: EDG_EDB_DEBUG=1 OE_SIMULATION=1 sudo docker run -t --name edb -p3306:3306 -p8080:8080 --privileged -e EDG_MARBLE_TYPE=edb -v /dev/sgx:/dev/sgx edb -marble

This gives the following error:

[erthost] loading enclave ... [erthost] entering enclave ... [PreMain] 2021/08/30 11:00:07 starting PreMain [PreMain] 2021/08/30 11:00:07 fetching env variables [PreMain] 2021/08/30 11:00:07 loading TLS Credentials [PreMain] 2021/08/30 11:00:07 loading UUID [PreMain] 2021/08/30 11:00:07 UUID not found. Generating and storing a new UUID [PreMain] 2021/08/30 11:00:07 generating CSR [PreMain] 2021/08/30 11:00:07 generating quote [PreMain] 2021/08/30 11:00:08 activating marble of type edb panic: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:2001: connect: connection refused"

It would be great to have a debugging page in edgelessdb. Thanks

Nirusu commented 3 years ago

Hey @beejones,

you are trying to run EdgelessDB in Marble mode, which assumes that you want to run EdgelessDB in a MarbleRun cluster. The issue you are having is that EdgelessDB cannot find a running MarbleRun coordinator upon launch (which it expects under the 127.0.0.1:2001 address).

I am not sure if running EdgelessDB as a Marble is actually your intention.

If you do not have MarbleRun running, just remove -marble from your command line, and EdgelessDB will run standalone.

If you have MarbleRun running, make sure the Coordinator networking port is exposed to the Docker environment. You might also need to provide additional configuration depending on your setup via Docker -e parameters, similar to EDG_MARBLE_TYPE.

This should already fix the issue, I guess.

Some notes regarding your question about debugging EdgelessDB:

The reason the debug option exists is that we do not want to expose potentially any information about the database structure to the host system, unless the deployment allows it. However, everything affected by the EDG_EDB_DEBUG happens after a manifest has been deployed. Before this, you mostly have to work with the error messages given to you (which honestly are pretty verbose except for a lack of a traceback, we do not sugarcoat them in a great fashion currently), or actually start debugging the code.

But yeah, in any case we are here to help! :)

beejones commented 3 years ago

Got it. Thanks.