codota / TabNine

AI Code Completions
https://tabnine.com
MIT License
10.58k stars 493 forks source link

at Windows7 System use Proxy not work #585

Closed q920447939 closed 1 year ago

q920447939 commented 1 year ago

Issue Details: My desktop has no internet and needs to rely on an HTTP proxy to access the internet。 After I downloaded the plugin using the proxy, click the Tabnine Start button in the lower right corner of IDEA(At this time IDEA log is 2023-02-10 16:12:18,321 [ 245932] INFO - #c.t.b.BinaryProcessRequesterProvider - TabNine's response timed out.)。 then chrome open url http://127.0.0.1:1123/sec-ukqxvicercvflmttoxek/home?tabnineUrl=http%3A%2F%2F127.0.0.1%3A1123%2Fsec-ukqxvicercvflmttoxek but i see no login and this page prompts me to start a free train. When I click to log in, I will jump to a new page, but after a few seconds, I will return to the previous page Tried many times to no avail.(My Google Chrome is also using the same proxy as login requires network) So I feel like I'm not using the premium features

gz#21264

(related to Zendesk ticket #21264)

yonip23 commented 1 year ago

Hi there, thanks for reaching out

Do you have http_proxy (or https_proxy) environment variable set with your proxy server?

q920447939 commented 1 year ago

Hi there, thanks for reaching out

Do you have http_proxy (or https_proxy) environment variable set with your proxy server?

yes, look at my screenshot

yonip23 commented 1 year ago

I see. Can you please verify you can successfully curl to https://api.tabnine.com, https://www.tabnine.com, and https://c2.p.tabnine.com/health?

q920447939 commented 1 year ago

I see. Can you please verify you can successfully curl to https://api.tabnine.com, https://www.tabnine.com, and https://c2.p.tabnine.com/health?

When accessing the URL when using a proxy, the results can be returned normally(use chrome browser test)

yonip23 commented 1 year ago

Ok, so we made sure you can access our services correctly. To further troubleshoot your issue, please follow these steps:

  1. Setup engine logs file path via your IDE settings panel -> Tools -> Tabnine -> Log File Path, and set your log level to "debug" as well - as shown in the image below: image
  2. Restart your IDE.
  3. Go to https://app.tabnine.com/ and log out from Tabnine via your browser.
  4. Open the Hub from your IDE and sign in from the Hub.

If this works, great 🙂 If not, please attach the log file (you'll find a file with the name you've set in step (1) + "_rCURRENT" suffix).

Kind regards, Yoni

q920447939 commented 1 year ago

Ok, so we made sure you can access our services correctly. To further troubleshoot your issue, please follow these steps:

  1. Setup engine logs file path via your IDE settings panel -> Tools -> Tabnine -> Log File Path, and set your log level to "debug" as well - as shown in the image below: image
  2. Restart your IDE.
  3. Go to https://app.tabnine.com/ and log out from Tabnine via your browser.
  4. Open the Hub from your IDE and sign in from the Hub.

If this works, great slightly_smiling_face If not, please attach the log file (you'll find a file with the name you've set in step (1) + "_rCURRENT" suffix).

Kind regards, Yoni

Thank you very much for your help, I followed your steps to retry and it still doesn’t work, I have uploaded the DEBUG log to OneDrive, please continue to help me look at the problem :triumph: :triumph: :triumph: DEBUG FILE URL

I made sure my proxy is fine mwuaL.png

yonip23 commented 1 year ago

Hi @q920447939 From your logs, I see this error:

ERROR [ui::http_server] [2023-02-15:08:26:06 TabNine.exe ERROR] Fail to sign in with custom token: error sending request for url (https://api.tabnine.com/firebase/api/v1/accounts:signInWithCustomToken?key=<some key>): error trying to connect: 接收到的消息异常,或格式不正确。 (os error -2146893018)

Please ensure you have access to https://api.tabnine.com, by running one or more of the following commands: curl https://api.tabnine.com ping api.tabnine.com nslookup api.tabnine.com

q920447939 commented 1 year ago

Hi @q920447939 From your logs, I see this error:

ERROR [ui::http_server] [2023-02-15:08:26:06 TabNine.exe ERROR] Fail to sign in with custom token: error sending request for url (https://api.tabnine.com/firebase/api/v1/accounts:signInWithCustomToken?key=<some key>): error trying to connect: 接收到的消息异常,或格式不正确。 (os error -2146893018)

Please ensure you have access to https://api.tabnine.com, by running one or more of the following commands: curl https://api.tabnine.com ping api.tabnine.com nslookup api.tabnine.com

curl https://api.tabnine.com response OK ping api.tabnine.com response OK nslookup api.tabnine.com $ nslookup api.tabnine.com *** UnKnown can't find api.tabnine.com: No response from server Server: UnKnown Address: fec0:0:0:ffff::1

Then I tried to find the reason, turned off IPV6 and restarted the network nslookup api.tabnine.com

$ nslookup api.tabnine.com
Non-authoritative answer:
Server:  public1.114dns.com
Address:  114.114.114.114

Name:    api-gateway.p.tabnine.com
Address:  34.123.33.186
Aliases:  api.tabnine.com

But I clicked the IDEA Open tabnine hub button again, and then clicked to log in and it still didn't work

yonip23 commented 1 year ago

@q920447939 thank you for your cooperation 🙂 It appears to be the case that your machine has access to the https://api.tabnine.com server, but for some reason, the Tabnine binary engine doesn't. I'd suspect some firewall / other security rules prevent the process from accessing this url.

To test this, let's try to run the binary directly from the command line:

  1. Find your engine path in the Hub -> Support -> General Info -> Engine file path
  2. Open a cmd with admin permissions
  3. Run the process like so: <engine file path> --no_bootstrap --log-level debug --log-file-path <a log file path> This will start the process and write the logs to the given file path. If you want to see the logs directly in the cmd as well, add the flag --log_to_stderr
  4. Copy-paste the following json to the cmd where the process runs: {"version":"9.9.9","request":{"Configuration":{}}}, and hit enter. This will open the hub from the process that runs in the cmd.
  5. Try to login from the hub, as you tried before If this works - it means that the process that the IDE runs doesn't have sufficient permissions to access api.tabnine.com. And if it doesn't work - please attach the logs and we'll see what's up.

I have attached below a screen recoding of me performing the above instructions, hope it'll help: https://user-images.githubusercontent.com/67855609/219047879-4ac6294f-3c39-450b-a3c5-e639b3a4a35b.mp4

Kind regards, Yoni

q920447939 commented 1 year ago

@q920447939 thank you for your cooperation slightly_smiling_face It appears to be the case that your machine has access to the https://api.tabnine.com server, but for some reason, the Tabnine binary engine doesn't. I'd suspect some firewall / other security rules prevent the process from accessing this url.

To test this, let's try to run the binary directly from the command line:

  1. Find your engine path in the Hub -> Support -> General Info -> Engine file path
  2. Open a cmd with admin permissions
  3. Run the process like so: <engine file path> --no_bootstrap --log-level debug --log-file-path <a log file path> This will start the process and write the logs to the given file path. If you want to see the logs directly in the cmd as well, add the flag --log_to_stderr
  4. Copy-paste the following json to the cmd where the process runs: {"version":"9.9.9","request":{"Configuration":{}}}, and hit enter. This will open the hub from the process that runs in the cmd.
  5. Try to login from the hub, as you tried before If this works - it means that the process that the IDE runs doesn't have sufficient permissions to access api.tabnine.com. And if it doesn't work - please attach the logs and we'll see what's up.

I have attached below a screen recoding of me performing the above instructions, hope it'll help: https://user-images.githubusercontent.com/67855609/219047879-4ac6294f-3c39-450b-a3c5-e639b3a4a35b.mp4

Kind regards, Yoni

Thank you for the method you provided, I have tried again according to your method, but I still cannot log in. I uploaded the latest log files to OneDrive for your analysis.

https://1drv.ms/t/s!AiEMXI0JFR4gcGUjc1wn4o2SOvs?e=YriUMQ

yonip23 commented 1 year ago

Hi @q920447939

I see in your logs that the process fails to connect to both api.tabnine.com and notify.tabnine.com, but from your git bash terminal, you are successfully connecting to at least api.tabnine.com, so there are probably no issues there. Let's try to understand if there's a difference between how and where the Tabnine process runs and your git bash -

  1. Where did you run the binary from when you ran it manually? cmd? git bash? does this terminal have admin permissions?
  2. Can you share your engine file path? maybe the binary is located somewhere where it doesn't have access to the proxy settings or something?
  3. Can you try to perform the connectivity checks (curl, ping, and nslookup) in a cmd that's open in the engine file path directory? (with and without admin permissions)
  4. Can you try to perform the connectivity checks from a terminal opened inside your IDE? to make sure that your IDE "inherits" all the necessary proxy config

I'm sorry for all the hustle, hope we solve this mystery soon 🙏🏻 Kind regards, Yoni

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.