Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Self hosted build fails #5

Open
grahamd711 opened this issue Jan 14, 2020 · 2 comments
Open

Self hosted build fails #5

grahamd711 opened this issue Jan 14, 2020 · 2 comments

Comments

@grahamd711
Copy link

grahamd711 commented Jan 14, 2020

Hello!

We are trying to use your self hosted version on Heroku: https://elements.heroku.com/buttons/madisvain/geolocationapi

We get build errors. Any idea how to fix?

-----> Python app detected -----> Installing python-3.7.6 -----> Installing pip -----> Installing dependencies with Pipenv 2018.5.18… Installing dependencies from Pipfile.lock (f05404)… -----> Installing SQLite3 Sqlite3 successfully installed. -----> Running post-compile hook Traceback (most recent call last): File "/app/.heroku/python/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw) File "/app/.heroku/python/lib/python3.7/site-packages/urllib3/util/connection.py", line 57, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/app/.heroku/python/lib/python3.7/socket.py", line 752, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/.heroku/python/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/app/.heroku/python/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/app/.heroku/python/lib/python3.7/http/client.py", line 1252, in request self._send_request(method, url, body, headers, encode_chunked) File "/app/.heroku/python/lib/python3.7/http/client.py", line 1298, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/app/.heroku/python/lib/python3.7/http/client.py", line 1247, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/app/.heroku/python/lib/python3.7/http/client.py", line 1026, in _send_output self.send(msg) File "/app/.heroku/python/lib/python3.7/http/client.py", line 966, in send self.connect() File "/app/.heroku/python/lib/python3.7/site-packages/urllib3/connection.py", line 181, in connect conn = self._new_conn() File "/app/.heroku/python/lib/python3.7/site-packages/urllib3/connection.py", line 168, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fdb9f479bd0>: Failed to establish a new connection: [Errno -2] Name or service not known During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/.heroku/python/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/app/.heroku/python/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/app/.heroku/python/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='geolite.maxmind.com', port=80): Max retries exceeded with url: /download/geoip/database/GeoLite2-Country.tar.gz (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdb9f479bd0>: Failed to establish a new connection: [Errno -2] Name or service not known')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "release.py", line 11, in <module> r = requests.get(GEOIP2_DB_URL) File "/app/.heroku/python/lib/python3.7/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/app/.heroku/python/lib/python3.7/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/app/.heroku/python/lib/python3.7/site-packages/requests/sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "/app/.heroku/python/lib/python3.7/site-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/app/.heroku/python/lib/python3.7/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='geolite.maxmind.com', port=80): Max retries exceeded with url: /download/geoip/database/GeoLite2-Country.tar.gz (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdb9f479bd0>: Failed to establish a new connection: [Errno -2] Name or service not known')) ! Push rejected, failed to compile Python app. ! Push failed

It seems it cannot fetch the required country file: https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz

@madisvain
Copy link
Contributor

@grahamd711 this seems to be because of law changes.

Please read the following update from MaxMind:
https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/

I have not had myself the time to read it. Probably a pull request with a more complex logic for downloading the database would be required for automated Heroku setups.

@thehamsti
Copy link

thehamsti commented Jan 19, 2020

See #6 for working fix.

Note: Not working for unknown other reasons but download is fixed...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants