Code Monkey home page Code Monkey logo

docker-python-geoserver's Introduction

Hi! My name is Massimiliano Moraca aka MaxDragonheart. Why MaxDragonheart? When was young I liked very much Dragonheart so, many years later, when social network era born I tried to use Dragonheart as name but it was busy. MaxDragonheart was free, simple. ๐Ÿ˜„

I'm an environmental engineer employed on GIS field as freelance. I'm fascinate from the Open Source world. Thanks the Open Source world I could learn the base of programming and thanks these skills I was able to learn to analyze GIS data using Python or SQL.

I try to return the gifts from Open Source world writing articles and tutorial for GIS field and, recently, sharing my projects on GitHub.

If you think I am worthy of your trust give me a sponsorship for one of my actual and future projects. Become a part of my community. ๐Ÿš€

docker-python-geoserver's People

Contributors

ixiodor avatar maxdragonheart avatar

Watchers

 avatar

docker-python-geoserver's Issues

Docker returns ConnectionError with OWSlib

When I try to use DOMAIN, WORKSPACE and LAYER_NAME from dockerized Geoserver I see the error below. The error doesn't appear if I use environment variables from any Geoserver's version outside this Docker container.

requests.exceptions.ConnectionError: 
HTTPConnectionPool(host='0.0.0.0', port=8300): 
Max retries exceeded with url: /geoserver/test/wms?service=WMS&request=GetCapabilities&version=1.3.0 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff4fa260130>: 
Failed to establish a new connection: [Errno 111] Connection refused'))

Traceback (most recent call last)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn

    conn = connection.create_connection(

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/util/connection.py", line 95, in create_connection

    raise err

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection

    sock.connect(sa)

    During handling of the above exception, another exception occurred:
    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen

    httplib_response = self._make_request(

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request

    conn.request(method, url, **httplib_request_kw)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request

    super(HTTPConnection, self).request(method, url, body=body, headers=headers)

    File "/usr/lib/python3.8/http/client.py", line 1256, in request

    self._send_request(method, url, body, headers, encode_chunked)

    File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request

    self.endheaders(body, encode_chunked=encode_chunked)

    File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders

    self._send_output(message_body, encode_chunked=encode_chunked)

    File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output

    self.send(msg)

    File "/usr/lib/python3.8/http/client.py", line 951, in send

    self.connect()

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect

    conn = self._new_conn()

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn

    raise NewConnectionError(

    During handling of the above exception, another exception occurred:
    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/requests/adapters.py", line 489, in send

    resp = conn.urlopen(

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen

    retries = retries.increment(

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment

    raise MaxRetryError(_pool, url, error or ResponseError(cause))

    During handling of the above exception, another exception occurred:
    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/flask/app.py", line 2548, in __call__

    return self.wsgi_app(environ, start_response)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/flask/app.py", line 2528, in wsgi_app

    response = self.handle_exception(e)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app

    response = self.full_dispatch_request()

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/flask/app.py", line 1822, in full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/flask/app.py", line 1820, in full_dispatch_request

    rv = self.dispatch_request()

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/flask/app.py", line 1796, in dispatch_request

    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)

    File "/app/web/app/app.py", line 13, in start_api

    output = get_wms_data(

    File "/app/web/app/api.py", line 32, in get_wms_data

    wms = WebMapService(url=wms_url, version=service_version)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/owslib/wms.py", line 54, in WebMapService

    return wms130.WebMapService_1_3_0(

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/owslib/map/wms130.py", line 75, in __init__

    self._capabilities = reader.read(self.url, timeout=self.timeout)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/owslib/map/common.py", line 65, in read

    u = openURL(spliturl[0], spliturl[1], method='Get',

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/owslib/util.py", line 208, in openURL

    req = requests.request(method.upper(), url_base, headers=headers, **rkwargs)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/requests/api.py", line 59, in request

    return session.request(method=method, url=url, **kwargs)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/requests/sessions.py", line 587, in request

    resp = self.send(prep, **send_kwargs)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/requests/sessions.py", line 701, in send

    r = adapter.send(request, **kwargs)

    File "/opt/.cache/virtualenvs/test-python-dockergeoserver-X9LT3yzX-py3.8/lib/python3.8/site-packages/requests/adapters.py", line 565, in send

    raise ConnectionError(e, request=request)

    requests.exceptions.ConnectionError: 
HTTPConnectionPool(host='0.0.0.0', port=8300): 
Max retries exceeded with url: /geoserver/test/wms?service=WMS&request=GetCapabilities&version=1.3.0 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff4fa260130>: 
Failed to establish a new connection: [Errno 111] Connection refused'))

The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.

To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

    dump() shows all variables in the frame
    dump(obj) dumps all that's known about the object

To reproduce the error:

  1. docker compose -f docker-compose.yml up -d --build

  2. loggin into Geoserver http://0.0.0.0:8300/geoserver using:

    • user: admin
    • password: geoserver
  3. create a new workspace: click on Workspace > Add new workspace here the official guide:

    • Name: test
    • Namespace URI: /
    • Click on Save
  4. create a new store: click on Stores > Add new Store and click on WMS here the official guide:

    4.1. publish WMS: click on Publish near atacama_20160108

  5. stop project: docker compose -f docker-compose.yml stop

  6. change environment variable: go to .env:

  7. restart project: docker compose -f docker-compose.yml up -d --build

  8. go to http://0.0.0.0:8301/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.