Comments (36)
Together with @nathanaelhuffman we managed to find a solution for this.
This should work if you are inside a corporate network which is using a man-in-the-middle proxy - this sounds like all the reports on this thread.
Steps to resolve:
- Find the proxy root certificate on your machine
- Add it to a certificate store if not already there - this step may be optional depending on your os
- Add a new global environment variable
REQUESTS_CA_BUNDLE
to point at the certificate path - on windows replace '' with '/'
Please let me know if this isn't working for you
We'll look to make this a configuration option in the plugins if this works for most people
from sourcery.
Why is this issue closed? Login does not work inside a corporate MITM proxy.
`~\Documents on ☁️ (us-east-1) took 2s
❯ sourcery --verify
sourcery, version 1.0.5
Verifying user config C:\Users\320159535\AppData\Roaming\sourcery\sourcery.yaml - success
Verifying server availability https://api.sourcery.ai/health - failure
- HTTPSConnectionPool(host='api.sourcery.ai', port=443): Max retries exceeded with url: /health (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))
Verifying refactoring functionality - success
Verifying local database - success
~\Documents on ☁️ (us-east-1) took 2s
❯`
from sourcery.
Thanks!
I need to submit the build to Jetbrains to approve, so it'll be a few days. I'll let you know when it's ready to test.
from sourcery.
Hi,
I believe I have a related issue - when I paste the token VS Code shows an error:
Could not connect to server to authenticate
... also within corporate env.
from sourcery.
I have encountered the same issues as @gadeberg. I received the same error message "Could not connect to server to authenticate" inside of VSCode while working in my corporate environment.
from sourcery.
@brendanator I sent you an email with the details. It looks like our SSL inspection is the culprit since it's man-in-the-middling the SSL connection.
from sourcery.
Sorry about that @adamddh. I didn't include the solution.
Please follow the instructions to set up a proxy
Let me know if you have any problems
from sourcery.
Thanks for raising the issue - I'll look into getting it to work with a proxy.
from sourcery.
Have you got the proxy set up manually in Pycharm or auto-detecting?
from sourcery.
I've used both, but neither seem to work
from sourcery.
We'd like to make sure we get the fix right before releasing it, and we're not sure our local testing replicates a corporate proxy environment.
Would you be able to try out a special build of the plugin to test it? It would still be an update delivered through Pycharm, but with some extra instructions on how to install it.
from sourcery.
Sure thing!
from sourcery.
Jetbrains approved it straight away!
To install:
- Start Pycharm and go to File > Settings > Plugins
- Click the cog icon at the top right and choose 'Manage Plugin Repositories'
- Add this to the list: https://plugins.jetbrains.com/plugins/alpha/list
- The updates tab should now have Sourcery 0.3.1-dev available - click update and then restart.
We're currently supporting the manual proxy configuration. Once it's configured you'll need to restart pycharm again for Sourcery to pick it up.
Please let me know how you get on!
from sourcery.
For the automatic proxy, sorcery, seem to by pass it (it tries to connect to api.sourcery.ai
), while it goes throw the proxy when using manual proxy settings.
Unfortunately, I still get an error message saying Failed to launch Sorcery service: java.util.concurrent.TimeoutException
When checking the settings, the version for Sorcery is unknown
, suggesting the plugin was unable to fetch it. I'm not sure if that is a proxy issue ate "your end", or if the request is blocked / altered on "my part".
PS: The proxy at my workplace inspects TLS traffic.
from sourcery.
Is the address of your proxy http or https?
from sourcery.
http
from sourcery.
I've sent through another tweaked version - same instructions as before but it should now be 0.3.2-dev.
Would be awesome if you could give it a try and report back.
from sourcery.
Have you had a chance to try out the new version? Would love to know if it addressed the issue.
from sourcery.
I have. Unfortunately, I still get a timeout error even though my network inspection says the request to sentry.io goes through the proxy.
from sourcery.
Do you have authenticated proxies @gadeberg and @djjacqmin ?
There's an issue with VS Code extensions and authenticated proxies that we're keeping an eye on here:
microsoft/vscode#12588
Do you run other extensions that can successfully navigate through the proxy?
from sourcery.
Looking at my list of extensions, the only one that requires communication with the internet is Settings Sync, it works through github primarily.
I am not a full-time developer (I'm a physicist who works in a hospital and I use a lot of Python at work), but I'll try to be as helpful as possible. I do not know what you mean by having an authenticated proxy. I can tell you that I had to add my institution's root certificate to allow conda, pip and git to run on my work PC. Are you aware of a process for doing this for VS Code?
from sourcery.
I can reproduce the same issue in PyCharm using the Sourcery 0.5.0. We use SSL man-in-the-middle inspection here and proxy all of our traffic through Zscaler. What kind of information do you need to help diagnose?
from sourcery.
i've just added a new option to the Sourcery binary in the latest release that verifies that it can will run correctly, including whether it can contact the Sourcery api endpoint. The sourcery binary is located in the following locations:
- PyCharm
- 2019.3 and below
- Windows -
%HOMEPATH%\.PyCharm<version>\config\plugins\sourcery\lib\win
- Mac -
~/Library/Application Support/PyCharm<version>/sourcery/lib/mac
- Linux -
~/.PyCharm<version>/config/plugins/sourcery/lib/linux
- Windows -
- 2020.1 and above
- Windows -
%APPDATA%\JetBrains\PyCharm<version>\plugins\sourcery\lib\win
- Mac -
~/Library/Application Support/JetBrains/PyCharm<version>/plugins/sourcery/lib/mac
- Linux -
~/.local/share/JetBrains/PyCharm<version>/sourcery/lib/linux
- Windows -
- 2019.3 and below
- VSCode
~/.vscode/extensions/sourcery.sourcery-<version>/binaries/sourcery-<version>-<os>
Once in that folder you can run sourcery --verify
to check if it will work. You will get an connection error if you are behind a proxy.
Sourcery uses requests for it's http requests. The documentation for requests proxy support is here which can be used with the binary as follows:
HTTP_PROXY=<proxy_url> sourcery --verify
HTTPS_PROXY=<proxy_url> sourcery --verify
It would be really helpful to find out what proxy configuration makes the verify check pass for each of you or if it never works and why. If you're not comfortable publishing this information publicly you can send me an email at [email protected]
from sourcery.
I get the following Error on VS Code behinde corporate proxy:
Could not connect to server to authenticate: HTTPSConnectionPool(host='api.sourcery.ai', port=443): Max retries exceeded with url: /access_token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000000000E9A8088>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
I tried the following: microsoft/vscode#12588 (comment) but it doesn't work.
from sourcery.
Same issue even though I do not use a proxy.
Failed to launch Sourcery service: java.util.concurrent.TimeoutException
Everything works fine, but I am welcomed with this message every time PyCharm starts.
from sourcery.
Error from PyCharm 2020.3 behind firewall : Verifying server availability https://api.sourcery.ai/health - failure
- HTTPSConnectionPool(host='api.sourcery.ai', port=443): Max retries exceeded with url: /health (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))
Verifying refactoring functionality - failure
- Incorrect hash value for static hashes
from sourcery.
I am a new user wanting to try Sourcery but also getting this error:
4/26/21
5:06 PM Failed to authenticate with Sourcery: Could not connect to server to authenticate: HTTPSConnectionPool(host='api.sourcery.ai', port=443): Max retries exceeded with url: /access_token (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1091)')))
I did try the "Manage Plugin Repositories" suggestion mentioned above: #22 (comment)
from sourcery.
Still getting the error
Verifying server availability https://api.sourcery.ai/health - failure
"HTTPSConnectionPool(host='api.sourcery.ai', port=443): Max retries exceeded with url: /health (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')))"
Verifying refactoring functionality - success
Verifying local database - success
from sourcery.
With the latest release 0.9.7 Sourcery will fall back to the Free plan if it cannot contact our authentication server. This means that you can now use Sourcery from behind a corporate proxy.
from sourcery.
from sourcery.
that's a great workaround to get us going - is there also a goal to fix it so that paid plans can also be used?
from sourcery.
Thanks was waiting for this since longtime tried just now it's working fine 👍👍
from sourcery.
that's a great workaround to get us going - is there also a goal to fix it so that paid plans can also be used?
Sorry missed this - yes we are planning to fix it for paid plans, but might take a bit longer...
from sourcery.
@brendanator I work behind a corporate proxy with the paid plan, but Sourcery is still falling back to the free plan. Was this solved in Sourcery, or is there a publicized work-around I may have missed?
from sourcery.
Anyone who managed to resolve this?
sourcery, version 1.0.2
Verifying config C:\Users\jkmaina\AppData\Roaming\sourcery\sourcery.yaml - success
Verifying server availability https://api.sourcery.ai/health - failure
- HTTPSConnectionPool(host='api.sourcery.ai', port=443): Max retries exceeded with url: /health (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))
Verifying refactoring functionality - success
Verifying local database - success
from sourcery.
@brendanator How did you resolve this error?
from sourcery.
Related Issues (20)
- Sourcery plugin in VSCode uses too much process HOT 5
- Sourcery doesn't recognise Jetbrains 'remote development' WSL project as open source HOT 1
- Project disabled for account due to open source account. I have a pro account HOT 1
- FIX Cannot select and copy that text in Sourcery sidebar HOT 3
- mapping values are not allowed here HOT 2
- The "CI" link is incorrect HOT 1
- Remaining manual issues should be listed separately from autofixed ones HOT 1
- Sourcery seems to hate anything Linux related? HOT 1
- Incorrect structure when generating docstrings HOT 2
- After upgrading to Pro Plan the VsCode Extension still identifies me as being on the Open-source Plan HOT 2
- VS Code: Couldn't create connection to server to Sourcery at startup HOT 2
- docstrings style
- MacOs PyCharm Plugin stuck at "Loading" HOT 2
- Implement "Generate Docstring" & "Generate Test Cases" in CLI and Neovim
- review doesn't work on organization's repo HOT 4
- PyCharm plugin freezes - restart possible? HOT 2
- It should review changed files, not original. HOT 1
- Sourcery GitHub app returns no status if no refactorings have been found HOT 1
- Sourcery plugin not working for Pycharm HOT 4
- feat: review should be updated or create a new one. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sourcery.