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