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

can not set MONGO_MAX_POOL_SIZE #77

strahe opened this issue Jun 22, 2016 · 4 comments

can not set MONGO_MAX_POOL_SIZE #77

strahe opened this issue Jun 22, 2016 · 4 comments


Copy link

@strahe strahe commented Jun 22, 2016

When i set MONGO_MAX_POOL_SIZE = 10 ,I get a error
"pymongo.errors.ConfigurationError: Unknown option max_pool_size"

Copy link

@HammerMeetNail HammerMeetNail commented Jun 22, 2016

Can you provide a sample of the code? I tried replicating the error in one of my personal applications and did not receive the error.

For reference, this is the config I used:
application = Flask(__name__)
application.config["MONGO_HOST"] = "mongoContainer"
application.config["MONGO_DBNAME"] = "setlists"
application.config['SERVER_NAME'] = 'setlist.visualizer'
application.config['MONGO_MAX_POOL_SIZE'] = 10
application.config["MONGO_CONNECT"] = False
mongo = PyMongo(application, config_prefix='MONGO')

Copy link

@strahe strahe commented Jun 23, 2016

this is my test code:

from flask import Flask
from flask.ext.pymongo import PyMongo
app = Flask(__name__)
class Config:
    DEBUG = True
    # MongoDB
    MONGO_HOST = ''
    MONGO_PORT = 27017
    MONGO_DBNAME = 'stock'
    MONGO_USERNAME = 'stock'
    MONGO_PASSWORD = 'uDZIVYP38zo6alp'
mg = PyMongo(app)
if __name__ == '__main__':

this is the error:

(.venv) [strahe@strahe stock]$ python 
/home/strahe/git/stock/.venv/lib/python3.5/site-packages/flask/ ExtDeprecationWarning: Importing flask.ext.pymongo is deprecated, use flask_pymongo instead.
  .format(x=modname), ExtDeprecationWarning
Traceback (most recent call last):
  File "", line 23, in <module>
    mg = PyMongo(app)
  File "/home/strahe/git/stock/.venv/lib/python3.5/site-packages/flask_pymongo/", line 97, in __init__
    self.init_app(app, config_prefix)
  File "/home/strahe/git/stock/.venv/lib/python3.5/site-packages/flask_pymongo/", line 249, in init_app
    cx = connection_cls(*args, **kwargs)
  File "/home/strahe/git/stock/.venv/lib/python3.5/site-packages/pymongo/", line 342, in __init__
    for k, v in keyword_opts.items())
  File "/home/strahe/git/stock/.venv/lib/python3.5/site-packages/pymongo/", line 342, in <genexpr>
    for k, v in keyword_opts.items())
  File "/home/strahe/git/stock/.venv/lib/python3.5/site-packages/pymongo/", line 471, in validate
    value = validator(option, value)
  File "/home/strahe/git/stock/.venv/lib/python3.5/site-packages/pymongo/", line 107, in raise_config_error
    raise ConfigurationError("Unknown option %s" % (key,))
pymongo.errors.ConfigurationError: Unknown option max_pool_size

and the version Information:

Copy link

@hbldh hbldh commented Jun 23, 2016

I actually happened to make what I believe is a fix for this error yesterday: In PyMongo>=3.0, the parameter max_pool_size is renamed maxPoolSize, which will lead to that very problem. Made a pull request #78 with the change.

I was making some modifications to fit another issue and did this as well.

Copy link

@dcrosta dcrosta commented May 22, 2017

Closed by #78

@dcrosta dcrosta closed this May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.