David Fang
01/03/2022, 5:12 AMInternal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.I also see messages from the server:
[2022-01-03 033608,796] ERROR in app: Exception on /action [POST]
Traceback (most recent call last):
File "/home/david.fang/.local/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/home/david.fang/.local/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/david.fang/.local/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/home/david.fang/.local/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "app.py", line 76, in action
todos.insert({ "name":name, "desc":desc, "date":date, "pr":pr, "done":"no"})
File "/home/david.fang/.local/lib/python3.6/site-packages/pymongo/collection.py", line 2587, in call
self.__name.split(".")[-1])
TypeError: 'Collection' object is not callable. If you meant to call the 'insert' method on a 'Collection' object it is failing because no such method exists.
10.34.8.1 - - [03/Jan/2022 033608] "POST /action HTTP/1.1" 500 -Please shed some lights. Thanks! PS I already tried installing the pymongo module. Also is there any more information/tutorial/example for me to learn how python's instrumentation is done?
Pranay
Vishal Sharma
01/03/2022, 10:20 AMDavid Fang
01/03/2022, 9:51 PMDavid Fang
01/04/2022, 12:24 AMVishal Sharma
01/04/2022, 7:17 AMpip3 freeze
and check which version of flask, pymongo and requests are installed?
Are you able to view the homepage for the sample todo app?Vishal Sharma
01/04/2022, 7:20 AMDavid Fang
01/04/2022, 10:32 PMadal==1.2.7
aiocontextvars==0.2.2
backoff==1.10.0
backports.zoneinfo==0.2.1
boto==2.49.0
bson==0.5.10
cachetools==4.2.2
cdiff==1.0
certifi==2021.5.30
cffi==1.14.6
charset-normalizer==2.0.4
click==8.0.1
contextvars==2.4
cryptography==3.4.8
dataclasses==0.8
Deprecated==1.2.13
dnspython==2.1.0
Flask==2.0.2
google-auth==2.0.2
googleapis-common-protos==1.54.0
grpcio==1.43.0
idna==3.2
immutables==0.16
importlib-metadata==4.8.1
importlib-resources==5.2.2
itsdangerous==2.0.1
Jinja2==3.0.3
kazoo==2.8.0
kubernetes==7.0.0
MarkupSafe==2.0.1
oauthlib==3.1.1
opentelemetry-api==1.7.1
opentelemetry-distro==0.26b1
opentelemetry-exporter-otlp==1.7.1
opentelemetry-exporter-otlp-proto-grpc==1.7.1
opentelemetry-exporter-otlp-proto-http==1.7.1
opentelemetry-instrumentation==0.26b1
opentelemetry-instrumentation-aws-lambda==0.26b1
opentelemetry-instrumentation-boto==0.26b1
opentelemetry-instrumentation-dbapi==0.26b1
opentelemetry-instrumentation-flask==0.26b1
opentelemetry-instrumentation-grpc==0.26b1
opentelemetry-instrumentation-jinja2==0.26b1
opentelemetry-instrumentation-logging==0.26b1
opentelemetry-instrumentation-psycopg2==0.26b1
opentelemetry-instrumentation-requests==0.26b1
opentelemetry-instrumentation-sqlite3==0.26b1
opentelemetry-instrumentation-urllib==0.26b1
opentelemetry-instrumentation-urllib3==0.26b1
opentelemetry-instrumentation-wsgi==0.26b1
opentelemetry-propagator-aws-xray==1.0.1
opentelemetry-proto==1.7.1
opentelemetry-sdk==1.7.1
opentelemetry-semantic-conventions==0.26b1
opentelemetry-util-http==0.26b1
patroni==2.1.1
prettytable==2.2.0
protobuf==3.19.1
psutil==5.8.0
psycopg2==2.7.7
psycopg2-binary==2.9.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
PyJWT==2.1.0
pymongo==4.0.1
python-consul==1.1.0
python-dateutil==2.8.2
python-etcd==0.4.5
PyYAML==5.4.1
requests==2.26.0
requests-oauthlib==1.3.0
rsa==4.7.2
six==1.16.0
typing-extensions==3.10.0.2
tzlocal==3.0
urllib3==1.26.6
wcwidth==0.2.5
websocket-client==1.2.1
Werkzeug==2.0.2
wrapt==1.13.3
ydiff==1.2
zipp==3.5.0
David Fang
01/04/2022, 10:32 PMVishal Sharma
01/05/2022, 5:20 AMpip3 install pymongo==3.12.1
Also I will update the pymongo version in requirements.txt.David Fang
01/05/2022, 9:18 PMDavid Fang
01/05/2022, 10:09 PMDavid Fang
01/06/2022, 12:36 AMVishal Sharma
01/06/2022, 5:53 AMDavid Fang
01/06/2022, 7:08 AMDavid Fang
01/06/2022, 7:08 AMVishal Sharma
01/06/2022, 7:09 AM