diff --git a/.changeset/spotty-points-build.md b/.changeset/spotty-points-build.md new file mode 100644 index 0000000000..ffed46163d --- /dev/null +++ b/.changeset/spotty-points-build.md @@ -0,0 +1,5 @@ +--- +'@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 b1b1f64fdc..491f643637 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);