From 06e2b077a1a64951574bf5b22ecc906c3df71da5 Mon Sep 17 00:00:00 2001 From: Gudmundur Orn Johannsson Date: Mon, 29 Aug 2022 20:18:30 +0300 Subject: [PATCH 1/3] Limit the length of errors that get written to the database Signed-off-by: Gudmundur Orn Johannsson --- .changeset/spotty-points-build.md | 6 ++++++ .../catalog-backend/src/modules/core/UrlReaderProcessor.ts | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/spotty-points-build.md diff --git a/.changeset/spotty-points-build.md b/.changeset/spotty-points-build.md new file mode 100644 index 0000000000..4c00d36aa9 --- /dev/null +++ b/.changeset/spotty-points-build.md @@ -0,0 +1,6 @@ +--- +'@backstage/errors': patch +'@backstage/plugin-catalog-backend': patch +--- + +Limit the length of error messages that get written to the database and logs - to prevent performance issues diff --git a/plugins/catalog-backend/src/modules/core/UrlReaderProcessor.ts b/plugins/catalog-backend/src/modules/core/UrlReaderProcessor.ts index 0ecd6d5a42..fb0f2e2bd0 100644 --- a/plugins/catalog-backend/src/modules/core/UrlReaderProcessor.ts +++ b/plugins/catalog-backend/src/modules/core/UrlReaderProcessor.ts @@ -97,7 +97,10 @@ export class UrlReaderProcessor implements CatalogProcessor { emit(processingResult.refresh(`${location.type}:${location.target}`)); } catch (error) { assertError(error); - const message = `Unable to read ${location.type}, ${error}`; + const message = `Unable to read ${location.type}, ${error}`.substring( + 0, + 5000, + ); if (error.name === 'NotModifiedError' && cacheItem) { for (const parseResult of cacheItem.value) { emit(parseResult); From fd8d67ee97746a1e74fbaa095941fce55996cc5f Mon Sep 17 00:00:00 2001 From: Gudmundur Orn Johannsson Date: Wed, 31 Aug 2022 11:57:15 +0300 Subject: [PATCH 2/3] Trigger CI Signed-off-by: Gudmundur Orn Johannsson From cafcccb8f67ac741a805883f20a464047c14127d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 31 Aug 2022 14:43:58 +0200 Subject: [PATCH 3/3] Update spotty-points-build.md Signed-off-by: Patrik Oldsberg --- .changeset/spotty-points-build.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.changeset/spotty-points-build.md b/.changeset/spotty-points-build.md index 4c00d36aa9..ffed46163d 100644 --- a/.changeset/spotty-points-build.md +++ b/.changeset/spotty-points-build.md @@ -1,5 +1,4 @@ --- -'@backstage/errors': patch '@backstage/plugin-catalog-backend': patch ---