-
Notifications
You must be signed in to change notification settings - Fork 887
Agent logs are sometimes empty from api/v2/workspaceagents/<agent>/logs?follow&after=0 #10576
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
Comments
Well, the logs aren't in the database... |
That's peculiar. AFAIK we only delete logs if the agent hasn't connected for >7 days. 🤔 |
Yeah, my current suspicion is some agent problem where it doesn't send any... |
If this happens again, can you verify if there are script logs in |
Oh snap!, we're deleting them. My logs where there yesterday and I refreshed the page this morning and they're gone. |
We could also just retain latest build logs indefinitely, should fully solve the issue and is a simple query change. |
Unsure what the overhead is for this exactly and what our recommendation would be for large deployments with large scripts, but generally open to having these persisted. |
@bpmct, if we always keep the log from latest build, and retain the behavior that we otherwise keep logs for up to 7 days. I don't think this changes much in terms of recommendations for customers. Why? I believe it's fairly uncommon that workspaces are kept alive indefinitely. So once a workspace is stopped, the logs are eligible for deletion (after 7 days from start). There's another protection in place, too, currently we cut off the logs at 1 MB written to DB, so the logs won't grow indefinitely either. |
I think we should just notify the users that logs are gone, that seems fine to me. We could also always persist logs for the latest build, that doesn't seem too bad. |
This seems like the simplest option to me (easy win and doesn't require notifying the user). |
…14480) Related to #10576 This PR introduces quartz to coderd/database/dbpurge and updates the following unit tests to make use of Quartz's functionality: - TestPurge - TestDeleteOldWorkspaceAgentLogs Additionally, updates DeleteOldWorkspaceAgentLogs to replace the hard-coded interval with a parameter passed into the query. This aids in testing and brings us a step towards allowing operators to configure the cutoff interval for workspace agent logs.
#14460 should hopefully address this. |
Results in blank logs on Front End. Rebuilding generally seems to help.
The text was updated successfully, but these errors were encountered: