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);