Skip to content

Runtime error when executing ../server/blob/master/examples/retrieval/app.rb  #63

Description

@plam626

When running the https://github.com/CovidShield/server/blob/master/examples/retrieval/app.rb against localhost or server deployed in AWS ECS, I got the following runtime error in both cases

Also, prior to this error, it appears RETRIEVE_HMAC_KEY needs to be assigned as a prerequisite. More documentation on setup requirements and troubleshooting would be appreciated, please. Thanks!

$ ruby app.rb
maybe fetching new keys
fetching new keys
Fetching period: 442168
Traceback (most recent call last):
6: from app.rb:143:in <main>' 5: from app.rb:44:in run'
4: from app.rb:64:in maybe_fetch_new_keys' 3: from app.rb:85:in fetch_new_keys'
2: from app.rb:85:in times' 1: from app.rb:87:in block in fetch_new_keys'
app.rb:101:in `fetch_period': failed (RuntimeError)

Activity

  1. burke commented on Jun 11, 2020

    @burke
    Member

    Ah, yes, I think I haven't updated this to reflect some recent protocol changes.

  2. brigbay commented on Jun 12, 2020

    @brigbay

    I have this fixed locally, should I push, or do you want me to share my fix for your review?

  3. plam626 commented on Jun 12, 2020

    @plam626
    Author

    Hi @brigbay, thank you for addressing the issue. I am open to either options. If you have confirmed the fix, I can pull your changes after you push to try. One of our developers has also figured out a solution to compare notes. Please see attached. Thanks!
    app.rb.txt

  4. brigbay commented on Jun 12, 2020

    @brigbay

    That's the change I shared with my co-worker, plam626, it cannot be submitted as is though as KEY_RETRIEVAL_URL has our internal server URL.
    If you want to run with that file, just revert to KEY_RETRIEVAL_URL = "http://127.0.0.1:8001"

    Changes I made are periods calculated based on PERIOD_HOURS = 6 instead of 2, and the Region MCC is included in message used to calculate hmac.

  5. brigbay commented on Jun 12, 2020

    @brigbay

    Incidentally, changes queud for #67 will render my 'period' fixes obsolete.

  6. plam626 commented on Jun 12, 2020

    @plam626
    Author

    Thanks and I appreciate the heads up on change #67. I had a discussion with my developer, too, as we saw the change. Apparently, the change will modify the URL by using ‘day’ instead of ‘period’, this also impacts hmac creation as message to hash was ‘region:period:currenttime’. I will use our fix until #67 is merged. Thanks again for your time and updates on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions