camel-k icon indicating copy to clipboard operation
camel-k copied to clipboard

Log a warn message once the component used has not a quarkus extension

Open aboucham opened this issue 2 years ago • 12 comments

Log a warn message once the component used has not a quarkus extension.

For the moment, we see only the following lines in the operator log:

{"level":"info","ts":1647441251.3206353,"logger":"camel-k.maven.build","msg":"[INFO] Scanning for projects..."}
{"level":"info","ts":1647441252.2915804,"logger":"camel-k.maven.build","msg":"[ERROR] [ERROR] Some problems were encountered while processing the POMs:"}
{"level":"info","ts":1647441252.2962983,"logger":"camel-k.maven.build","msg":"[ERROR] 'dependencies.dependency.version' for org.apache.camel:camel-aws-starter:jar is missing. @ line 64, column 17"}
{"level":"info","ts":1647441252.3024638,"logger":"camel-k.maven.build","msg":"[ERROR] 'dependencies.dependency.version' for org.apache.camel:camel-http4:jar is missing. @ line 72, column 17"}
{"level":"info","ts":1647441252.3025827,"logger":"camel-k.maven.build","msg":" @ "}
{"level":"info","ts":1647441252.3131278,"logger":"camel-k.maven.build","msg":"[ERROR] The build could not read 1 project -> [Help 1]"}

aboucham avatar Mar 17 '22 09:03 aboucham

Hey @aboucham, I would like to work on this issue, although I am a beginner, this seems like a fairly simpler solution to work around.

parul5sahoo avatar Mar 28 '22 07:03 parul5sahoo

Just assigned to you. Please, let us know if you need any help.

squakez avatar Mar 28 '22 09:03 squakez

yes, it would be great if you can share some resources to refer, sort of code walkthroughs or any resource that shall be useful in giving a headstart.

parul5sahoo avatar Mar 29 '22 16:03 parul5sahoo

I think some possible way to fix it is to scan the log provided from the builder. However, I'm just noticing a more general scenario could be covered by #3149. @phantomjinx can you please confirm that with the work you're doing that you are covering also the error mentioned in this issue?

squakez avatar Mar 30 '22 08:03 squakez

@squakez No. I don't believe it is. I think this refers to adding more logging messages whereas #3149 seeks to grab the quarkus logging if the command immediately fails.

phantomjinx avatar Mar 30 '22 11:03 phantomjinx

Thanks @phantomjinx. I was trying to think a simple approach to parse the log, capture the kind of error and bubble up into the Builder error conditions. However, for the sake of simplicity, I think we can start inspecting the content of the maven log line here, and if it complains of a camel dependency missing a version (such as in the issue description) we can add an additional line of log explaining that likely, the component has not a Camel Quarkus extension valid. @parul5sahoo I hope that can give you some hint on how to proceed.

squakez avatar Mar 30 '22 11:03 squakez

Can't we verify the validity of any requested camel artifacts by attempting to look them up in the catalog, instead of parsing logs?

jamesnetherton avatar Mar 30 '22 12:03 jamesnetherton

Can't we verify the validity of any requested camel artifacts by attempting to look them up in the catalog, instead of parsing logs?

Yeah, it's a very good idea. Probably we can extend the functions in https://github.com/apache/camel-k/blob/main/pkg/util/camel/camel_dependencies.go to lookup into the catalog, otherwise returning an error. If we go through this path, I am not sure if it's still suitable as a "good first issue" for contributors as it requires a bit of knowledge of the project.

squakez avatar Mar 30 '22 13:03 squakez

Incase the issue would need a bit of investing, I would like to collaborate on this issue with an experienced collaborator if that's possible..

parul5sahoo avatar Mar 31 '22 04:03 parul5sahoo

Incase the issue would need a bit of investing, I would like to collaborate on this issue with an experienced collaborator if that's possible..

Don't worry. Please, look for some other issue that you'd like to work on. I'm unassigning for now.

squakez avatar Mar 31 '22 08:03 squakez

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

github-actions[bot] avatar Jun 30 '22 00:06 github-actions[bot]

It's still a nice-to-have and shouldn't be stale.

tadayosi avatar Jun 30 '22 02:06 tadayosi