Hey there, I realize that this might not be related to Flask in anyway, but I still wanted to get some help. What I have are 2 servers, one running MongoDB server and the other is the client. Now, I'm trying to access the server from the client by using appropriate credentials and port numbers. The connection is successful via the command-line mongo tool but while using the exact same settings with Flask-MongoAlchemy, it says that authentication failed. I know that the settings are valid, I know that the firewall is not blocking requests. What could be the fault? config.py in the client server- MONGOALCHEMY_DATABASE = 'database' MONGOALCHEMY_SERVER = '188.88.88.2' MONGOALCHEMY_USER = 'user' MONGOALCHEMY_PASSWORD = 'password' I'm using Flask-MongoAlchemy by the way. -- Regards, Ishbir Singh
Hey there, On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com> wrote: > Hey there, > > I realize that this might not be related to Flask in anyway, but I still > wanted to get some help. What I have are 2 servers, one running MongoDB > server and the other is the client. Now, I'm trying to access the server > from the client by using appropriate credentials and port numbers. The > connection is successful via the command-line mongo tool but while using the > exact same settings with Flask-MongoAlchemy, it says that authentication > failed. Could you please paste the stack trace here? Cheers, Chico (a.k.a Francisco Souza) @franciscosouza On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com> wrote: > Hey there, > > I realize that this might not be related to Flask in anyway, but I still > wanted to get some help. What I have are 2 servers, one running MongoDB > server and the other is the client. Now, I'm trying to access the server > from the client by using appropriate credentials and port numbers. The > connection is successful via the command-line mongo tool but while using the > exact same settings with Flask-MongoAlchemy, it says that authentication > failed. > > I know that the settings are valid, I know that the firewall is not > blocking requests. What could be the fault? > > config.py in the client server- > > MONGOALCHEMY_DATABASE = 'database' > MONGOALCHEMY_SERVER = '188.88.88.2' > MONGOALCHEMY_USER = 'user' > MONGOALCHEMY_PASSWORD = 'password' > > I'm using Flask-MongoAlchemy by the way. > > -- > Regards, > Ishbir Singh > >
Hey, here you go-
Traceback (most recent call last):
File "manage.py", line 3, in <module>
from lulzimg import app
File "/var/script/script/__init__.py", line 25, in <module>
db.init_app(app)
File "/usr/local/lib/python2.7/dist-packages/flaskext/mongoalchemy.py",
line 108, in init_app
host=uri,
File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py",
line 83, in connect
conn = Connection(*args, **kwds)
File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", line
333, in __init__
raise ConfigurationError("authentication failed")
pymongo.errors.ConfigurationError: authentication failed
On 22 August 2011 18:42, Francisco Souza <francisco@franciscosouza.net>wrote:
> Hey there,
>
> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com>
> wrote:
>
> Hey there,
>>
>> I realize that this might not be related to Flask in anyway, but I still
>> wanted to get some help. What I have are 2 servers, one running MongoDB
>> server and the other is the client. Now, I'm trying to access the server
>> from the client by using appropriate credentials and port numbers. The
>> connection is successful via the command-line mongo tool but while using the
>> exact same settings with Flask-MongoAlchemy, it says that authentication
>> failed.
>
>
> Could you please paste the stack trace here?
>
> Cheers,
> Chico (a.k.a Francisco Souza)
> @franciscosouza
>
>
>
>
> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com>wrote:
>
>> Hey there,
>>
>> I realize that this might not be related to Flask in anyway, but I still
>> wanted to get some help. What I have are 2 servers, one running MongoDB
>> server and the other is the client. Now, I'm trying to access the server
>> from the client by using appropriate credentials and port numbers. The
>> connection is successful via the command-line mongo tool but while using the
>> exact same settings with Flask-MongoAlchemy, it says that authentication
>> failed.
>>
>> I know that the settings are valid, I know that the firewall is not
>> blocking requests. What could be the fault?
>>
>> config.py in the client server-
>>
>> MONGOALCHEMY_DATABASE = 'database'
>> MONGOALCHEMY_SERVER = '188.88.88.2'
>> MONGOALCHEMY_USER = 'user'
>> MONGOALCHEMY_PASSWORD = 'password'
>>
>> I'm using Flask-MongoAlchemy by the way.
>>
>> --
>> Regards,
>> Ishbir Singh
>>
>>
>
--
Regards,
Ishbir Singh
Can you execute this code below in the Python interactive console? >>> import pymongo >>> conn = pymongo.connection.Connection(host='mongodb:// user:password@188.88.88.2:27017') # place your data here >>> conn.database Cheers, Chico (a.k.a Francisco Souza) @franciscosouza On Mon, Aug 22, 2011 at 11:21 AM, Ishbir Singh <webmaster@ishbir.com> wrote: > Hey, here you go- > > Traceback (most recent call last): > File "manage.py", line 3, in <module> > from lulzimg import app > File "/var/script/script/__init__.py", line 25, in <module> > db.init_app(app) > File "/usr/local/lib/python2.7/dist-packages/flaskext/mongoalchemy.py", > line 108, in init_app > host=uri, > File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py", > line 83, in connect > conn = Connection(*args, **kwds) > File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", line > 333, in __init__ > raise ConfigurationError("authentication failed") > pymongo.errors.ConfigurationError: authentication failed > > > > On 22 August 2011 18:42, Francisco Souza <francisco@franciscosouza.net>wrote: > >> Hey there, >> >> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com> >> wrote: >> >> Hey there, >>> >>> I realize that this might not be related to Flask in anyway, but I still >>> wanted to get some help. What I have are 2 servers, one running MongoDB >>> server and the other is the client. Now, I'm trying to access the server >>> from the client by using appropriate credentials and port numbers. The >>> connection is successful via the command-line mongo tool but while using the >>> exact same settings with Flask-MongoAlchemy, it says that authentication >>> failed. >> >> >> Could you please paste the stack trace here? >> >> Cheers, >> Chico (a.k.a Francisco Souza) >> @franciscosouza >> >> >> >> >> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >> >>> Hey there, >>> >>> I realize that this might not be related to Flask in anyway, but I still >>> wanted to get some help. What I have are 2 servers, one running MongoDB >>> server and the other is the client. Now, I'm trying to access the server >>> from the client by using appropriate credentials and port numbers. The >>> connection is successful via the command-line mongo tool but while using the >>> exact same settings with Flask-MongoAlchemy, it says that authentication >>> failed. >>> >>> I know that the settings are valid, I know that the firewall is not >>> blocking requests. What could be the fault? >>> >>> config.py in the client server- >>> >>> MONGOALCHEMY_DATABASE = 'database' >>> MONGOALCHEMY_SERVER = '188.88.88.2' >>> MONGOALCHEMY_USER = 'user' >>> MONGOALCHEMY_PASSWORD = 'password' >>> >>> I'm using Flask-MongoAlchemy by the way. >>> >>> -- >>> Regards, >>> Ishbir Singh >>> >>> >> > > > -- > Regards, > Ishbir Singh > >
Hey, This throws the same error, but when I try *host='mongodb:// user:password@188.88.88.2:27017/database', *then it works.. I created a user for the database, not for the entire server, because, that would be insecure otherwise. On 23 August 2011 02:51, Francisco Souza <francisco@franciscosouza.net>wrote: > Can you execute this code below in the Python interactive console? > > >>> import pymongo > >>> conn = pymongo.connection.Connection(host='mongodb:// > user:password@188.88.88.2:27017') # place your data here > >>> conn.database > > Cheers, > Chico (a.k.a Francisco Souza) > @franciscosouza > > > > On Mon, Aug 22, 2011 at 11:21 AM, Ishbir Singh <webmaster@ishbir.com>wrote: > >> Hey, here you go- >> >> Traceback (most recent call last): >> File "manage.py", line 3, in <module> >> from lulzimg import app >> File "/var/script/script/__init__.py", line 25, in <module> >> db.init_app(app) >> File "/usr/local/lib/python2.7/dist-packages/flaskext/mongoalchemy.py", >> line 108, in init_app >> host=uri, >> File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py", >> line 83, in connect >> conn = Connection(*args, **kwds) >> File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", >> line 333, in __init__ >> raise ConfigurationError("authentication failed") >> pymongo.errors.ConfigurationError: authentication failed >> >> >> >> On 22 August 2011 18:42, Francisco Souza <francisco@franciscosouza.net>wrote: >> >>> Hey there, >>> >>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com> >>> wrote: >>> >>> Hey there, >>>> >>>> I realize that this might not be related to Flask in anyway, but I still >>>> wanted to get some help. What I have are 2 servers, one running MongoDB >>>> server and the other is the client. Now, I'm trying to access the server >>>> from the client by using appropriate credentials and port numbers. The >>>> connection is successful via the command-line mongo tool but while using the >>>> exact same settings with Flask-MongoAlchemy, it says that authentication >>>> failed. >>> >>> >>> Could you please paste the stack trace here? >>> >>> Cheers, >>> Chico (a.k.a Francisco Souza) >>> @franciscosouza >>> >>> >>> >>> >>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>> >>>> Hey there, >>>> >>>> I realize that this might not be related to Flask in anyway, but I still >>>> wanted to get some help. What I have are 2 servers, one running MongoDB >>>> server and the other is the client. Now, I'm trying to access the server >>>> from the client by using appropriate credentials and port numbers. The >>>> connection is successful via the command-line mongo tool but while using the >>>> exact same settings with Flask-MongoAlchemy, it says that authentication >>>> failed. >>>> >>>> I know that the settings are valid, I know that the firewall is not >>>> blocking requests. What could be the fault? >>>> >>>> config.py in the client server- >>>> >>>> MONGOALCHEMY_DATABASE = 'database' >>>> MONGOALCHEMY_SERVER = '188.88.88.2' >>>> MONGOALCHEMY_USER = 'user' >>>> MONGOALCHEMY_PASSWORD = 'password' >>>> >>>> I'm using Flask-MongoAlchemy by the way. >>>> >>>> -- >>>> Regards, >>>> Ishbir Singh >>>> >>>> >>> >> >> >> -- >> Regards, >> Ishbir Singh >> >> > -- Regards, Ishbir Singh
I see, sorry to be late. I'm going to fix this, changing the uri used to connect to MongoDB and release a new version today :) Thank you, Chico (a.k.a Francisco Souza) @franciscosouza On Tue, Aug 23, 2011 at 8:41 AM, Ishbir Singh <webmaster@ishbir.com> wrote: > Hey, > > This throws the same error, but when I try *host='mongodb:// > user:password@188.88.88.2:27017/database', *then it works.. I created a > user for the database, not for the entire server, because, that would be > insecure otherwise. > > > On 23 August 2011 02:51, Francisco Souza <francisco@franciscosouza.net>wrote: > >> Can you execute this code below in the Python interactive console? >> >> >>> import pymongo >> >>> conn = pymongo.connection.Connection(host='mongodb:// >> user:password@188.88.88.2:27017') # place your data here >> >>> conn.database >> >> Cheers, >> Chico (a.k.a Francisco Souza) >> @franciscosouza >> >> >> >> On Mon, Aug 22, 2011 at 11:21 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >> >>> Hey, here you go- >>> >>> Traceback (most recent call last): >>> File "manage.py", line 3, in <module> >>> from lulzimg import app >>> File "/var/script/script/__init__.py", line 25, in <module> >>> db.init_app(app) >>> File "/usr/local/lib/python2.7/dist-packages/flaskext/mongoalchemy.py", >>> line 108, in init_app >>> host=uri, >>> File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py", >>> line 83, in connect >>> conn = Connection(*args, **kwds) >>> File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", >>> line 333, in __init__ >>> raise ConfigurationError("authentication failed") >>> pymongo.errors.ConfigurationError: authentication failed >>> >>> >>> >>> On 22 August 2011 18:42, Francisco Souza <francisco@franciscosouza.net>wrote: >>> >>>> Hey there, >>>> >>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com> >>>> wrote: >>>> >>>> Hey there, >>>>> >>>>> I realize that this might not be related to Flask in anyway, but I >>>>> still wanted to get some help. What I have are 2 servers, one running >>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>> server from the client by using appropriate credentials and port numbers. >>>>> The connection is successful via the command-line mongo tool but while using >>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>> failed. >>>> >>>> >>>> Could you please paste the stack trace here? >>>> >>>> Cheers, >>>> Chico (a.k.a Francisco Souza) >>>> @franciscosouza >>>> >>>> >>>> >>>> >>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>>> >>>>> Hey there, >>>>> >>>>> I realize that this might not be related to Flask in anyway, but I >>>>> still wanted to get some help. What I have are 2 servers, one running >>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>> server from the client by using appropriate credentials and port numbers. >>>>> The connection is successful via the command-line mongo tool but while using >>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>> failed. >>>>> >>>>> I know that the settings are valid, I know that the firewall is not >>>>> blocking requests. What could be the fault? >>>>> >>>>> config.py in the client server- >>>>> >>>>> MONGOALCHEMY_DATABASE = 'database' >>>>> MONGOALCHEMY_SERVER = '188.88.88.2' >>>>> MONGOALCHEMY_USER = 'user' >>>>> MONGOALCHEMY_PASSWORD = 'password' >>>>> >>>>> I'm using Flask-MongoAlchemy by the way. >>>>> >>>>> -- >>>>> Regards, >>>>> Ishbir Singh >>>>> >>>>> >>>> >>> >>> >>> -- >>> Regards, >>> Ishbir Singh >>> >>> >> > > > -- > Regards, > Ishbir Singh > >
It's here: http://pypi.python.org/pypi/Flask-MongoAlchemy/0.4.3 :) Thank you, Chico (a.k.a Francisco Souza) @franciscosouza On Wed, Aug 24, 2011 at 7:20 PM, Francisco Souza < francisco@franciscosouza.net> wrote: > I see, sorry to be late. > > I'm going to fix this, changing the uri used to connect to MongoDB and > release a new version today :) > > Thank you, > > Chico (a.k.a Francisco Souza) > @franciscosouza > > > > On Tue, Aug 23, 2011 at 8:41 AM, Ishbir Singh <webmaster@ishbir.com>wrote: > >> Hey, >> >> This throws the same error, but when I try *host='mongodb:// >> user:password@188.88.88.2:27017/database', *then it works.. I created a >> user for the database, not for the entire server, because, that would be >> insecure otherwise. >> >> >> On 23 August 2011 02:51, Francisco Souza <francisco@franciscosouza.net>wrote: >> >>> Can you execute this code below in the Python interactive console? >>> >>> >>> import pymongo >>> >>> conn = pymongo.connection.Connection(host='mongodb:// >>> user:password@188.88.88.2:27017') # place your data here >>> >>> conn.database >>> >>> Cheers, >>> Chico (a.k.a Francisco Souza) >>> @franciscosouza >>> >>> >>> >>> On Mon, Aug 22, 2011 at 11:21 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>> >>>> Hey, here you go- >>>> >>>> Traceback (most recent call last): >>>> File "manage.py", line 3, in <module> >>>> from lulzimg import app >>>> File "/var/script/script/__init__.py", line 25, in <module> >>>> db.init_app(app) >>>> File >>>> "/usr/local/lib/python2.7/dist-packages/flaskext/mongoalchemy.py", line 108, >>>> in init_app >>>> host=uri, >>>> File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py", >>>> line 83, in connect >>>> conn = Connection(*args, **kwds) >>>> File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", >>>> line 333, in __init__ >>>> raise ConfigurationError("authentication failed") >>>> pymongo.errors.ConfigurationError: authentication failed >>>> >>>> >>>> >>>> On 22 August 2011 18:42, Francisco Souza <francisco@franciscosouza.net>wrote: >>>> >>>>> Hey there, >>>>> >>>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com> >>>>> wrote: >>>>> >>>>> Hey there, >>>>>> >>>>>> I realize that this might not be related to Flask in anyway, but I >>>>>> still wanted to get some help. What I have are 2 servers, one running >>>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>>> server from the client by using appropriate credentials and port numbers. >>>>>> The connection is successful via the command-line mongo tool but while using >>>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>>> failed. >>>>> >>>>> >>>>> Could you please paste the stack trace here? >>>>> >>>>> Cheers, >>>>> Chico (a.k.a Francisco Souza) >>>>> @franciscosouza >>>>> >>>>> >>>>> >>>>> >>>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>>>> >>>>>> Hey there, >>>>>> >>>>>> I realize that this might not be related to Flask in anyway, but I >>>>>> still wanted to get some help. What I have are 2 servers, one running >>>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>>> server from the client by using appropriate credentials and port numbers. >>>>>> The connection is successful via the command-line mongo tool but while using >>>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>>> failed. >>>>>> >>>>>> I know that the settings are valid, I know that the firewall is not >>>>>> blocking requests. What could be the fault? >>>>>> >>>>>> config.py in the client server- >>>>>> >>>>>> MONGOALCHEMY_DATABASE = 'database' >>>>>> MONGOALCHEMY_SERVER = '188.88.88.2' >>>>>> MONGOALCHEMY_USER = 'user' >>>>>> MONGOALCHEMY_PASSWORD = 'password' >>>>>> >>>>>> I'm using Flask-MongoAlchemy by the way. >>>>>> >>>>>> -- >>>>>> Regards, >>>>>> Ishbir Singh >>>>>> >>>>>> >>>>> >>>> >>>> >>>> -- >>>> Regards, >>>> Ishbir Singh >>>> >>>> >>> >> >> >> -- >> Regards, >> Ishbir Singh >> >> >
Hey, Thankyou for the update. I'll try out and let you know :) On 25 August 2011 05:34, Francisco Souza <francisco@franciscosouza.net>wrote: > It's here: http://pypi.python.org/pypi/Flask-MongoAlchemy/0.4.3 > > :) > > Thank you, > Chico (a.k.a Francisco Souza) > @franciscosouza > > > > On Wed, Aug 24, 2011 at 7:20 PM, Francisco Souza < > francisco@franciscosouza.net> wrote: > >> I see, sorry to be late. >> >> I'm going to fix this, changing the uri used to connect to MongoDB and >> release a new version today :) >> >> Thank you, >> >> Chico (a.k.a Francisco Souza) >> @franciscosouza >> >> >> >> On Tue, Aug 23, 2011 at 8:41 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >> >>> Hey, >>> >>> This throws the same error, but when I try *host='mongodb:// >>> user:password@188.88.88.2:27017/database', *then it works.. I created a >>> user for the database, not for the entire server, because, that would be >>> insecure otherwise. >>> >>> >>> On 23 August 2011 02:51, Francisco Souza <francisco@franciscosouza.net>wrote: >>> >>>> Can you execute this code below in the Python interactive console? >>>> >>>> >>> import pymongo >>>> >>> conn = pymongo.connection.Connection(host='mongodb:// >>>> user:password@188.88.88.2:27017') # place your data here >>>> >>> conn.database >>>> >>>> Cheers, >>>> Chico (a.k.a Francisco Souza) >>>> @franciscosouza >>>> >>>> >>>> >>>> On Mon, Aug 22, 2011 at 11:21 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>>> >>>>> Hey, here you go- >>>>> >>>>> Traceback (most recent call last): >>>>> File "manage.py", line 3, in <module> >>>>> from lulzimg import app >>>>> File "/var/script/script/__init__.py", line 25, in <module> >>>>> db.init_app(app) >>>>> File >>>>> "/usr/local/lib/python2.7/dist-packages/flaskext/mongoalchemy.py", line 108, >>>>> in init_app >>>>> host=uri, >>>>> File >>>>> "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py", line 83, >>>>> in connect >>>>> conn = Connection(*args, **kwds) >>>>> File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", >>>>> line 333, in __init__ >>>>> raise ConfigurationError("authentication failed") >>>>> pymongo.errors.ConfigurationError: authentication failed >>>>> >>>>> >>>>> >>>>> On 22 August 2011 18:42, Francisco Souza <francisco@franciscosouza.net >>>>> > wrote: >>>>> >>>>>> Hey there, >>>>>> >>>>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com> >>>>>> wrote: >>>>>> >>>>>> Hey there, >>>>>>> >>>>>>> I realize that this might not be related to Flask in anyway, but I >>>>>>> still wanted to get some help. What I have are 2 servers, one running >>>>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>>>> server from the client by using appropriate credentials and port numbers. >>>>>>> The connection is successful via the command-line mongo tool but while using >>>>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>>>> failed. >>>>>> >>>>>> >>>>>> Could you please paste the stack trace here? >>>>>> >>>>>> Cheers, >>>>>> Chico (a.k.a Francisco Souza) >>>>>> @franciscosouza >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>>>>> >>>>>>> Hey there, >>>>>>> >>>>>>> I realize that this might not be related to Flask in anyway, but I >>>>>>> still wanted to get some help. What I have are 2 servers, one running >>>>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>>>> server from the client by using appropriate credentials and port numbers. >>>>>>> The connection is successful via the command-line mongo tool but while using >>>>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>>>> failed. >>>>>>> >>>>>>> I know that the settings are valid, I know that the firewall is not >>>>>>> blocking requests. What could be the fault? >>>>>>> >>>>>>> config.py in the client server- >>>>>>> >>>>>>> MONGOALCHEMY_DATABASE = 'database' >>>>>>> MONGOALCHEMY_SERVER = '188.88.88.2' >>>>>>> MONGOALCHEMY_USER = 'user' >>>>>>> MONGOALCHEMY_PASSWORD = 'password' >>>>>>> >>>>>>> I'm using Flask-MongoAlchemy by the way. >>>>>>> >>>>>>> -- >>>>>>> Regards, >>>>>>> Ishbir Singh >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Regards, >>>>> Ishbir Singh >>>>> >>>>> >>>> >>> >>> >>> -- >>> Regards, >>> Ishbir Singh >>> >>> >> > -- Regards, Ishbir Singh
Hey there, When I run shell with my flask application in context on any server, I get this error- >>> db.Image.query.all() Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/query.py", line 176, in all return [obj for obj in iter(self)] File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/query.py", line 58, in __iter__ return self.__get_query_result() File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/query.py", line 73, in __get_query_result return self.session.execute_query(self) AttributeError: 'NoneType' object has no attribute 'execute_query' I figure that somehow MongoAlchemy is not able instantiate a session with the main server. Why? What could be the problem? On 25 August 2011 16:03, Ishbir Singh <webmaster@ishbir.com> wrote: > Hey, > > Thankyou for the update. I'll try out and let you know :) > > > On 25 August 2011 05:34, Francisco Souza <francisco@franciscosouza.net>wrote: > >> It's here: http://pypi.python.org/pypi/Flask-MongoAlchemy/0.4.3 >> >> :) >> >> Thank you, >> Chico (a.k.a Francisco Souza) >> @franciscosouza >> >> >> >> On Wed, Aug 24, 2011 at 7:20 PM, Francisco Souza < >> francisco@franciscosouza.net> wrote: >> >>> I see, sorry to be late. >>> >>> I'm going to fix this, changing the uri used to connect to MongoDB and >>> release a new version today :) >>> >>> Thank you, >>> >>> Chico (a.k.a Francisco Souza) >>> @franciscosouza >>> >>> >>> >>> On Tue, Aug 23, 2011 at 8:41 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>> >>>> Hey, >>>> >>>> This throws the same error, but when I try *host='mongodb:// >>>> user:password@188.88.88.2:27017/database', *then it works.. I created a >>>> user for the database, not for the entire server, because, that would be >>>> insecure otherwise. >>>> >>>> >>>> On 23 August 2011 02:51, Francisco Souza <francisco@franciscosouza.net>wrote: >>>> >>>>> Can you execute this code below in the Python interactive console? >>>>> >>>>> >>> import pymongo >>>>> >>> conn = pymongo.connection.Connection(host='mongodb:// >>>>> user:password@188.88.88.2:27017') # place your data here >>>>> >>> conn.database >>>>> >>>>> Cheers, >>>>> Chico (a.k.a Francisco Souza) >>>>> @franciscosouza >>>>> >>>>> >>>>> >>>>> On Mon, Aug 22, 2011 at 11:21 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>>>> >>>>>> Hey, here you go- >>>>>> >>>>>> Traceback (most recent call last): >>>>>> File "manage.py", line 3, in <module> >>>>>> from lulzimg import app >>>>>> File "/var/script/script/__init__.py", line 25, in <module> >>>>>> db.init_app(app) >>>>>> File >>>>>> "/usr/local/lib/python2.7/dist-packages/flaskext/mongoalchemy.py", line 108, >>>>>> in init_app >>>>>> host=uri, >>>>>> File >>>>>> "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py", line 83, >>>>>> in connect >>>>>> conn = Connection(*args, **kwds) >>>>>> File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", >>>>>> line 333, in __init__ >>>>>> raise ConfigurationError("authentication failed") >>>>>> pymongo.errors.ConfigurationError: authentication failed >>>>>> >>>>>> >>>>>> >>>>>> On 22 August 2011 18:42, Francisco Souza < >>>>>> francisco@franciscosouza.net> wrote: >>>>>> >>>>>>> Hey there, >>>>>>> >>>>>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com> >>>>>>> wrote: >>>>>>> >>>>>>> Hey there, >>>>>>>> >>>>>>>> I realize that this might not be related to Flask in anyway, but I >>>>>>>> still wanted to get some help. What I have are 2 servers, one running >>>>>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>>>>> server from the client by using appropriate credentials and port numbers. >>>>>>>> The connection is successful via the command-line mongo tool but while using >>>>>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>>>>> failed. >>>>>>> >>>>>>> >>>>>>> Could you please paste the stack trace here? >>>>>>> >>>>>>> Cheers, >>>>>>> Chico (a.k.a Francisco Souza) >>>>>>> @franciscosouza >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>>>>>> >>>>>>>> Hey there, >>>>>>>> >>>>>>>> I realize that this might not be related to Flask in anyway, but I >>>>>>>> still wanted to get some help. What I have are 2 servers, one running >>>>>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>>>>> server from the client by using appropriate credentials and port numbers. >>>>>>>> The connection is successful via the command-line mongo tool but while using >>>>>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>>>>> failed. >>>>>>>> >>>>>>>> I know that the settings are valid, I know that the firewall is not >>>>>>>> blocking requests. What could be the fault? >>>>>>>> >>>>>>>> config.py in the client server- >>>>>>>> >>>>>>>> MONGOALCHEMY_DATABASE = 'database' >>>>>>>> MONGOALCHEMY_SERVER = '188.88.88.2' >>>>>>>> MONGOALCHEMY_USER = 'user' >>>>>>>> MONGOALCHEMY_PASSWORD = 'password' >>>>>>>> >>>>>>>> I'm using Flask-MongoAlchemy by the way. >>>>>>>> >>>>>>>> -- >>>>>>>> Regards, >>>>>>>> Ishbir Singh >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Regards, >>>>>> Ishbir Singh >>>>>> >>>>>> >>>>> >>>> >>>> >>>> -- >>>> Regards, >>>> Ishbir Singh >>>> >>>> >>> >> > > > -- > Regards, > Ishbir Singh > > -- Regards, Ishbir Singh
Hey, I tinkered around a bit and found out the root of the problem. I'm trying this and it's giving this- >>> import pymongo >>> conn = pymongo.connection.Connection(host='mongodb://user:pass@localhost:27017/lulzimg') # place your data here >>> from mongoalchemy.session import Session >>> Session.connect(conn) Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py", line 84, in connect db = conn[database] File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", line 877, in __getitem__ return self.__getattr__(name) File "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", line 866, in __getattr__ return database.Database(self, name) File "/usr/local/lib/python2.7/dist-packages/pymongo/database.py", line 66, in __init__ raise TypeError("name must be an instance of basestring") TypeError: name must be an instance of basestring I'm guessing that it's got something to do with the change in URI construction, but it's just a wild guess. I don't know the exact cause. On 6 September 2011 20:03, Ishbir Singh <webmaster@ishbir.com> wrote: > Hey there, > > When I run shell with my flask application in context on any server, I get > this error- > > >>> db.Image.query.all() > Traceback (most recent call last): > File "<console>", line 1, in <module> > File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/query.py", line > 176, in all > return [obj for obj in iter(self)] > File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/query.py", line > 58, in __iter__ > return self.__get_query_result() > File "/usr/local/lib/python2.7/dist-packages/mongoalchemy/query.py", line > 73, in __get_query_result > return self.session.execute_query(self) > AttributeError: 'NoneType' object has no attribute 'execute_query' > > I figure that somehow MongoAlchemy is not able instantiate a session with > the main server. Why? What could be the problem? > > > On 25 August 2011 16:03, Ishbir Singh <webmaster@ishbir.com> wrote: > >> Hey, >> >> Thankyou for the update. I'll try out and let you know :) >> >> >> On 25 August 2011 05:34, Francisco Souza <francisco@franciscosouza.net>wrote: >> >>> It's here: http://pypi.python.org/pypi/Flask-MongoAlchemy/0.4.3 >>> >>> :) >>> >>> Thank you, >>> Chico (a.k.a Francisco Souza) >>> @franciscosouza >>> >>> >>> >>> On Wed, Aug 24, 2011 at 7:20 PM, Francisco Souza < >>> francisco@franciscosouza.net> wrote: >>> >>>> I see, sorry to be late. >>>> >>>> I'm going to fix this, changing the uri used to connect to MongoDB and >>>> release a new version today :) >>>> >>>> Thank you, >>>> >>>> Chico (a.k.a Francisco Souza) >>>> @franciscosouza >>>> >>>> >>>> >>>> On Tue, Aug 23, 2011 at 8:41 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>>> >>>>> Hey, >>>>> >>>>> This throws the same error, but when I try *host='mongodb:// >>>>> user:password@188.88.88.2:27017/database', *then it works.. I created >>>>> a user for the database, not for the entire server, because, that would be >>>>> insecure otherwise. >>>>> >>>>> >>>>> On 23 August 2011 02:51, Francisco Souza <francisco@franciscosouza.net >>>>> > wrote: >>>>> >>>>>> Can you execute this code below in the Python interactive console? >>>>>> >>>>>> >>> import pymongo >>>>>> >>> conn = pymongo.connection.Connection(host='mongodb:// >>>>>> user:password@188.88.88.2:27017') # place your data here >>>>>> >>> conn.database >>>>>> >>>>>> Cheers, >>>>>> Chico (a.k.a Francisco Souza) >>>>>> @franciscosouza >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Aug 22, 2011 at 11:21 AM, Ishbir Singh <webmaster@ishbir.com>wrote: >>>>>> >>>>>>> Hey, here you go- >>>>>>> >>>>>>> Traceback (most recent call last): >>>>>>> File "manage.py", line 3, in <module> >>>>>>> from lulzimg import app >>>>>>> File "/var/script/script/__init__.py", line 25, in <module> >>>>>>> db.init_app(app) >>>>>>> File >>>>>>> "/usr/local/lib/python2.7/dist-packages/flaskext/mongoalchemy.py", line 108, >>>>>>> in init_app >>>>>>> host=uri, >>>>>>> File >>>>>>> "/usr/local/lib/python2.7/dist-packages/mongoalchemy/session.py", line 83, >>>>>>> in connect >>>>>>> conn = Connection(*args, **kwds) >>>>>>> File >>>>>>> "/usr/local/lib/python2.7/dist-packages/pymongo/connection.py", line 333, in >>>>>>> __init__ >>>>>>> raise ConfigurationError("authentication failed") >>>>>>> pymongo.errors.ConfigurationError: authentication failed >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 22 August 2011 18:42, Francisco Souza < >>>>>>> francisco@franciscosouza.net> wrote: >>>>>>> >>>>>>>> Hey there, >>>>>>>> >>>>>>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com >>>>>>>> > wrote: >>>>>>>> >>>>>>>> Hey there, >>>>>>>>> >>>>>>>>> I realize that this might not be related to Flask in anyway, but I >>>>>>>>> still wanted to get some help. What I have are 2 servers, one running >>>>>>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>>>>>> server from the client by using appropriate credentials and port numbers. >>>>>>>>> The connection is successful via the command-line mongo tool but while using >>>>>>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>>>>>> failed. >>>>>>>> >>>>>>>> >>>>>>>> Could you please paste the stack trace here? >>>>>>>> >>>>>>>> Cheers, >>>>>>>> Chico (a.k.a Francisco Souza) >>>>>>>> @franciscosouza >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Aug 22, 2011 at 8:57 AM, Ishbir Singh <webmaster@ishbir.com >>>>>>>> > wrote: >>>>>>>> >>>>>>>>> Hey there, >>>>>>>>> >>>>>>>>> I realize that this might not be related to Flask in anyway, but I >>>>>>>>> still wanted to get some help. What I have are 2 servers, one running >>>>>>>>> MongoDB server and the other is the client. Now, I'm trying to access the >>>>>>>>> server from the client by using appropriate credentials and port numbers. >>>>>>>>> The connection is successful via the command-line mongo tool but while using >>>>>>>>> the exact same settings with Flask-MongoAlchemy, it says that authentication >>>>>>>>> failed. >>>>>>>>> >>>>>>>>> I know that the settings are valid, I know that the firewall is not >>>>>>>>> blocking requests. What could be the fault? >>>>>>>>> >>>>>>>>> config.py in the client server- >>>>>>>>> >>>>>>>>> MONGOALCHEMY_DATABASE = 'database' >>>>>>>>> MONGOALCHEMY_SERVER = '188.88.88.2' >>>>>>>>> MONGOALCHEMY_USER = 'user' >>>>>>>>> MONGOALCHEMY_PASSWORD = 'password' >>>>>>>>> >>>>>>>>> I'm using Flask-MongoAlchemy by the way. >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Regards, >>>>>>>>> Ishbir Singh >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Regards, >>>>>>> Ishbir Singh >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Regards, >>>>> Ishbir Singh >>>>> >>>>> >>>> >>> >> >> >> -- >> Regards, >> Ishbir Singh >> >> > > > -- > Regards, > Ishbir Singh > > -- Regards, Ishbir Singh
> > On Tue, Sep 6, 2011 at 12:08 PM, Ishbir Singh <webmaster@ishbir.com> > wrote: > [...] > I'm guessing that it's got something to do with the change in URI > construction, but it's just a wild guess. I don't know the exact cause. Could you please file an issue to MongoAlchemy project? https://github.com/jeffjenkins/MongoAlchemy/issues -- Francisco Souza
Hey, Okay, ignore that tinkering email of mine. Seems like I did not quite read the API well. Back to the initial problem of mine, that AttributeError: 'NoneType' object has no attribute 'execute_query'. It occurs when I use this- ### in the models file db = MongoAlchemy() ### in the __init__.py file, after importing config.py file db.init_app(app) If I straightaway write db = MongoAlchemy(app), then it's magically working. Or even if I write- db = MongoAlchemy() db.init_app(app) in the same models file, then again, it's working. But, I'm afraid I have 3 applications sharing the same database models file so I cannot use the latter approach. I guess its clash of some timing, but I don't know what or how. Moroever, after your 0.4.3 release of Flask-MongoAlchemy, server based auth is broken. Just wanted to give you a heads up; add some configuration variable for per-server or per-db configuration so it's smooth. On 7 September 2011 00:04, Francisco Souza <f@souza.cc> wrote: > On Tue, Sep 6, 2011 at 12:08 PM, Ishbir Singh <webmaster@ishbir.com> >> wrote: >> > > [...] >> > > > I'm guessing that it's got something to do with the change in URI >> construction, but it's just a wild guess. I don't know the exact cause. > > > Could you please file an issue to MongoAlchemy project? > > https://github.com/jeffjenkins/MongoAlchemy/issues > > -- > Francisco Souza > > -- Regards, Ishbir Singh
What's so difficult in actually using the API that comes with Mongo? The API is fairly straightforward and in my view using MongoAlchemy is just adding more complexity in using accessing Mongo. Unless I'm missing something. ________________________________ From: flask@librelist.com [mailto:flask@librelist.com] On Behalf Of Ishbir Singh Sent: 07 September 2011 08:52 To: flask@librelist.com Subject: Re: [flask] MongoAlchemy Help Hey, Okay, ignore that tinkering email of mine. Seems like I did not quite read the API well. Back to the initial problem of mine, that AttributeError: 'NoneType' object has no attribute 'execute_query'. It occurs when I use this- ### in the models file db = MongoAlchemy() ### in the __init__.py file, after importing config.py file db.init_app(app) If I straightaway write db = MongoAlchemy(app), then it's magically working. Or even if I write- db = MongoAlchemy() db.init_app(app) in the same models file, then again, it's working. But, I'm afraid I have 3 applications sharing the same database models file so I cannot use the latter approach. I guess its clash of some timing, but I don't know what or how. Moroever, after your 0.4.3 release of Flask-MongoAlchemy, server based auth is broken. Just wanted to give you a heads up; add some configuration variable for per-server or per-db configuration so it's smooth. On 7 September 2011 00:04, Francisco Souza <f@souza.cc> wrote: On Tue, Sep 6, 2011 at 12:08 PM, Ishbir Singh <webmaster@ishbir.com> wrote: [...] I'm guessing that it's got something to do with the change in URI construction, but it's just a wild guess. I don't know the exact cause. Could you please file an issue to MongoAlchemy project? https://github.com/jeffjenkins/MongoAlchemy/issues -- Francisco Souza -- Regards, Ishbir Singh _____________________________________________________________________ The information contained in or attached to this email is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are not authorised to and must not disclose, copy,distribute, or retain this message or any part of it. It may contain information which is confidential and/or covered by legal professional or other privilege (or other rules or laws with similar effect in jurisdictions outside England and Wales). The views expressed in this email are not necessarily the views of Centrica plc, and the company, its directors, officers or employees make no representation or accept any liability for its accuracy or completeness unless expressly stated to the contrary. British Gas Services Limited and Centrica Energy (Trading) Limited, both wholly owned subsidiaries of Centrica PLC, are authorised and regulated by the Financial Services Authority. Registered office: Millstream, Maidenhead Road, Windsor, Berkshire SL4 5GD Registered in England No 3141243. Centrica plc Registered office: Millstream, Maidenhead Road, Windsor, Berkshire SL4 5GD Registered in England and Wales No 3033654
Hey, What you're missing is document-class mapping that is not available with just pymongo. It's just more logical that way, manipulating objects rather than managing sessions and traversing through them. On 7 September 2011 18:04, Woods, Mike <Michael.Woods@centrica.com> wrote: > What’s so difficult in actually using the API that comes with Mongo? The > API is fairly straightforward and in my view using MongoAlchemy is just > adding more complexity in using accessing Mongo. Unless I’m missing > something.**** > > ** ** > ------------------------------ > > *From:* flask@librelist.com [mailto:flask@librelist.com] *On Behalf Of *Ishbir > Singh > *Sent:* 07 September 2011 08:52 > *To:* flask@librelist.com > *Subject:* Re: [flask] MongoAlchemy Help**** > > ** ** > > Hey, > > Okay, ignore that tinkering email of mine. Seems like I did not quite read > the API well. Back to the initial problem of mine, that AttributeError: > 'NoneType' object has no attribute 'execute_query'. It occurs when I use > this- > > ### in the models file > db = MongoAlchemy() > > ### in the __init__.py file, after importing config.py file > db.init_app(app) > > If I straightaway write db = MongoAlchemy(app), then it's magically > working. Or even if I write- > db = MongoAlchemy() > db.init_app(app) > > in the same models file, then again, it's working. > > But, I'm afraid I have 3 applications sharing the same database models file > so I cannot use the latter approach. I guess its clash of some timing, but I > don't know what or how. > > Moroever, after your 0.4.3 release of Flask-MongoAlchemy, server based auth > is broken. Just wanted to give you a heads up; add some configuration > variable for per-server or per-db configuration so it's smooth.**** > > On 7 September 2011 00:04, Francisco Souza <f@souza.cc> wrote:**** > > On Tue, Sep 6, 2011 at 12:08 PM, Ishbir Singh <webmaster@ishbir.com > > wrote: > **** > > [...]**** > > **** > > I'm guessing that it's got something to do with the change in URI > construction, but it's just a wild guess. I don't know the exact cause.*** > * > > ** ** > > Could you please file an issue to MongoAlchemy project?**** > > ** ** > > https://github.com/jeffjenkins/MongoAlchemy/issues**** > > ** ** > > -- **** > > Francisco Souza**** > > ** ** > > > > > -- **** > > Regards, > Ishbir Singh**** > > ** ** > > _____________________________________________________________________ > The information contained in or attached to this email is intended only for > the use of the individual or entity to which it is addressed. If you are not > the intended recipient, or a person responsible for delivering it to the > intended recipient, you are not authorised to and must not disclose, > copy,distribute, or retain this message or any part of it. It may contain > information which is confidential and/or covered by legal professional or > other privilege (or other rules or laws with similar effect in jurisdictions > outside England and Wales). > > The views expressed in this email are not necessarily the views of Centrica > plc, and the company, its directors, officers or employees make no > representation or accept any liability for its accuracy or completeness > unless expressly stated to the contrary. > > British Gas Services Limited and Centrica Energy (Trading) Limited, both > wholly owned subsidiaries of Centrica PLC, are authorised and regulated by > the Financial Services Authority. > > Registered office: Millstream, Maidenhead Road, Windsor, Berkshire SL4 5GD > > Registered in England No 3141243. > > Centrica plc > > Registered office: Millstream, Maidenhead Road, Windsor, Berkshire SL4 5GD > > Registered in England and Wales No 3033654 > -- Regards, Ishbir Singh
Hey, I have filed the issue. Could not find any place to file it earlier so sent it to the mailing list. Thanks again! On 7 September 2011 00:04, Francisco Souza <f@souza.cc> wrote: > On Tue, Sep 6, 2011 at 12:08 PM, Ishbir Singh <webmaster@ishbir.com> >> wrote: >> > > [...] >> > > > I'm guessing that it's got something to do with the change in URI >> construction, but it's just a wild guess. I don't know the exact cause. > > > Could you please file an issue to MongoAlchemy project? > > https://github.com/jeffjenkins/MongoAlchemy/issues > > -- > Francisco Souza > > -- Regards, Ishbir Singh