Plugins 'pip' error on fresh OctoPi 0.17.0 install

Issue:

Performed a fresh install of Octopi using the latest 0.17.0 release on a Raspberry Pi 4B and am unable to install plugins. Logs show there are installed plugins but none are displayed in the web interface.

Steps performed:

  • 'pip' exists in ~/oprint/bin, I added this to the global path and am able to run pip from command line but still receive errors in the web interface after reboot (and confirming PATH is still correct)
  • upgraded pip:
> pip install pip --upgrade
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Cache entry deserialization failed, entry ignored
Cache entry deserialization failed, entry ignored
Collecting pip
Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-19.3.1

Screenshots:

octoprint.log

2019-11-14 22:10:55,822 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from https://plugins.octoprint.org/plugins.json
2019-11-14 22:10:56,082 - octoprint.server.api - ERROR - Error calling SimpleApiPlugin pluginmanager
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/api/__init__.py", line 68, in pluginData
    response = api_plugin.on_api_get(request)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager/__init__.py", line 280, in on_api_get
    if refresh_repository or not self._is_repository_cache_valid():
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager/__init__.py", line 797, in _is_repository_cache_valid
    return mtime + self._repository_cache_ttl >= time.time() > mtime
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
2019-11-14 22:10:56,086 - tornado.access - ERROR - 500 GET /api/plugin/pluginmanager (fe80::460:6cd3:ea75:58ad) 7.08ms
2019-11-14 22:10:56,721 - octoprint.plugins.pluginmanager - INFO - Loaded plugin notices data from https://plugins.octoprint.org/notices.json

… and fixed …

I changed repository cache TTL & Notices cache TTL both to 1m. Default installed plugins immediately displayed and I was able to install a new plugin successfully.

Expectation would be these caches were refreshed on reboot or initial install.

5 Likes

I have actually now idea at all how this can even happen, but it should no longer happen in future versions since I added another None check in there.

2 Likes

That's appreciated, thanks! Out of the box errors are frustrating so that will be nice to have in future versions.

you can set install pip with user account on the Plugin manager settings.

For those who are beginners like me and don't understand what "Thoughtwasmistaken" was discussing : click on the wrench icon to get into the plugin configuration page and change the existing values to 1 minute ... it worked fo me too (after 10 long minutes trying to understand what ttl could mean in relation with a directory name ... yeah, it's been at least fifteen years since I last played with Linux).

3 Likes

I have stumbled upon the same behaviour when there was an issue with DNS during the first "cold" octoprint start (see logs below). So my guess would be that the API fails because there is no cachefile on disk. The TTL I think forces octoprint to make that connection and cachefile afresh and that's why the original error disappears.

2019-12-09 13:19:36,590 - octoprint.plugins.pluginmanager - ERROR - Could not fetch plugins from repository at https://plugins.octoprint.org/plugins.json: HTTPSConnectionPool(host='plugins.octoprint.org', port=443): Max retries exceeded with url: /plugins.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb17d6990>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager/__init__.py", line 823, in _fetch_repository_from_url
    r = requests.get(repository_url, timeout=30)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='plugins.octoprint.org', port=443): Max retries exceeded with url: /plugins.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb17d6990>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
2019-12-09 13:19:36,600 - octoprint.plugins.pluginmanager - ERROR - Could not fetch notices from https://plugins.octoprint.org/notices.json: HTTPSConnectionPool(host='plugins.octoprint.org', port=443): Max retries exceeded with url: /notices.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb1793050>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager/__init__.py", line 891, in _fetch_notices_from_url
    r = requests.get(notices_url, timeout=30)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='plugins.octoprint.org', port=443): Max retries exceeded with url: /notices.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb1793050>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
2019-12-09 13:19:37,134 - octoprint.util.pip - INFO - Using "/home/pi/oprint/bin/python2 -m pip" as command to invoke pip
2019-12-09 13:19:37,135 - octoprint.util.pip - INFO - pip installs to /home/pi/oprint/lib/python2.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2019-12-09 13:19:37,136 - octoprint.util.pip - INFO - ==> pip ok -> yes
2019-12-09 13:19:38,760 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=en', 'path': '/', 'base_url': 'http://10.192.202.38/'}
2019-12-09 13:19:44,112 - octoprint.server.preemptive_cache - INFO - ... done in 5.35s
2019-12-09 13:19:45,523 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:10.192.202.58
2019-12-09 13:19:45,597 - octoprint.server.util.flask - INFO - Passively logging in user dummy from ::ffff:10.192.202.58
2019-12-09 13:23:13,806 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:10.192.202.58
2019-12-09 13:23:15,765 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:10.192.202.58
2019-12-09 13:23:15,848 - octoprint.server.util.flask - INFO - Passively logging in user dummy from ::ffff:10.192.202.58
2019-12-09 13:23:16,635 - octoprint.server.api - ERROR - Error calling SimpleApiPlugin pluginmanager
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/api/__init__.py", line 68, in pluginData
    response = api_plugin.on_api_get(request)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager/__init__.py", line 280, in on_api_get
    if refresh_repository or not self._is_repository_cache_valid():
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager/__init__.py", line 797, in _is_repository_cache_valid
    return mtime + self._repository_cache_ttl >= time.time() > mtime
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
2019-12-09 13:23:16,639 - tornado.access - ERROR - 500 GET /api/plugin/pluginmanager (::ffff:10.192.202.58) 6.75ms

Had the same pip-error entering to the PluginManager, but after clicking the on the upper-right wrench-symbol (=Plugin-Manager Configuration) there on the bottom, on "pip Configuration" I checked the small checkbox, saved the config and voilá... error gone.

FAQ entry:

Thanks for the simple explanation. Worked for me

I tried to reinstall twice on debian 10.4 on a pc, and always the same error witout finding out how to solve it
the "wrench"-trick is not working for me

Hey @F4VSJ This thread is a workaround for OctoPi 0.17, if you installed manually you might be better in a separate post, with some more details about your install

Thanks folks
All is working now, made some notes ...
I'll post the complete setup in an other tread, all little tricks and info assembled from several webpages
Hans

Got that same problem today .. also set to 1m solved it (2020-10-17)

No need to set it to 1m, just do what the FAQ tells you to:

I can not click the wrench. What if like me you can't get the GUI to load? I can only ssh in when hardwired. My log is the same as JirkaChadima.

ConnectionError: HTTPSConnectionPool(host='octoprint.org', port=443): Max retries exceeded with url: /feeds/octopi.xml (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb2061530>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
2019-09-26 01:24:34,954 - octoprint.util.pip - INFO - Using "/home/pi/oprint/bin/python2 -m pip" as command to invoke pip
2019-09-26 01:24:34,955 - octoprint.util.pip - INFO - pip installs to /home/pi/oprint/lib/python2.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes