Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No internet connection problem with add-on manager #6744

Open
kodymoodley opened this issue Feb 21, 2024 · 13 comments
Open

No internet connection problem with add-on manager #6744

kodymoodley opened this issue Feb 21, 2024 · 13 comments
Labels
bug report Bug is reported by user, not yet confirmed by the core team

Comments

@kodymoodley
Copy link

kodymoodley commented Feb 21, 2024

What's wrong?

There's an issue with the internet connection.

Traceback (most recent call last):
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/orangecanvas/application/addons.py", line 510, in <lambda>
lambda config=config: (config, list_available_versions(config)),
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/orangecanvas/application/utils/addons.py", line 369, in list_available_versions
response = session.get(PYPI_API_JSON.format(name=p))
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/session.py", line 102, in get
return self.request('GET', url, params=params, **kwargs)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/session.py", line 158, in request
return super().request(method, url, *args, headers=headers, **kwargs)  # type: ignore
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/session.py", line 194, in send
actions.update_from_cached_response(cached_response, self.cache.create_key, **kwargs)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/policy/actions.py", line 184, in update_from_cached_response
usable_response = self.is_usable(cached_response)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/policy/actions.py", line 152, in is_usable
or (cached_response.is_expired and self._stale_while_revalidate is True)
File "/Applications/Orange.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_cache/models/response.py", line 149, in is_expired
return self.expires is not None and datetime.utcnow() >= self.expires
TypeError: can't compare offset-naive and offset-aware datetimes

image

How can we reproduce the problem?

Go to Options > Add-ons

What's your environment?

  • Operating system: Mac OSX Sonoma 14.2.1
  • Orange version: 3.36.1 (but I experienced the same issue on 3.36.2 as well but it did not give the detailed stack trace of the error)
  • How you installed Orange: .dmg downloaded from website (I do not experience this issue when installing via pip)
  • Apple M1 Pro (2021)
@kodymoodley kodymoodley added the bug report Bug is reported by user, not yet confirmed by the core team label Feb 21, 2024
@simonaubertbd
Copy link

A good reason to have an offline installer for add-ons ;) #6684

@hydrastarmaster
Copy link

Same bug in Orange3-3.36.2-Miniconda-x86_64.exe, but just a pending installation process, no error message showed.

@markotoplak
Copy link
Member

Thanks for the report. Did you always have this issue on that particular installation or does is pop-up intermittently? May I ask what are your local settings (language, which country)? No idea if these are connected, just a guess.

@kodymoodley
Copy link
Author

Thanks for the report. Did you always have this issue on that particular installation or does is pop-up intermittently? May I ask what are your local settings (language, which country)? No idea if these are connected, just a guess.

Actually it was strange. This issue suddenly popped up in the space of one evening. I was testing an add-on that I developed so I tried installing / reinstalling it several times from the add-on manager. It was working and then all of a sudden stopped in the space of 2 hours or so. Do you mean country and language settings on my laptop or in Orange? For the laptop Netherlands is the region and the primary language is English, secondary is Dutch.

@hydrastarmaster
Copy link

Thanks for the report. Did you always have this issue on that particular installation or does is pop-up intermittently? May I ask what are your local settings (language, which country)? No idea if these are connected, just a guess.

Previously installed version was 3.32.0, no problems with it. I've multi-locale and multi-region machines, doesn't seems to be related. The first installation window pops up and then no action following (and no error message).

@markotoplak
Copy link
Member

It is getting more and more confusing. I was not able to replicate it yet...

@kodymoodley, if I understand properly, it happens when the add-on dialog is being opened, so you do not even see a list?

@hydrastarmaster, are you able to see a list of add-ons? If I understood correct, installation of an add-on fails. Does it fail for any add-on? Try Educational for example, that is one of the smallest.

@markotoplak
Copy link
Member

@kodymoodley, is your add-on public? If so, which one is it?

@hydrastarmaster, which add-ons did you install before getting the error? Or did this happen at the installation of your first add-on?

@markotoplak
Copy link
Member

@kodymoodley, could perhaps copy the folder /Users/<your username>/Library/Caches/Orange/networkcache somewhere and then delete it?

