netdata/netdata · error · AppEnginePlatformError
Use normal urllib3.PoolManager instead of AppEngineManageron
Error message
Use normal urllib3.PoolManager instead of AppEngineManageron Managed VMs, as using URLFetch is not necessary in this environment.
What it means
AppEnginePlatformError raised by AppEngineManager.__init__ when is_prod_appengine_mvms() is true - the code is running on Google App Engine Managed VMs (the precursor of the Flexible Environment). There, full socket access is available, so URLFetch (and its limits) is unnecessary; urllib3 explicitly tells you to use the normal PoolManager instead.
Source
Thrown at src/collectors/python.d.plugin/python_modules/urllib3/contrib/appengine.py:107
Notably it will raise an :class:`AppEnginePlatformError` if:
* URLFetch is not available.
* If you attempt to use this on App Engine Flexible, as full socket
support is available.
* If a request size is more than 10 megabytes.
* If a response size is more than 32 megabtyes.
* If you use an unsupported request method such as OPTIONS.
Beyond those cases, it will raise normal urllib3 errors.
"""
def __init__(self, headers=None, retries=None, validate_certificate=True,
urlfetch_retries=True):
if not urlfetch:
raise AppEnginePlatformError(
"URLFetch is not available in this environment.")
if is_prod_appengine_mvms():
raise AppEnginePlatformError(
"Use normal urllib3.PoolManager instead of AppEngineManager"
"on Managed VMs, as using URLFetch is not necessary in "
"this environment.")
warnings.warn(
"urllib3 is using URLFetch on Google App Engine sandbox instead "
"of sockets. To use sockets directly instead of URLFetch see "
"https://urllib3.readthedocs.io/en/latest/reference/urllib3.contrib.html.",
AppEnginePlatformWarning)
RequestMethods.__init__(self, headers)
self.validate_certificate = validate_certificate
self.urlfetch_retries = urlfetch_retries
self.retries = retries or Retry.DEFAULT
def __enter__(self):
return selfView on GitHub (pinned to 4864de85e2)
Solutions
- Replace AppEngineManager() with urllib3.PoolManager() in that environment - sockets work normally there.
- Make the selection conditional: AppEngineManager only when is_prod_appengine() and not is_prod_appengine_mvms(); otherwise PoolManager.
- Move off the deprecated Managed VM/URLFetch stack entirely to the modern flexible runtimes.
Example fix
# before
from urllib3.contrib.appengine import AppEngineManager
http = AppEngineManager() # on Managed VMs -> AppEnginePlatformError
# after
from urllib3.contrib.appengine import AppEngineManager, is_prod_appengine, is_prod_appengine_mvms
import urllib3
if is_prod_appengine() and not is_prod_appengine_mvms():
http = AppEngineManager()
else:
http = urllib3.PoolManager() Defensive patterns
Strategy: validation
Validate before calling
from urllib3.contrib.appengine import is_prod_appengine, is_prod_appengine_mvms
def pick_manager():
if is_prod_appengine() and not is_prod_appengine_mvms():
from urllib3.contrib.appengine import AppEngineManager
return AppEngineManager()
import urllib3
return urllib3.PoolManager() # Managed VMs / Flexible / anywhere else Try / catch
from urllib3.contrib.appengine import AppEngineManager, AppEnginePlatformError
try:
http = AppEngineManager()
except AppEnginePlatformError as e:
if 'Managed VMs' in str(e):
import urllib3
http = urllib3.PoolManager() # sockets are fine here
else:
raise Prevention
- Distinguish GAE standard from Flexible/Managed VMs before choosing a manager: is_prod_appengine_mvms() must be False.
- Centralize transport selection in one factory so migrating runtimes flips behavior in one place.
When it happens
Trigger: Deploying code that constructs AppEngineManager to App Engine Managed VMs / Flexible Environment instead of the standard sandbox. Detection triggers on the GAE environment variables that identify VM-based runtimes.
Common situations: Migrating an app from GAE standard to Flexible/Managed VMs while keeping the AppEngineManager selection logic; shared libraries that picked the manager based on 'am I on GAE' without distinguishing standard vs flexible.
Related errors
- URLFetch is not available in this environment.
- URLFetch request too large, URLFetch only supports requests
- too many redirects
- URLFetch response too large, URLFetch only supportsresponses
- URLFetch does not support method: %s
AI-assisted analysis of netdata/netdata@4864de85e2 (2026-08-15).
Data as JSON: /api/errors/bea2afb2239b3490.
Report an issue: GitHub.