Giter Site home page Giter Site logo

Comments (4)

yorkfrog avatar yorkfrog commented on June 15, 2024

Hi. I have reproduced this the following setup

OS: Ubuntu 18.04
QGIS Version : 3.6.3
Plugin Version : 3.13

The only difference was that it took about 3 - 4 minutes for the timeout to occur during which time GQIS hung - I guess linux socket timeouts are longer than windows.

Exception report on Ubuntu platform below:

An error has occurred while executing Python code: 

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='kf.kobotoolbox.orgapi', port=443): Max retries exceeded with url: /v2/assets/aheLFLyScVzsFRNRHPHzT4/permission-assignments/ (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out',)) 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 852, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='kf.kobotoolbox.orgapi', port=443): Max retries exceeded with url: /v2/assets/aheLFLyScVzsFRNRHPHzT4/permission-assignments/ (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime.py", line 286, in sendForm
    service.prepareSendForm(layer)
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime_dialog.py", line 640, in prepareSendForm
    self.sendForm(layer.name(),payload)
  File "/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime/QRealTime_dialog.py", line 677, in sendForm
    response3 = requests.post(urlShare, json=permissions, auth=(user,password),headers=headers)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 520, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 630, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='kf.kobotoolbox.orgapi', port=443): Max retries exceeded with url: /v2/assets/aheLFLyScVzsFRNRHPHzT4/permission-assignments/ (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out',))


Python version: 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0] 
QGIS version: 3.6.3-Noosa Noosa, 0c5774c 

Python Path:
/usr/share/qgis/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python36.zip
/usr/lib/python3.6
/usr/lib/python3.6/lib-dynload
/home/colin/.local/lib/python3.6/site-packages
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python
/home/colin/.local/share/QGIS/QGIS3/profiles/default/python/plugins/QRealTime
/home/colin/proj/qgis-test/relations

QRealTime output:

2020-05-28T16:41:52     INFO    not writing fieldsNone
2020-05-28T16:41:52     INFO    'type'None
2020-05-28T16:41:52     INFO    getFieldModelTextEdit
2020-05-28T16:41:52     INFO    getFieldModelTextEdit
2020-05-28T16:41:52     INFO    getFieldModelTextEdit
2020-05-28T16:41:52     INFO    getFieldModelTextEdit
2020-05-28T16:41:52     INFO    getFieldModelExternalResource
2020-05-28T16:41:52     INFO    got an image type fieldNone
2020-05-28T16:41:52     INFO    getFieldModelTextEdit
2020-05-28T16:41:52     INFO    getFieldModelTextEdit
2020-05-28T16:41:52     INFO    getFieldModelTextEdit
2020-05-28T16:41:52     INFO    getFieldModelExternalResource
2020-05-28T16:41:52     INFO    got an image type fieldNone
2020-05-28T16:41:52     INFO    getFieldModelTextEdit
2020-05-28T16:41:52     INFO    fieldDict[{'type': 'geopoint', 'required': True, 'label': 'Point Location'}, {'name': 'id', 'label': 'id', 'type': 'integer'}, {'name': 'text1', 'label': 'text1', 'type': 'text'}, {'name': 'int1', 'label': 'int1', 'type': 'integer'}, {'name': 'decimal1', 'label': 'decimal1', 'type': 'decimal'}, {'name': 'image1', 'label': 'image1', 'type': 'image'}, {'name': 'text2', 'label': 'text2', 'type': 'text'}, {'name': 'int2', 'label': 'int2', 'type': 'integer'}, {'name': 'decimal2', 'label': 'decimal2', 'type': 'decimal'}, {'name': 'image2', 'label': 'image2', 'type': 'image'}, {'name': 'text3', 'label': 'text3', 'type': 'text'}]
2020-05-28T16:41:52     INFO    Payload= {'uid': 'test-qrt-to-kobo-export', 'name': 'test-qrt-to-kobo-export', 'asset_type': 'survey', 'content': '{"survey": [{"type": "geopoint", "required": true, "label": "Point Location"}, {"name": "id", "label": "id", "type": "integer"}, {"name": "text1", "label": "text1", "type": "text"}, {"name": "int1", "label": "int1", "type": "integer"}, {"name": "decimal1", "label": "decimal1", "type": "decimal"}, {"name": "image1", "label": "image1", "type": "image"}, {"name": "text2", "label": "text2", "type": "text"}, {"name": "int2", "label": "int2", "type": "integer"}, {"name": "decimal2", "label": "decimal2", "type": "decimal"}, {"name": "image2", "label": "image2", "type": "image"}, {"name": "text3", "label": "text3", "type": "text"}], "choices": []}'}

from qrealtime.

yorkfrog avatar yorkfrog commented on June 15, 2024

re your comment which I can't see here:
"It seems to be network connection issue. Can you please check the server url."

In the steps to reproduce I note the url being used.

When URL is https://kf.kobotoolbox.org/ (with trailing slash) - it works ok
When URL is https://kf.kobotoolbox.org (NO trailing slash) - it throws the error noted.

Agreed it is ultimately generating a network timeout but it is strange that the first part of the code works - it creates the form on kobo regardless, but a later bit of code fails somewhere. I wonder if the first part appends a slash if not there, but the later part does not thus creating an invalid URL that timeouts?

thanks, Colin

from qrealtime.

yorkfrog avatar yorkfrog commented on June 15, 2024

hi, just looking at the error again I think we can see the invalid url address being requested:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='kf.kobotoolbox.orgapi', port=443): Max retries exceeded with url: /v2/assets/a3z6GvwvPfnf5tMb3tzYCn/permission-assignments/ (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out',))

shows: host='kf.kobotoolbox.orgapi'

I suspect that is supposed to be host='kf.kobotoolbox.org/api'

C-

from qrealtime.

shivareddyiirs avatar shivareddyiirs commented on June 15, 2024

Thanks for exhaustive testing. Next release this bug but would also be removed

from qrealtime.

Related Issues (20)

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.