Do not delete it straight away because within could be some clues to what is happening. Also, could you perhaps share it? (If you don't want to do it publickly, please send it to my username at gmail.)

Thanks!

@kodymoodley
Copy link
Author

It is getting more and more confusing. I was not able to replicate it yet...

@kodymoodley, if I understand properly, it happens when the add-on dialog is being opened, so you do not even see a list?

@hydrastarmaster, are you able to see a list of add-ons? If I understood correct, installation of an add-on fails. Does it fail for any add-on? Try Educational for example, that is one of the smallest.

@markotoplak Yes, I do not even see the list. It happens before.

@kodymoodley
Copy link
Author

@kodymoodley, could perhaps copy the folder /Users/<your username>/Library/Caches/Orange/networkcache somewhere and then delete it?

Do not delete it straight away because within could be some clues to what is happening. Also, could you perhaps share it? (If you don't want to do it publickly, please send it to my username at gmail.)

Thanks!

@markotoplak Deleting /Users/<your username>/Library/Caches/Orange/networkcache solves the problem for me! There is only a requests.sqlite file inside. Do you want me to send that to you via gmail?

@markotoplak
Copy link
Member

@markotoplak Deleting /Users/<your username>/Library/Caches/Orange/networkcache solves the problem for me! There is only a requests.sqlite file inside. Do you want me to send that to you via gmail?

It seems that you got a malformed (or somehow incompatible) network request once. Yes, please send the file, so that we can at least replicate your issue and perhaps implement a workaround (I think cache should just be ignored in such cases).

@hydrastarmaster
Copy link

3.36.2 freshly installed, so there are no previously installed add-on. I got the add-ons list. When I select any of them and start to install, the installation progress bar window pops up, and nothing appends. It goes pending with any of the add-ons... I've tried with Educational as you said, nothing different.
I just notice that when the add-ons installation starts, the pythonw.exe process get looped at the Start Address pythonw.exe!OPENSSL_Applink+0x480 and WINMM.dll!PlaySoundW+0xd70.

@ruvilonix
Copy link

ruvilonix commented Mar 10, 2024

Similar issue here. I open Add-Ons, but before the list even populates, it says there was an issue with the internet connection:

Screenshot from 2024-03-10 18-58-16

Traceback (most recent call last):
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/orangecanvas/application/addons.py", line 695, in <lambda>
    lambda config=config: (config, list_available_versions(config)),
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/orangecanvas/application/addons.py", line 1316, in list_available_versions
    response = session.get(PYPI_API_JSON.format(name=p))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/requests/sessions.py", line 747, in send
    r.content
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/requests/models.py", line 899, in content
    self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/requests/models.py", line 816, in generate
    yield from self.raw.stream(chunk_size, decode_content=True)
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/urllib3/response.py", line 934, in stream
    data = self.read(amt=amt, decode_content=decode_content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/urllib3/response.py", line 877, in read
    data = self._raw_read(amt)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/urllib3/response.py", line 812, in _raw_read
    data = self._fp_read(amt) if not fp_closed else b""
           ^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/urllib3/response.py", line 797, in _fp_read
    return self._fp.read(amt) if amt is not None else self._fp.read()
           ^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/cachecontrol/filewrapper.py", line 96, in read
    self._close()
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/cachecontrol/filewrapper.py", line 76, in _close
    self.__callback(result)
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/cachecontrol/controller.py", line 353, in cache_response
    self._cache_set(cache_url, request, response, body, expires_time)
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/cachecontrol/controller.py", line 274, in _cache_set
    self.serializer.dumps(request, response, body),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dima/miniconda3/envs/health_data/lib/python3.11/site-packages/cachecontrol/serialize.py", line 54, in dumps
    u"strict": response.strict,
               ^^^^^^^^^^^^^^^
AttributeError: 'HTTPResponse' object has no attribute 'strict'

I don't think it's an issue with my internet, since I can load files from a URL just fine. I installed this a couple weeks ago through mamba (or maybe conda) onto Ubuntu 23.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug is reported by user, not yet confirmed by the core team
Projects
None yet
Development

No branches or pull requests

5 participants