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

PlatformIO update fails behind proxy #1061

Closed
ADeeds opened this Issue Sep 12, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@ADeeds

ADeeds commented Sep 12, 2017


Configuration

Operating system:

OSX 10.11.6

PlatformIO Version (platformio --version):

3.4.1

Description of problem

the platformio update command fails when used behind a proxy, even when $http_proxy & friends are properly configured. I belief this is because the internet_on function in util.py tries to make a direct socket connection and barfs when it hits the proxy

Steps to Reproduce

  1. Install platformio on a computer that is connected to the internet via a proxy
  2. Install some libraries, boards, etc. (platformio install doesn't check the internet_on function, so it works as expected)
  3. Run platformio update. Every package shows "off-line" as the status and never gets updated (unless you uninstall it and reinstall)

Actual Results

Every package shows as [Off-line]

Expected Results

[Up-to-date] or whatever it says when packages are out of date (and ideally it would update stuff that was old)

If problems with PlatformIO Build System:

Source file to reproduce issue:

import urllib2
import socket

timeout = 3;
try:
	socket.setdefaulttimeout(timeout)
	socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect(('example.com', 80))
	print('yay')
except:
	print('no')
try:
	urllib2.urlopen('http://example.com', timeout=timeout)
	print('yay')
except:
	print('no')

Additional info

Replacing the direct socket stuff with urllib2 as shown in the example above seems to do the right thing on my end. Plus I think it fixes any future issue with ipv6 compatibility :)

@ivankravets ivankravets added this to the 3.5.0 milestone Sep 15, 2017

@ivankravets ivankravets added the bug label Sep 15, 2017

@ivankravets

This comment has been minimized.

Member

ivankravets commented Sep 16, 2017

Thanks a lot for the report! I don't know why didn't use requests directly.

Please re-test http://docs.platformio.org/en/latest/installation.html#development-version

@ivankravets

This comment has been minimized.

Member

ivankravets commented Sep 16, 2017

Fixed in fc7f1c0

@ADeeds

This comment has been minimized.

ADeeds commented Sep 18, 2017

Works great, thanks!

ivankravets added a commit that referenced this issue Dec 28, 2017

Bump version to 3.5.0 (issue #1260, issue #781, issue #778, issue #463,…
… issue #1236, issue #1235, issue #953, issue #1118, issue #1107, issue #1196, issue #1179, issue #1161, issue #1126, issue #104, issue #1033, issue #1034, issue #1175, issue #1173, issue #1155, issue #1188, issue #1111, issue #1153, issue #1150, issue #1145, issue #1139, issue #1137, issue #1170, issue #1157, issue #1102, issue #1105, issue #1140, issue #1154, issue #1066, issue #1038, issue #1054, issue #1055, issue #1061, issue #1017)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment