Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCS ran into an error: null #363

Closed
jwedel opened this issue Apr 29, 2024 · 6 comments · Fixed by #367
Closed

MCS ran into an error: null #363

jwedel opened this issue Apr 29, 2024 · 6 comments · Fixed by #367

Comments

@jwedel
Copy link

jwedel commented Apr 29, 2024

Hi,

just installed MCS via brew on my Mac M1. After successful installation, I ran:

➜ mcs search plexus-utils
Searching for plexus-utils...
MCS ran into an error: null

If the error persist, please consider reporting the issue at https://github.com/mthmulders/mcs/issues/new

One potential thing: Does mcs supports proxies? Like does it respect the HTTP[S]_PROXY env variable as I am behind a corporate proxy?

@mthmulders
Copy link
Owner

Hi Jan, thanks for giving MCS a try!

MCS uses the default HTTP client that ships with the JDK (java.net.http package). I don't think that one respects the HTTP[S]_PROXY env variables, but it does respect JVM settings such as java.net.useSystemProxies or http.proxyHost, http.proxyPort and their https counterparts.

Do you suspect the issue might be related to MCS not using a proxy server while you expect it too? In that case, at least it should give a better error message than just null.

If you feel comfortable with it, can you try running MCS from an IDE? If you could put a breakpoint in line 36 of SearchClient, it should tell you the exception it found there. Another useful point could be line 8 of McsExecutionExceptionHandler, as that's where the exception gets printed to output.

@jwedel
Copy link
Author

jwedel commented May 2, 2024

This is what I can see:
image

It is most probably due the missing proxy usage. The DNS will not resolve external host names. You have to use the proxy.

I tried the Java setting -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128 but it still fails.

@mthmulders
Copy link
Owner

Thanks, Jan, that is very useful information! I'll make sure to give a (slightly) better error in that case.

I tried the Java setting -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128 but it still fails.

You could try -Dhttps.proxyHost=localhost -Dhttps.proxyPort=3128 as MCS uses HTTPS rather than HTTP.

@jwedel
Copy link
Author

jwedel commented May 2, 2024

You could try -Dhttps.proxyHost=localhost -Dhttps.proxyPort=3128 as MCS uses HTTPS rather than HTTP.

Yeah, that works!

So, although that works, it would be great if the tool could respect the env variables.

@mthmulders
Copy link
Owner

You could try -Dhttps.proxyHost=localhost -Dhttps.proxyPort=3128 as MCS uses HTTPS rather than HTTP.

Yeah, that works!

Great!

So, although that works, it would be great if the tool could respect the env variables.

Agreed! I've logged #368 to track that. Are there more proxy-related environment variables that come into play?

@mthmulders
Copy link
Owner

v0.6.4 should at least provide you a more meaningful error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants