Open alangmaid opened 1 month ago
@spetros-do I was looking at some of the 500 errors from the scans. There were quite a few instances. Here's a link to a Kibana search that filters the 500 errors in staging on the day of the scans. https://logs.fr.cloud.gov/goto/8fc1339faf959d3e9bcc5b476e94d534
A couple observations:
QueryFailedError: invalid byte sequence for encoding "UTF8": 0x00 at PostgresQueryRunner.query (/home/vcap/deps/0/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SelectQueryBuilder.loadRawResults (/home/vcap/deps/0/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2007:25) at async SelectQueryBuilder.executeEntitiesAndRawResults (/home/vcap/deps/0/node_modules/typeorm/query-builder/SelectQueryBuilder.js:1867:26) at async SelectQueryBuilder.getRawAndEntities (/home/vcap/deps/0/node_modules/typeorm/query-builder/SelectQueryBuilder.js:637:29) at async SelectQueryBuilder.getOne (/home/vcap/deps/0/node_modules/typeorm/query-builder/SelectQueryBuilder.js:664:25) at async DbLookupValidator.validate (/home/vcap/deps/0/node_modules/@us-epa-camd/easey-common/validators/db-lookup.validator.js:24:27) at async Promise.all (index 0) at async Promise.all (index 0) at async ValidationPipe.transform (/home/vcap/deps/0/node_modules/@nestjs/common/pipes/validation.pipe.js:64:24)
Since the issue is in the dblookup validator in commons this will effect every API where this is used.
/emissions-mgmt/emissions/apportioned/ozone/nationally?stateCode=AL&facilityId=100&unitType=Arch-fired+boiler&unitFuelType=Coal&controlTechnologies=Additives+to+Enhance+PAC+and+Existing+Equipment+Performance&programCodeInfo=ARP&year=100)+%22+WAITFOR+DELAY+%2700%3a00%3a10%27+--+&page=100&perPage=100
Resulting exception:
LoggingException: invalid input syntax for type numeric: "100) " WAITFOR DELAY '00:00:10' --" at OzoneApportionedEmissionsService.getEmissionsNationalAggregation (/home/vcap/app/dist/apportioned-emissions/ozone/ozone-apportioned-emissions.service.js:75:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Thank you, @maheese. That will definitely help in narrowing the issue(s) at hand.
@maheese, @mark-hayward-erg, @maxdiebold-erg, @szintgraff, @alangmaid
I. For the Db-lookup.validator ⇒ Issues Identified on the [src/validators/db-lookup.validator.ts]
⇒ Suggested changes: [Implement]
II. For the Valid-Code Validator ⇒ Issues identified on the
[src/validators/is-valid-codes.validator.ts]
⇒ Suggested changes: [Implement - similar to above]
III. Next Steps ⇒
For #2: Operational Year Parameter (Op & Year) Issue: Based on the given example provided:
The issue highlights the need for:
Specifically:
Proposed Solution:
CAMPD_Emissions_API_Vulns.xlsx