question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI does not work behind proxy

See original GitHub issue

Describe the bug Configuring HTTP_PROXY_* environment variables does not affect CLI behaviour. It is not possible to use CLI behind proxy.

To Reproduce

  1. Run CLI with proxy configured. Based on code here https://github.com/crowdin/crowdin-cli/blob/89e4684cdfad9a61ad86616255ca32551f3a8761/src/main/java/com/crowdin/cli/Cli.java#L31
HTTP_PROXY_HOST=proxy.example.com HTTP_PROXY_PORT=8080 HTTP_PROXY_USER=user HTTP_PROXY_PASSWORD=password java -jar crowdin-cli.jar upload
  1. Get an error
[ERROR] Fetching project info
java.lang.RuntimeException: Failed to collect project info. Please contact our support team for help
        at com.crowdin.cli.utils.console.ConsoleSpinner.execute(ConsoleSpinner.java:29)
        at com.crowdin.cli.commands.actions.UploadSourcesAction.act(UploadSourcesAction.java:65)
        at com.crowdin.cli.commands.picocli.ClientActCommand.act(ClientActCommand.java:25)
        at com.crowdin.cli.commands.picocli.GenericCommand.run(GenericCommand.java:57)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1919)
        at picocli.CommandLine.access$1100(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
        at picocli.CommandLine.execute(CommandLine.java:2058)
        at com.crowdin.cli.commands.picocli.PicocliRunner.execute(PicocliRunner.java:36)
        at com.crowdin.cli.Cli.main(Cli.java:19)
Caused by: java.lang.RuntimeException: Error from server: <Code: <empty_code>, Message: Connect to api.crowdin.com:443 [api.crowdin.com/34.233.13.83, api.crowdin.com/3.220.221.31, api.crowdin.com/107.21.48.25] failed: Connection timed out: connect>
        at com.crowdin.cli.client.CrowdinClientCore.executeRequest(CrowdinClientCore.java:109)
        at com.crowdin.cli.client.CrowdinClientCore.executeRequest(CrowdinClientCore.java:82)
        at com.crowdin.cli.client.CrowdinClient.getProject(CrowdinClient.java:97)
        at com.crowdin.cli.client.CrowdinClient.populateProjectWithInfo(CrowdinClient.java:81)
        at com.crowdin.cli.client.CrowdinClient.downloadFullProject(CrowdinClient.java:42)
        at com.crowdin.cli.utils.console.ConsoleSpinner.execute(ConsoleSpinner.java:24)
        ... 12 more

Expected behavior It would be great to have clear documentation how to use CLI with proxy configuration.

Works fine:

export https_proxy=http://user:password@proxy.example.com
curl https://api.crowdin.com

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
minijuscommented, Sep 15, 2020

Hi @minijus !

There is another pre-release build which includes proxy translations download fix - crowdin-cli-3.2.2.zip

P.S. This build is not completely tested by our QA team yet.

Hi!

Thanks for this update. I can confirm that this build works fine (both upload and download) and there is no need to pass extra proxy properties directly to java.

1reaction
minijuscommented, Sep 4, 2020

Hi @minijus !

There is a pre-release build of CLI with the fix (not yet deployed) crowdin-cli-3.2.2.zip

Could you please try this build to check if everything is ok?

Hi!

the fix on new build worked like a charm πŸ˜ƒ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using an HTTP proxy - AWS Command Line Interface
To access AWS through proxy servers, you can configure the HTTP_PROXY and HTTPS_PROXY environment variables with either the DNS domain names or IP...
Read more >
CDK CLI does not work through corporate proxy. #645 - GitHub
CDK CLI does not work when the user connected to the internet through the proxy. I get "connect ECONNREFUSED 54.240.195.235:443" error.
Read more >
Use Azure CLI 2.0 behind corporate proxy server
For some time Azure CLI was not supported behind corporate proxies at all. However it seems that this was fixed in 2015.03.04 Version...
Read more >
Angular-CLI proxy to backend doesn't work - Stack Overflow
I'm getting an error that http://localhost:4200/api/hello 404 (Not Found) . As we can see, nothing has been proxied. Why? Did I do somethingΒ ......
Read more >
AWS CLI not working behind proxy - Reddit
I'm trying to get aws cli working through a proxy on a Windows instance but not having any luck, specifically for an instance...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found