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

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

Open
plam626 opened this issue Jun 10, 2020 · 6 comments

Comments

@plam626
Copy link

plam626 commented Jun 10, 2020

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)

@burke
Copy link
Member

burke commented Jun 11, 2020

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

@brigbay
Copy link

brigbay commented Jun 12, 2020

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

@plam626
Copy link
Author

plam626 commented Jun 12, 2020

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

@brigbay
Copy link

brigbay commented Jun 12, 2020

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.

@brigbay
Copy link

brigbay commented Jun 12, 2020

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

@plam626
Copy link
Author

plam626 commented Jun 12, 2020

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants