component-detection icon indicating copy to clipboard operation
component-detection copied to clipboard

Scanning of files that aren't really Dockerfiles is causing errors

Open mthalman opened this issue 2 years ago • 1 comments

After the upgrade to version 0.197.26 of AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask, component detection is causing it to fail when attempting to scan files that are named like a Dockerfile but aren't really Dockerfiles.

An example of such a file is https://github.com/dotnet/dotnet-docker/blob/main/eng/dockerfile-templates/Dockerfile.linux.copy-files. It's a template file, not an actual Dockerfile that gets built. But component detection is finding this file and attempting to parse it, leading to this error:

[INFO] Finding components... 
[INFO] Starting enumeration of /mnt/vss/_work/1 
[INFO] Enumerated 2129 files and 1025 directories in 00:00:00.0722318 
[INFO] No instructions received to scan docker images. 
[INFO] Discovered dockerfile: /mnt/vss/_work/1/s/dotnet-dotnet-docker/eng/dockerfile-templates/Dockerfile.linux.copy-files 
[INFO] No compatible Conda installation found on system. Conda detection will not run. 
[ERROR] There was an unexpected error:  
[ERROR] SafelyExecute logged ParseException: Parsing failure: unexpected '{'; expected A or C or E or F or H or L or M or O or R or S or U or V or W (Line 1, Column 1); recently consumed: 
##[error]Encountered an error while generating the manifest.
##[error]Error details: Component detector failed. Result: Error.
##[error]Manifest generation failed, please check output file for more info.

mthalman avatar Aug 10 '22 21:08 mthalman

This is using CD version 1.2.0

aasim avatar Aug 11 '22 16:08 aasim

Closed in #217

JamieMagee avatar Aug 24 '22 19:08 JamieMagee