-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Unable to execute openapi-generator-cli version[BUG] #390
Comments
I have this same problem. Thank you for taking the time to post this issue. I think you will find that @kay-schecker provided you with the configuration that is closer to what you need. Notice his maven download.
5.1.1. seems to be the latest found here. @kay-schecker Could you please help us on this. What is the minimal configuration that we need to specify the appropriate configuration? |
I'm assuming that you can run with a command such as this:
Where cfg.json is the file containing something such as :
I've not actually tried this. I'm not sure what "test123" does. Nor am I actually sure that the -c option is used to provide the configuration file seen above (I've not actually found a usage example). I see -c referenced here, at this hyperlink for the generate directive. I'm not sure if this -c also works for the version directive. |
I have tried the suggestion from @davesargrad above and get the following results (seems to be the same as original comment). @kay-schecker please provide some guidance, as I am out of ideas as to what to try.
|
Actually you may need to simply edit openapitools.json as seen here. I think the -c option points to a yaml configuration that pertains only to the generator. Other than that, I am not sure what to suggest at this point. Hopefully the author of the tool can help us. |
Following the suggestion, I edited the openapitools.json, per @davesargrad's suggestion, and did not have the -c on the command line. The results are below.
The original openapitools.json was empty. The openapitools.json, now, contains the following information:
|
Looks like you are now hitting a squid proxy properly.. It seems to be rejecting your request to download from maven. |
I got some feedback from IT group monitoring the internet activity. The failed command above got the following error:
I executed a curl on the above URL:
I got the temp.tmp file generated. In addition, the IT guy saw the following messages:
The failed log tried to do a GET on a https URL, while the success logs issued the CONNECT commands. With the configuration file we are currently using, a maven repository is specified. I removed that from the configuration and got a different URL (https://search.maven.org/solrsearch/select?q=g:org.openapitools+AND+a:openapi-generator-cli&core=gav&start=0&rows=200 ), but still the same problem. Could not find a way to prevent application from searching maven for updates. It seems like the openapi-generator-cli is trying to establish the "wrong" type of connection for https connection. I saw mention of use a -Dhttps.proxyHost and -Dhttps.proxyPort on the command line - tried that, as well as http.proxy* with no change in the results, as well as the same error messages in internet access logs. The curl command demonstrated that we could get the the firewall (also did a browser download), so this does not seem to be a proxy issue. |
Until we get some guidance from @kay-schecker, I think perhaps you should try the openapi generator.. and bypass the openapi-generator-cli command line wrapper. Download the latest jar, and use the java command directly. |
Hi sorry for the late response. It's very difficult to debug such issues, because proxies often produce strange errors. I just found this article: https://stackoverflow.com/questions/27636360/squid-proxy-gives-501-on-get-request-made-by-python-but-not-curl Could you try to create a short node.js script (using axios) to debug this issue within your network? |
I'll be glad to push that issue to our IT guys. Perhaps indeed it is in the configuration of the squid proxy. Good find. |
I asked our IT guy about this and he provided the following: "The web page referenced is correct that you cannot simply open a tcp connection to the proxy server and issue a GET command. For https sites you will have to use the proxy CONNECT method, and then you will have to negotiate TLS, and then you can issue your http GET command." |
Sorry to repost my request here, but seems like it was ignored last time and I've been using some workarounds in the meantime, such as unsetting the proxy env vars manually + using a private nexus repository. But I'd still like to know if it would be possible to add the ability to respect the NO_PROXY env variable. EDIT: BTW, I also have the same squid proxy issue when I try to download directly from the official nexus while using the corporate proxy. |
I am having similar issue. It is most likely that the NO_PROXY environment variable is not respected. |
I have a similar issue. I am completely unable to run openapi-generator-cli at all. Although I always get a 400 error instead of a 501. I am also behind a corporate proxy using windows 10. I have the proxy setup in windows and npm and everything else, other than openapi-genereator-cli has no issues :( `╰─ npx @openapitools/openapi-generator-cli version ─╯ Response: (node:23516) UnhandledPromiseRejectionWarning: TypeError: error.response.data.on is not a function |
If I disconnect my corporate VPN connection and remove the proxy setting I get this instead: Response: |
I managed to work around the issue by installing and using the previous version : ╰─ npx @openapitools/openapi-generator-cli version ─╯ |
I was also able to find a workaround for this by manually setting the version in my openapitools.json file. The issue is happening when the npm wrapper tries to query the lastest available version of openapi-generator from maven. If you've set your version in openapitools.json, it wont run the query and will just download the jar file corresponding to the version you've chosen. So far I haven't had any issues with downloading the jar. Really only the query seems to be having issues Example
|
You could also disable ssl check, but only, if you know what you're doeing ;)
|
I looked a bit at the source code to find out how the proxy settings are used. This is the place where it happens:
(see fix #130 & PR #139) The environment variables HTTPS_PROXY and HTTP_PROXY are considered. |
Meanwhile, I was able to generate the client using below steps. Basically skipping the wrapper and accessing jar directly.
|
As per yarnpkg/yarn#841 and nodejs/node-gyp#695 setting |
I kinda still have this problem (and also being behind a very restrictive corp proxy).
which is basically always an IP that points to AWS, which probably hosts the maven repo. I also tried to specify an in-house maven repo, that has the file already, but it looks like the configuration is ignored or not picked up. Is there anyway I can further debug this or set something like "DO_NOT_DOWNLOAD=true" to resolve this. |
Using version 2.3.5 of openapi-generator-cli in the Node environment, I am getting the error shown below. Googling, I found bug #130 in this issue database. This issue states that a solution was put in place, but does not provide any guidance on how to implement the solution.
The referenced bug report seems to imply that proxy settings might be the problem. Investigating now how to deal with specifying the proxies. We are behind a corporate proxy. I have tried setting http_proxy and https_proxy environment parameters without success. I believe that there is a way to configure the openapi-generator-cli to deal with proxies, but I have not been able to find this.
I found two configurations within the referenced bug report: here and here. But no details on the structure of the configuration file.
What is the configuration needed to get the command below work? How do I augment the command to use the configuration file:
npx @openapitools/openapi-generator-cli version
The text was updated successfully, but these errors were encountered: