-
Notifications
You must be signed in to change notification settings - Fork 88
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
Weird agent to vault issue. #113
Comments
Thank you for reporting @Christiaan-Mathu. Which Kerberos Agent version are you using? |
No problem @cedricve, I have tried multiple versions and the problem still persists, am currently using the latest dev docker image (kerberos/agent-dev:latest) |
Can you run this version 384448d, as this resolved an issue with uploading and cleanup. |
Will do I will let you know if it fixes the problem, thanks in advance 😄 |
Oky the majority of the recording are now uploading but there are still some that struggle and saw in the logs that it's getting 500 response from the vault so I checked the vault logs and saw the following error:
|
Hi @cedricve, I have not enabled it its still disabled on the agents? |
Here is a sample of my agent with the secrets removed:
|
Hey @cedricve, I'll try to break down what I think is happening and please correct me if I'm mistaken. Here's what I think is going on: Connection Loss Issue: When the link between the agent and the vault breaks, video backups are queued up and can't be sent for uploading. Upload Sequence After Reconnection: Once the connection is reestablished, the system starts uploading videos from the backup. It processes the videos in the order they were created, starting with the oldest video. This sequence follows the upload file naming convention. Auto-Clean Interference: However, there's a problem. The system's auto-clean function sometimes deletes the video files that are being uploaded. This causes the upload to fail. Retrying After Failure: After a failed upload, the system waits for quite a while before attempting to upload the video again. A possible solution to this issue could involve modifying a specific loop in the system's code. The current loop structure reads all files in the directory for uploading, which can lead to conflicts with the auto-clean process. Here's a suggested alteration: Original Loop:
Proposed Solution:
In this proposed solution, the system would focus on one file at a time, mitigating the conflict with auto-cleaning. This could help ensure successful video uploads without the interference caused by the auto-clean function. Please let me know if this explanation aligns with your understanding or if there are any corrections needed. |
Thanks @Christiaan-Mathu for the explanation. So we did fix something in the latest release: https://github.com/kerberos-io/agent/blob/master/machinery/src/cloud/Cloud.go#L114-L141 Going into your previous comment, it actually tells that the video was recorded and recognised as a fragmented mp4.
|
However I do get your point. At the moment the upload failed due to network connectivity, we will "slow down" for x seconds (https://github.com/kerberos-io/agent/blob/master/machinery/src/cloud/Cloud.go#L136-L139) and try to upload the next one. On the next run we will check if the video is still available (https://github.com/kerberos-io/agent/blob/master/machinery/src/cloud/KerberosHub.go#L40-L48) and if not it will be marked as to be removedhttps://github.com/kerberos-io/agent/blob/master/machinery/src/cloud/Cloud.go#L131 |
Hi all, hope you are well.
I have set up our own agents, that looks like its running fine.
We also host our own vault on some of our servers.
I managed to get the agents to upload to the vault and everything looks fine but then after a while when there are a lot of events/videos in a short time the agents starts backing up and then after awhile they completely fail to upload new videos and the logs shows the following
Agent Log:
{"level":"info","msg":"UploadKerberosVault: Uploading to Kerberos Vault (https://ourVault.com/api)","time":"2023-08-10T08:20:06+02:00"} {"level":"info","msg":"UploadKerberosVault: Upload started for 1691532014_6-967003_Cam 1_200-200-400-400_276_769.mp4","time":"2023-08-10T08:20:06+02:00"} {"level":"info","msg":"UploadKerberosVault: Upload Failed, file doesn't exists anymore.","time":"2023-08-10T08:20:06+02:00"} {"level":"error","msg":"HandleUpload: UploadKerberosVault: Upload Failed, file doesn't exists anymore.","time":"2023-08-10T08:20:06+02:00"}
Please let me know if there is some more info I can give to try and narrow down what it happening 😄
The text was updated successfully, but these errors were encountered: