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

Better error handling #15

Open
iperezx opened this issue Jul 19, 2022 · 7 comments
Open

Better error handling #15

iperezx opened this issue Jul 19, 2022 · 7 comments

Comments

@iperezx
Copy link

iperezx commented Jul 19, 2022

Can we get better error handling for this

logger.error(f"(get_certificates) error: {str(e)}")

I get this error:

2022-07-19 14:42:05,434  [registration-service:124] (ERROR): (get_certificates) error: Expecting value: line 1 column 1 (char 0)
@jswantek
Copy link
Contributor

Do you have some suggestions? What would you like to see?

@iperezx
Copy link
Author

iperezx commented Jul 19, 2022

I need to know on which part of the try section I am erroring out from:
https://github.com/waggle-sensor/waggle-bk-registration/blob/main/ROOTFS/usr/bin/waggle-bk-registration.py#L112-L121

Is it because I couldn't write_file for the public key, certificate, or private key? Or did I fail for request_node_info and why (for this case, I don't think I did, but let's just cover our bases).

@jswantek
Copy link
Contributor

go ahead and suggest a PR

@seanshahkarami
Copy link
Member

seanshahkarami commented Jul 19, 2022

I think I noticed the same problem when testing my beekeeper PR.

I found that it was caused by me accidentally adding some extra log messages to BK's register.sh which broke that the registration service expects to get JSON. (see this note)

What you probably want to indicate is that it's malformed JSON (or use logger.exception to see the full traceback.)

@iperezx
Copy link
Author

iperezx commented Jul 19, 2022

Thanks Sean. I have not modified anything that has not been tested on the dev docker-compose env. I think it might be the volume mounts.

I was working from latest, but I am going to fallback to v0.3.0 to isolate my issue.

You made this change: https://github.com/waggle-sensor/beekeeper/blob/main/bk-sshd/ROOTFS/opt/sage/beekeeper/register/register.sh#L41

How come you only check for certificate in the unit-test? https://github.com/waggle-sensor/beekeeper/blob/main/bk-api/test_bk_api.py#L47

You are doing a get next(https://github.com/waggle-sensor/beekeeper/blob/main/bk-api/test_bk_api.py#L49), but this is going to fail: https://github.com/waggle-sensor/waggle-bk-registration/blob/main/ROOTFS/usr/bin/waggle-bk-registration.py#L114-L120 when a new node registers with beekeeper.

@iperezx
Copy link
Author

iperezx commented Jul 19, 2022

@seanshahkarami
Copy link
Member

@iperezx Please let me know if this PR helps address some of this: waggle-sensor/beekeeper#27

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