From f464aea1378b23236a1621277fb4e66c4f07721b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 25 Jan 2024 14:19:23 +0100 Subject: [PATCH] Manager & website: provide more helpful info when Worker auth fails Provide more useful info when a Worker tries to communicate but fails the authentication check. The message about this is now more friendly and links to a new FAQ entry at https://flamenco.blender.org/faq/#what-does-unknown-worker-is-trying-to-communicate-mean --- internal/manager/api_impl/worker_auth.go | 3 +- pkg/website/urls.go | 7 +++-- web/project-website/content/faq/_index.md | 30 +++++++++++++++++++ .../content/usage/upgrading/_index.md | 5 ++++ 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 web/project-website/content/usage/upgrading/_index.md diff --git a/internal/manager/api_impl/worker_auth.go b/internal/manager/api_impl/worker_auth.go index e8d4cdc3..bf6737a3 100644 --- a/internal/manager/api_impl/worker_auth.go +++ b/internal/manager/api_impl/worker_auth.go @@ -14,6 +14,7 @@ import ( "golang.org/x/crypto/bcrypt" "projects.blender.org/studio/flamenco/internal/manager/persistence" + "projects.blender.org/studio/flamenco/pkg/website" ) type workerContextKey string @@ -89,7 +90,7 @@ func WorkerAuth(ctx context.Context, authInfo *openapi3filter.AuthenticationInpu // Check the password. err = passwordHasher.CompareHashAndPassword([]byte(hashedSecret), []byte(p)) if err != nil { - logger.Warn().Str("username", u).Msg("authentication error") + logger.Warn().Str("worker", u).Msgf("unknown worker is trying to communicate, see %s", website.WorkerCredsUnknownHelpURL) return authInfo.NewError(errAuthBad) } diff --git a/pkg/website/urls.go b/pkg/website/urls.go index 142ed4a7..a8602014 100644 --- a/pkg/website/urls.go +++ b/pkg/website/urls.go @@ -3,7 +3,8 @@ package website const ( - DocVariablesURL = "https://flamenco.blender.org/usage/variables/blender/" - BugReportURL = "https://flamenco.blender.org/get-involved" - ShamanRequirementsURL = "https://flamenco.blender.org/usage/shared-storage/shaman/#requirements" + DocVariablesURL = "https://flamenco.blender.org/usage/variables/blender/" + WorkerCredsUnknownHelpURL = "https://flamenco.blender.org/faq/#what-does-unknown-worker-is-trying-to-communicate-mean" + BugReportURL = "https://flamenco.blender.org/get-involved" + ShamanRequirementsURL = "https://flamenco.blender.org/usage/shared-storage/shaman/#requirements" ) diff --git a/web/project-website/content/faq/_index.md b/web/project-website/content/faq/_index.md index 4b435254..098629e3 100644 --- a/web/project-website/content/faq/_index.md +++ b/web/project-website/content/faq/_index.md @@ -179,3 +179,33 @@ Disable add-ons one-by-one to see which one is causing this issue. It means that the program (probably Blender) exited with an error status. Take a look at the task log, which you can access by going to the task in Flamenco's web interface. + +### What does "unknown worker is trying to communicate" mean? + +When a Worker connects to its Manager for the first time, it registers itself. +This makes the Manager aware that the Worker exists. The Worker can now be seen +in the web interface for configuration of [tags][worker-tags] and its [sleep +schedule][sleep-schedule]. + +If for some reason the Manager forgets about this Worker, the Manager will show +this message. There are a few reasons this can happen: + +After downloading a new version of Flamenco, you started the Manager from a different folder than before. +: Stop the Manager (Ctrl+C) and follow the [upgrade guide][upgrade]. + +The `flamenco-manager.sqlite` file was deleted / moved. +: Stop the Manager (Ctrl+C). Restore the file from the wastebin, or move it back. Then start the Manager again. + +The Worker was deleted via the Flamenco Manager web interface. +: This means the Worker info (its tags, sleep schedule, etc.) has been deleted. Stop the Worker (Ctrl+C) and restart it again. It will automatically re-register as a new Worker. + + +[upgrade]: {{< ref "usage/upgrading" >}} +[worker-tags]: {{< ref "usage/worker-configuration/tags" >}} +[sleep-schedule]: {{< ref "usage/worker-configuration/sleep-schedule" >}} + +### What does "Security requirements failed" mean? + +This is shown on the Manager after an "unknown worker is trying to communicate" +message. It is also shown on the Worker for the same reason. See +[What does "unknown worker is trying to communicate" mean?](#what-does-unknown-worker-is-trying-to-communicate-mean) diff --git a/web/project-website/content/usage/upgrading/_index.md b/web/project-website/content/usage/upgrading/_index.md new file mode 100644 index 00000000..6a276726 --- /dev/null +++ b/web/project-website/content/usage/upgrading/_index.md @@ -0,0 +1,5 @@ +--- +title: Upgrading Flamenco +--- + +TODO: write this.