GithubHelp home page GithubHelp logo

Comments (8)

cbiedl avatar cbiedl commented on July 29, 2024

Strike that, I missed the fact the dependencies have been reworked in commit 7778512
So I'll have to re-check why this still happens.

from tang.

sergio-correia avatar sergio-correia commented on July 29, 2024

Strike that, I missed the fact the dependencies have been reworked in commit 7778512
So I'll have to re-check why this still happens.

Did you have that commit in your build? It's not part of any release, so it's likely you don't have it applied there.

from tang.

cbiedl avatar cbiedl commented on July 29, 2024

Yeah, I realized too late this bug report was based on the latest release. However, it still happens if I include that commit, so it's certainly still an issue. At the moment however I'm stuck figuring what triggers tangd-update invocation now. It does happen, but why?

from tang.

sergio-correia avatar sergio-correia commented on July 29, 2024

Could you try #53 and report back, please?

from tang.

cbiedl avatar cbiedl commented on July 29, 2024

Will do in a moment, just want to share the analysis I did:

Starting with @jwkdir@ and @cachedir@ empty.

Requesting an advertisement using

echo foo | clevis encrypt tang '{"url": "http://<tang-server>/"}' > bar.txt

which results in an error:

Unable to fetch advertisement: 'http://<tang-server>/adv/'!

This is the output of "journalctl -o short-precise", with timestamps of the created files merged, ordered by time.

Nov 28 11:38:25.272465 freekeh systemd[1]: Starting Tang Server key generation script...

-rw-r--r-- 1 root root 354 2020-11-28 11:38:25.401147740 +0100 @dbdir@/OCWpHA3_4-E9mUpyW_0N3-Crcoc.jwk

Nov 28 11:38:25.457995 freekeh systemd[1]: Starting Tang Server key update script...

So update is started ...

-rw-r--r-- 1 root root 349 2020-11-28 11:38:25.531138284 +0100 @dbdir@/tPfTOakfqz0qMjjloGn6v989ttc.jwk

... before keygen finished the job. Also, update will ignore the second .jwk (not shown here)

Nov 28 11:38:25.557283 freekeh systemd[1]: tangd-keygen.service: Succeeded.
Nov 28 11:38:25.575785 freekeh systemd[1]: Started Tang Server key generation script.
Nov 28 11:38:25.597302 freekeh systemd[1]: Started Tang Server (<client>:54812).

And now the server is started although update is still running.

Nov 28 11:38:25.630481 freekeh tangd[2709]: <client> GET /adv/ => 404 (src/tangd.c:70)

... hence the 404

Nov 28 11:38:25.639115 freekeh systemd[1]: tangd@1-<server>:80-<client>:54812.service: Succeeded.

-rw-r--r-- 1 root root 618 2020-11-28 11:38:25.761121554 +0100 @cachedir@/default.jws

The update script needed 180ms to parse the .jwk and create the first .jws. This is the earliest moment where the server may be run. But to be safe, this should rather happen after update finished the job which took ...

(...)
lrwxrwxrwx 1 root root  44 2020-11-28 11:38:28.280938310 +0100 @cachedir@/MQHhVWoc4arWBQYK1wHf69l4dnXsX7fC2nZ7JAem1-3zyU53bUBjcOqtMCaB8WFRrvXX6g9pSz2AcgWRpWMAbw.jwk -> @dbdir@/tPfTOakfqz0qMjjloGn6v989ttc.jwk

... another 2520ms.

Nov 28 11:38:28.558664 freekeh systemd[1]: tangd-update.service: Succeeded.
Nov 28 11:38:28.561176 freekeh systemd[1]: Started Tang Server key update script.

So far I'm not convinced using the systemd semantics to resolve dependencies are the best idea.

from tang.

cbiedl avatar cbiedl commented on July 29, 2024

from tang.

sergio-correia avatar sergio-correia commented on July 29, 2024

@cbiedl: can close this, now that #53 has been merged?

from tang.

cbiedl avatar cbiedl commented on July 29, 2024

ACK, none of this still applies.

from tang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.