ethereum/py-geth

403 when installing geth

Closed this issue · 2 comments

What happened?

Using the install command python -m geth.install v1.11.6 now fails with 403.
I noticed all my requests to GitHub using wget are failing this way now.

I am selfishly creating this issue here in hopes to have help in knowing how to fix this elsewhere because I know it is a documented feature of this library. Also I am curious if you came across this in web3.py CI/CD or something allike.

Code that produced the error

python -m geth.install v1.11.6

Full error output

File "/Users/jules/virtualenvs/ape310/lib/python3.10/site-packages/geth/install.py", line 319, in install_from_source_code_release
    download_source_code_release(identifier)
  File "/Users/jules/virtualenvs/ape310/lib/python3.10/site-packages/geth/install.py", line 244, in download_source_code_release
    return check_subprocess_call(
  File "/Users/jules/virtualenvs/ape310/lib/python3.10/site-packages/geth/install.py", line 129, in check_subprocess_call
    return subprocess.check_call(command, stderr=stderr, **proc_kwargs)
  File "/Users/jules/.pyenv/versions/3.10.12/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['wget', 'https://github.com/ethereum/go-ethereum/archive/v1.11.6.tar.gz', '-c', '-O', '/Users/jules/.py-geth/geth-v1.11.6/release.tar.gz']' returned non-zero exit status 8.
...

but if you set a breakpoint, read the command like " ".join(command), and paste that command in your terminal separately, you can set a bit more:


Connecting to codeload.github.com (codeload.github.com)|140.82.113.9|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2023-08-28 11:42:23 ERROR 403: Forbidden.

Fill this section in if you know how this could or should be fixed

I tried using auth, didn't work.
I heard user-agent may be required, but i couldnt get that to work either.
It does work in my browser, so perhaps I can copy the headers there and remove them one by one until github server is happy again. But again, I figured yall would have came across the issue independently.

I am getting this error both locally when using wget as well as in ci/cd

py-geth Version

3.13.0

Python Version

3.10.12

Operating System

macos

Output from pip freeze

you asked for it:

abnf==1.1.1
aiohttp==3.8.5
aiosignal==1.3.1
aiosqlite==0.18.0
alembic==1.11.3
anyio==3.7.1
ape-alchemy==0.6.2
-e git+ssh://git@github.com/unparalleled-js/ape-arbitrum.git@9864da84e3b825578cf2bc32027877c01f5f95a1#egg=ape_arbitrum
ape-avalanche==0.6.3
ape-bsc==0.6.1
ape-ens==0.6.1
ape-etherscan==0.6.9
ape-foundry==0.6.14
ape-ganache==0.6.8
ape-hardhat==0.6.12
ape-infura==0.6.3
ape-optimism==0.6.2
ape-polygon==0.6.5
-e git+ssh://git@github.com/antazoey/ape-safe.git@5d9190c44ec2ee8a3dc9e4dca27cb95a2dda74f4#egg=ape_safe
-e git+ssh://git@github.com/ApeWorX/ape-silverback.git@d306af2988cbd94549c1ebb7af3ebed3dda09956#egg=ape_silverback
-e git+ssh://git@github.com/unparalleled-js/ape-solidity.git@2abd3c380ca934e8688ebe404387f117e0cf096c#egg=ape_solidity
ape-tokens==0.6.2
-e git+ssh://git@github.com/antazoey/ape-vyper.git@a7255e0cbd805afa25cb61c6d257d4dcf5f79fcc#egg=ape_vyper
apepay==0.1.1
appnope==0.1.3
asttokens==2.2.1
async-generator==1.10
async-timeout==4.0.3
asyncer==0.0.2
attrs==23.1.0
awscli==1.29.29
backcall==0.2.0
base58==1.0.3
bcrypt==4.0.1
bitarray==2.8.1
black==23.7.0
boto3==1.28.29
botocore==1.31.29
build==0.10.0
CacheControl==0.13.1
cached-property==1.5.2
certifi==2023.7.22
cffi==1.15.1
cfgv==3.4.0
-e git+ssh://git@github.com/ApeWorX/cHaOSneT.git@e184460e44b8c39d4e80bb412f311f714bfa93f7#egg=chaosnet
charset-normalizer==3.2.0
chompjs==1.2.2
cleo==2.0.1
click==8.1.7
colorama==0.4.4
commonmark==0.9.1
coverage==7.3.0
crashtest==0.4.1
cryptography==41.0.3
cytoolz==0.12.2
dataclassy==0.11.1
decorator==5.1.1
Deprecated==1.2.14
distlib==0.3.7
dnspython==2.4.2
docopt==0.6.2
docutils==0.16
dulwich==0.21.5
eip712==0.2.1
email-validator==2.0.0.post2
eth-abi==4.1.0
eth-account==0.8.0
eth-ape @ file:///Users/jules/PycharmProjects/more_apes/1/ape
eth-bloom==2.0.0
eth-hash==0.5.2
eth-keyfile==0.6.1
eth-keys==0.4.0
eth-rlp==0.3.0
eth-tester==0.9.1b1
eth-typing==3.4.0
eth-utils==2.2.0
ethpm-types==0.5.4
evm-trace==0.1.0a22
exceptiongroup==1.1.3
execnet==2.0.2
executing==1.2.0
Faker==18.13.0
fastapi==0.92.0
fastapi-login==1.9.1
filelock==3.12.2
flake8==6.1.0
flake8-breakpoint==1.1.0
flake8-plugin-utils==1.3.3
flake8-print==4.0.1
frozenlist==1.4.0
greenlet==2.0.2
h11==0.14.0
hexbytes==0.3.1
httpcore==0.16.3
httpx==0.23.3
hypothesis==6.82.6
identify==2.5.27
idna==3.4
ijson==3.2.3
importlib-metadata==6.8.0
iniconfig==2.0.0
installer==0.7.0
ipython==8.14.0
isort==5.12.0
jaraco.classes==3.3.0
jedi==0.19.0
jmespath==1.0.1
jsonschema==4.19.0
jsonschema-specifications==2023.7.1
keyring==24.2.0
lazyasd==0.1.4
linkify-it-py==2.0.2
lru-dict==1.2.0
Mako==1.2.4
markdown-it-py==2.2.0
MarkupSafe==2.1.3
matplotlib-inline==0.1.6
mccabe==0.7.0
mdformat==0.7.17
mdformat-gfm==0.3.5
mdformat_frontmatter==2.0.1
mdformat_pyproject==0.0.1
mdformat_tables==0.4.1
mdit-py-plugins==0.3.5
mdurl==0.1.2
more-itertools==10.1.0
morphys==1.0
msgpack==1.0.5
msgspec==0.18.1
multidict==6.0.4
mypy==1.5.1
mypy-extensions==1.0.0
nodeenv==1.8.0
numpy==1.25.2
outcome==1.2.0
packaging==23.1
pandas==1.5.3
pandas-stubs==1.2.0.62
parsimonious==0.9.0
parso==0.8.3
passlib==1.7.4
pathspec==0.11.2
pexpect==4.8.0
pickleshare==0.7.5
pkginfo==1.9.6
platformdirs==3.10.0
pluggy==1.3.0
poetry==1.6.1
poetry-core==1.7.0
poetry-plugin-export==1.5.0
pre-commit==3.3.3
prometheus-client==0.17.1
prompt-toolkit==3.0.39
protobuf==4.24.0
psycopg2-binary==2.9.7
ptyprocess==0.7.0
pure-eval==0.2.2
py-cid==0.3.0
py-ecc==6.0.0
py-evm==0.7.0a4
py-geth==3.13.0
py-multibase==1.0.3
py-multicodec==0.2.1
py-multihash==0.2.3
py-solc-x==1.1.1
pyasn1==0.5.0
pycodestyle==2.11.0
pycparser==2.21
pycron==3.0.0
pycryptodome==3.18.0
pydantic==1.10.12
pyethash==0.1.27
pyflakes==3.1.0
PyGithub==1.59.1
Pygments==2.16.1
PyJWT==2.8.0
PyNaCl==1.5.0
pyproject_hooks==1.0.0
pyrsistent==0.19.3
pytest==7.4.0
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-watch==4.2.0
pytest-xdist==3.3.1
python-baseconv==1.2.2
python-dateutil==2.8.2
python-multipart==0.0.6
pytz==2023.3
pyunormalize==15.0.0
PyYAML==6.0.1
rapidfuzz==2.15.1
referencing==0.30.2
regex==2023.8.8
requests==2.31.0
requests-toolbelt==1.0.0
rfc3986==1.5.0
rfc3987==1.3.8
rich==12.6.0
rlp==3.0.0
rpds-py==0.9.2
rsa==4.7.2
ruamel.yaml==0.17.32
ruamel.yaml.clib==0.2.7
s3transfer==0.6.2
safe-pysha3==1.0.4
semantic-version==2.10.0
shellingham==1.5.3
silverback==0.1.0b11
siwe==2.2.0
six==1.16.0
sniffio==1.3.0
sortedcontainers==2.4.0
SQLAlchemy==1.4.41
sqlalchemy2-stubs==0.0.2a35
sqlmodel==0.0.8
stack-data==0.6.2
starlette==0.25.0
taskiq==0.6.0
taskiq-dependencies==1.3.1
tokenlists==0.1.4
tomli==2.0.1
tomlkit==0.12.1
toolz==0.12.0
tqdm==4.66.1
traitlets==5.9.0
trie==2.1.1
trio==0.21.0
trove-classifiers==2023.8.7
types-PyYAML==6.0.12.11
types-requests==2.31.0.2
types-setuptools==68.1.0.0
types-SQLAlchemy==1.4.53.38
types-urllib3==1.26.25.14
typing_extensions==4.5.0
uc-micro-py==1.0.2
urllib3==1.26.16
uvicorn==0.20.0
varint==1.0.2
virtualenv==20.24.3
vvm==0.1.0
watchdog==3.0.0
wcwidth==0.2.6
web3==6.8.0
websockets==11.0.3
wrapt==1.15.0
xattr==0.10.1
yarl==1.9.2
zipp==3.16.2

It is working again!
Although we may want to allow different installer-providers here in the case one works and the other doesn't

Or honestly - we should be using requests or a more pythonic approach to installing