Skip to content

Proxy configuration not saved #7573

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

Closed
matthjes opened this issue May 7, 2018 · 25 comments
Closed

Proxy configuration not saved #7573

matthjes opened this issue May 7, 2018 · 25 comments
Assignees
Labels

Comments

@matthjes
Copy link

matthjes commented May 7, 2018

Hi,

I'm working behind a corporate proxy, so I need to configure the proxy in the IDE. However, when I enter the proxy credentials, close the configuration window, and reopen it again, the credentials are missing. This also happens when I enter the credentials directly into the preferences.txt: as soon as I restart the IDE the credentials get erased.

This happens with version 1.8.5 and 1.9.0 beta.

This problem is also described in this thread: https://forum.arduino.cc/index.php?topic=392432.0

@facchinm
Copy link
Member

Hi @matthjes ,
it looks quite strange; a possible explanation is that you don't have write access to your user-wide preferences.txt (which lives in Arduino15 folder, the exact location depends on the operating system in use, C:\Users\username\AppData\Local\Arduino15 in case you are in Windows).
Just to make sure, if you change any other property (like the sketchbook location or the verbosity) are they getting saved on restart?

@facchinm facchinm added the Waiting for feedback More information must be provided before we can proceed label Jun 28, 2018
@per1234
Copy link
Collaborator

per1234 commented Sep 26, 2018

@matthjes are you still having this problem? We're still waiting for you to provide the information requested by facchinm.

@per1234
Copy link
Collaborator

per1234 commented Nov 3, 2018

I can reproduce this problem with Arduino IDE 1.8.7 hourly build 2018/10/24 04:33 and Arduino 1.9.0-beta build 87 using Windows 10.

  1. Delete or rename your preferences.txt file to simulate a fresh installation. You can find the location of preferences.txt by clicking the link at the line following [File > Preferences > More preferences can be edited directly in the file.
  2. File > Preferences
  3. Click on the "Network" tab.
  4. Select "Manual Proxy Configuration"
  5. Enter something in all the input fields.
  6. Click "OK"
  7. File > Preferences
  8. Click on the "Network" tab. The Manual Proxy Configuration Username and Password fields are empty.
  9. Click "OK"
  10. File > Quit
  11. Open preferences.txt. The proxy.manual.password and proxy.manual.username properties are blank.
  12. Start the Arduino IDE.
  13. File > Preferences
  14. Click on the "Network" tab.
  15. Select "Auto-detect proxy settings".
  16. Enter something in all fields.
  17. Click "OK"
  18. File > Preferences
  19. Click on the "Network" tab. The Auto-detect proxy settings Username and Password fields are still filled.
  20. Click "OK"
  21. File > Quit
  22. Open preferences.txt. The proxy.manual.password and proxy.manual.username properties are set to the values you entered in the Auto-detect proxy settings Username and Password fields.
  23. Start the Arduino IDE.
  24. File > Preferences
  25. Click on the "Network" tab.
  26. Select "Manual Proxy Configuration"
  27. Click "OK"
  28. File > Preferences
  29. Click on the "Network" tab. The Manual Proxy Configuration Username and Password fields are now filled with the values you entered in the Auto-detect proxy settings Username and Password fields.

So there is clearly a bug in the Manual Proxy Configuration system. There is no problem writing any other preference and even proxy.manual.hostname and proxy.manual.port work as expected.

It's also not clear whether it was intentional for Auto-detect proxy settings and Manual Proxy Configuration to share the same proxy.manual.username and proxy.manual.password properties or that's a bug.

@per1234 per1234 removed the Waiting for feedback More information must be provided before we can proceed label Nov 3, 2018
@facchinm facchinm added this to the Release 1.8.8 milestone Nov 13, 2018
@solarjoe
Copy link

solarjoe commented Jan 24, 2019

I can confirm this behaviour on Win10, IDE 1.8.8
Auto-config writes and reads to the manual fieldes in preferences.txt.

Also behind a corporate firewal wall and must use a proxy with authentification. I tried several combinations in GUI and preferences.txt without success.

Does the auto configuration also look for the environment variables HTTP_PROXY or HTTPS_PROXY on Windows?

@solarjoe
Copy link

I can download the http://downloads.arduino.cc/packages/package_index.json from my browser and I tried to configure the Arduino IDE the same way, without luck.

When trying to update the boards list I get

Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"

I noticed in another thread (#5887) that it could also show something like

Using proxy HTTP @ /192.168.0.254:3128
Caused by: java.io.IOException: Received invalid http status code from server: 416

This is the section from my perferences.txt:

proxy.manual.hostname=x.x.x.x
proxy.manual.password=xxxx
proxy.manual.port=8080
proxy.manual.type=HTTP
proxy.manual.username=xxxx
proxy.pac.url=
proxy.type=manual

@solarjoe
Copy link

@facchinm
Copy link
Member

@solarjoe it might indeed be the case. Since you are on Windows it's a bit tricky to modify that config on the fly but I'm preparing a PR so you can test it and report if jdk.http.auth.tunneling is the culprit.

@facchinm
Copy link
Member

PR created here #8436 , binaries should be ready in an hour more or less.

@solarjoe
Copy link

I just tested this and it works when I add

-Djdk.http.auth.tunneling.disabledSchemes=""

to the file arduino.l4j.ini or arduino_deubg.l4j.ini where you can pass additional parameters, see
http://launch4j.sourceforge.net/docs.html#Additional_jvm_options

@solarjoe
Copy link

I was not testing the new binaries, just modified the installation I had (1.8.8).

@facchinm
Copy link
Member

If you could test the PR binaries it would be better since every OS has its own different launcher and adding flags is a bit tricky in some of them (OSX for example)

@solarjoe
Copy link

solarjoe commented Jan 25, 2019

Yes, that seems to fix it for me, but only if I enter the following parameters in the preferences.txt
before launching the IDE:

proxy.manual.password=abc
proxy.manual.username=def

These values are not saved when entered in the GUI, but they are read correctly from the file into the GUI if already present.

@ThomasBe
Copy link

ThomasBe commented Feb 1, 2019

I just tested this and it works when I add

-Djdk.http.auth.tunneling.disabledSchemes=""

to the file arduino.l4j.ini or arduino_deubg.l4j.ini where you can pass additional parameters, see
http://launch4j.sourceforge.net/docs.html#Additional_jvm_options

I had the same issue and until 1.8.7 everything was fine. With 1.8.8. I try a lot to get my proxy settings working again.

By just adding the mentioned line into arduino_deubg.l4j.ini everything is fine with the same settings like with 1.8.7.

@solarjoe
Copy link

solarjoe commented Feb 1, 2019

@ThomasBe, do you also see the issue with the proxy setting not being saved when you enter them in the UI?

@ThomasBe
Copy link

ThomasBe commented Feb 1, 2019

@solarjoe , I only use the "auto_proxy_part" and everything works regarding modyfing in GUI or via preferences.txt.

@JorinL
Copy link

JorinL commented Feb 4, 2019

With PR #8436 I have the following experience going through the steps from above:

Filling the manual proxy config with "abc" clicking ok and opening it again shows only hostname and port filled.
looking into the preferences.txt shows:

proxy.manual.hostname=
proxy.manual.password=
proxy.manual.port=
proxy.manual.type=HTTP
proxy.manual.username=
proxy.pac.url=
proxy.type=none

First thought caused by my job - I should not be able to fill in "abc" into a pure number field :-D
Event with a number in it only hostname and port is saved in the gui

Filling the auto proxy config with "abc" clicking ok and opening it again shows everything filled.
looking into the preferences.txt shows:

proxy.manual.hostname=
proxy.manual.password=
proxy.manual.port=
proxy.manual.type=HTTP
proxy.manual.username=
proxy.pac.url=
proxy.type=none

No Proxy shows me nothing special in the config but stays selected in the gui even after reopening

@Thomseeen
Copy link

Beeing on Unbuntu 18.04 with Arduino 1.8.9 I managed to make the IDE remember my proxy credentials by editing the preferences.txt but i still get the "HTTP/1.0 407 Proxy Authentication Required" error.

I just tested this and it works when I add

-Djdk.http.auth.tunneling.disabledSchemes=""

to the file arduino.l4j.ini or arduino_deubg.l4j.ini where you can pass additional parameters, see
http://launch4j.sourceforge.net/docs.html#Additional_jvm_options

Can someone help me find those .ini-files to add the needed launch parameters to my 1.8.9 installation?

@solarjoe
Copy link

solarjoe commented Apr 4, 2019

Should be in the same folder as your Arduino IDE binary.

@Thomseeen
Copy link

On my Win10-machine, yes, under Ubuntu, sadly not...

@facchinm
Copy link
Member

@solarjoe @JorinL @ThomasBe @Thomseeen @matthjes could you give a spin to latest IDE 1.8.10 and report if the proxies are still not applied?
#9023 is included and was meant to solve most of the downloads issues.

@ThomasBe
Copy link

@solarjoe @JorinL @ThomasBe @Thomseeen @matthjes could you give a spin to latest IDE 1.8.10 and report if the proxies are still not applied?
#9023 is included and was meant to solve most of the downloads issues.

I checked 'my problems' with the latest version (1.8.10) and internet connection stuff works fine for me without any additional work around.

So I just entered my network settings using the automatic configuration via configuration url.

@facchinm
Copy link
Member

@TomasRoj thanks a lot for testing. I'm closing this as fixed, if it's not please comment here and we'll reopen it.

@QGB
Copy link

QGB commented Sep 24, 2022

@facchinm
i am using arduino-ide_2.0.0_Windows_64bit . encountered the same problem

the proxy host and port is saved in preferences.txt.
after arduino-ide restart, the proxy setting not display

正在下载 [email protected]
Failed to install library: 107-Arduino-APDS-9950:1.0.0.
Error: 13 INTERNAL: 无法下载库: Get "https://downloads.arduino.cc/libraries/github.com/107-systems/107_Arduino_APDS_9950-1.0.0.zip": proxyconnect tcp: dial tcp :0: connectex: The requested address is not valid in its context.

@per1234
Copy link
Collaborator

per1234 commented Sep 24, 2022

Hi @QGB. Arduino IDE 2.x uses a completely different preferences store from Arduino IDE 1.x. The preferences.txt file is completely ignored by Arduino IDE 2.x, so it is expected that the proxy configuration from that file has no effect on Arduino IDE 2.x.

You can configure the proxy of Arduino IDE 2.x by doing the following:

  1. Select File > Preferences... from the Arduino IDE menus.
  2. Click the "Network" tab.
  3. Select the "Manual proxy configuration" radio button.
  4. Configure proxy as needed for your network.
  5. Click the OK button.

If you have any questions or problems, please post over on the Arduino Forum. I'll be glad to help you out over there:

https://forum.arduino.cc/c/software/arduino-ide-2-0/93

@QGB
Copy link

QGB commented Sep 24, 2022

I delete all C:\Users\qgb\AppData\Local\Arduino15 and still not work .

I have to manually download and save to cache file

C:\Users\qgb\AppData\Local\Arduino15\staging\packages\esp32-2.0.5.zip

@arduino arduino locked as resolved and limited conversation to collaborators Sep 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants