GeoCat / qgis-bridge-plugin

GeoCat Bridge is a plugin for QGIS that can be used to publish geospatial (meta)data to the cloud.
https://geocat.github.io/qgis-bridge-plugin/
GNU General Public License v3.0
36 stars 17 forks source link

error while publishing to live-geoserver #84

Closed camilo2004 closed 4 years ago

camilo2004 commented 4 years ago

when publishing to live a yellow bar is shown with an error message in python log:

2020-02-13T15:11:36     INFO    Making post request to 'https://camilotest.geocat.live/geoserver/rest/workspaces'
2020-02-13T15:11:38     CRITICAL    Traceback (most recent call last):
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\connection.py", line 171, in _new_conn
              (self._dns_host, self.port), self.timeout, **extra_kw)
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\util\connection.py", line 79, in create_connection
              raise err
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\util\connection.py", line 69, in create_connection
              sock.connect(sa)
             ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

             During handling of the above exception, another exception occurred:

             Traceback (most recent call last):
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
              chunked=chunked)
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
              self._validate_conn(conn)
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 849, in _validate_conn
              conn.connect()
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\connection.py", line 314, in connect
              conn = self._new_conn()
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\connection.py", line 180, in _new_conn
              self, "Failed to establish a new connection: %s" % e)
             urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it

             During handling of the above exception, another exception occurred:

             Traceback (most recent call last):
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\requests\adapters.py", line 445, in send
              timeout=timeout
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
              _stacktrace=sys.exc_info()[2])
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\urllib3\util\retry.py", line 398, in increment
              raise MaxRetryError(_pool, url, error or ResponseError(cause))
             urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='camilotest.geocat.live', port=443): Max retries exceeded with url: /geoserver/rest/workspaces (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

             During handling of the above exception, another exception occurred:

             Traceback (most recent call last):
              File "C:/Users/Camilo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\geocatbridge\publish\publishtask.py", line 102, in run
              self.geodataServer.prepareForPublishing(self.onlySymbology)
              File "C:/Users/Camilo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\geocatbridge\publish\geocatlive.py", line 69, in prepareForPublishing
              self.geoserverServer().prepareForPublishing(onlySymbology)
              File "C:/Users/Camilo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\geocatbridge\publish\geoserver.py", line 59, in prepareForPublishing
              self._ensureWorkspaceExists()
              File "C:/Users/Camilo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\geocatbridge\publish\geoserver.py", line 433, in _ensureWorkspaceExists
              self.request(url, data=ws, method="post")
              File "C:/Users/Camilo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\geocatbridge\publish\serverbase.py", line 60, in request
              r = req_method(url, headers=headers, files=files, data=data, auth=(username, password))
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\requests\api.py", line 112, in post
              return request('post', url, data=data, json=json, **kwargs)
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\requests\api.py", line 58, in request
              return session.request(method=method, url=url, **kwargs)
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\requests\sessions.py", line 512, in request
              resp = self.send(prep, **send_kwargs)
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\requests\sessions.py", line 622, in send
              r = adapter.send(request, **kwargs)
              File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\requests\adapters.py", line 513, in send
              raise ConnectionError(e, request=request)
             requests.exceptions.ConnectionError: HTTPSConnectionPool(host='camilotest.geocat.live', port=443): Max retries exceeded with url: /geoserver/rest/workspaces (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

2020-02-13T15:11:42     INFO    Making 'get' request to 'https://camilotest.geocat.live/geonetwork/srv/api/records/31f60110-480f-5a7a-9738-6be655d8aefe'
pvgenuchten commented 4 years ago

On the same device in a later step we were not able to connect to the server, it failed connecting, no details on why the connection failed. We should consider an error like this can always occur, and show a friendly message to the user: "server unavailable, are you sure it's running? check your firewall/proxy settings"