Altinn / altinn-file-scan

Microservice for handling file scan
MIT License
0 stars 0 forks source link

Filescan result never persisted for some dataelements #135

Closed acn-sbuad closed 4 months ago

acn-sbuad commented 4 months ago

Description of the bug

Multiple data elements with filescanresult 'Pending'. No errors are logged in relation tot he processing of the filescan for the data elements in the FileScan function.

One theory was that there might be a time diff, as we have a number of log messages identifying all the dataelements where there is a timediff during file scan (which results in the scan being aborted). All these dataelements have a 'Clean' result in the db meaning they have been queued for a new scan by storage probably due to the blob having been updated.

Something else must be the reason behind the Pending result.

Query to identify affected data elements. Output can be used directly to trigger new filescan manually.

select d.alternateid as dataElementId,
CONCAT(i.partyid, '/', i.alternateid) as instanceId, 
d.element->'Filename' as filename, 
element->'LastChanged' as timestamp,  
element->'BlobStoragePath' as blobstoragepath
FROM storage.dataelements d
JOIN storage.instances i ON d.instanceinternalid =i.id
where d.element @> '{ "FileScanResult": "Pending" }'
order by timestamp asc;

Steps To Reproduce

happens sporadically, not sure how to reproduce

Additional Information

No response

HenningNormann commented 4 months ago

https://github.com/Altinn/altinn-storage/pull/341

acn-sbuad commented 4 months ago

no new pending file scans in production after this was deployed. Closing