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

Document debugging #40

Open
davidak opened this issue May 8, 2022 · 0 comments
Open

Document debugging #40

davidak opened this issue May 8, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@davidak
Copy link
Contributor

davidak commented May 8, 2022

For example:

  • How to view the database?

It is a Bolt embedded key-value store using the bbolt implementation.

We have the CLI Browser for BoltDB files boltbrowser in nixpkgs. The database file does must not be locked to be able to open it, even in read-only mode.

So stop the services first:

systemctl stop trustix.socket

Now you can have a look at the database:

$ sudo nix run nixpkgs#boltbrowser -- -ro /var/lib/trustix/trustix.db

Screenshot from 2022-08-03 13-21-13

Screenshot from 2022-08-03 13-22-00

When you are ready, start the services again:

systemctl start trustix.service
systemctl start trustix-nix-cache.service
  • How to view a list of all log entries?

Use the database browser i guess.

  • How to view a single log entry?

/nix/store/sql7z5xkbmydnqinyp3brpp3m76vj13p-trustix-dev/bin/trustix query --key string

but where to get string

Doing it like in this test works:

https://github.com/tweag/trustix/blob/e89875c2a40588c7badeb52ec31ea23fa2e0c7b6/packages/trustix/tests/default.nix#L24-L40

I still don't know how i get from "/nix/store/hkgpl034l6c5zgzhks2dyp7p41z6qyc4-hello-2.12" to the key.

Why does it return a different value than the one i submitted? Isn't the purpose of a database to store values and not alter them?

  • How to test decide?
[davidak@gaming:~]$ sudo /nix/store/sql7z5xkbmydnqinyp3brpp3m76vj13p-trustix-dev/bin/trustix decide --protocol '5138a791-8d00-4182-96bc-f1f2688cdde2' --key '6574' --address unix:///run/trustix-daemon.socket --log-id *****
[sudo] password for davidak: 
DEBU[0000] Dialing remote                                address="unix:///run/trustix-daemon.socket"
DEBU[0000] Requesting output mappings for                key=6574
FATA[0000] could not decide: rpc error: code = Unknown desc = No decider configured for protocol '5138a791-8d00-4182-96bc-f1f2688cdde2'
@adisbladis adisbladis added this to the 1.0 milestone Aug 11, 2022
@adisbladis adisbladis modified the milestones: 1.0, 2024 Q1 Nov 6, 2023
@adisbladis adisbladis added the documentation Improvements or additions to documentation label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants