Status page not connection

hello,
I need help when I executed this url: http://localhost:5000/status not load any page. I could not process my project . Need help. I found the following error.

‘chcp’ is not recognized as an internal or external command,
operable program or batch file.

(base) C:\Users\asam2>cd\mflix-python

(base) C:\mflix-python>pytest -m projection
============================= test session starts =============================
platform win32 – Python 3.7.1, pytest-4.0.2, py-1.7.0, pluggy-0.8.0
rootdir: C:\mflix-python, inifile:
plugins: remotedata-0.3.1, openfiles-0.3.1, doctestplus-0.2.0, arraydiff-0.3
collected 43 items / 41 deselected

tests\test_projection.py EE [100%]

=================================== ERRORS ====================================
_______________ ERROR at setup of test_basic_country_search_db ________________
file C:\mflix-python\tests\test_projection.py, line 11
@pytest.mark.projection
def test_basic_country_search_db(client):
E fixture ‘client’ not found

  available fixtures: app, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\mflix-python\tests\test_projection.py:11
____________ ERROR at setup of test_basic_country_search_shape_db _____________
file C:\mflix-python\tests\test_projection.py, line 18
@pytest.mark.projection
def test_basic_country_search_shape_db(client):
E fixture ‘client’ not found

  available fixtures: app, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

C:\mflix-python\tests\test_projection.py:18
=================== 41 deselected, 2 error in 0.61 seconds ====================

(base) C:\mflix-python>python run.py

  • Restarting with stat
  • Debugger is active!
  • Debugger PIN: 305-063-618
  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
    127.0.0.1 - - [14/Jan/2019 12:56:11] “GET /status HTTP/1.1” 200 -
    127.0.0.1 - - [14/Jan/2019 12:56:11] “GET /static/css/main.61f16bdd.css HTTP/1.1” 304 -
    127.0.0.1 - - [14/Jan/2019 12:56:11] “GET /static/js/main.773a0f83.js HTTP/1.1” 304 -
    127.0.0.1 - - [14/Jan/2019 12:56:12] “GET /static/media/mongoleaf.0ebc1843.png HTTP/1.1” 304 -
    127.0.0.1 - - [14/Jan/2019 12:56:17] “GET /api/v1/movies/countries?countries=Australia HTTP/1.1” 400 -
    127.0.0.1 - - [14/Jan/2019 12:56:20] “GET /api/v1/movies/ HTTP/1.1” 500 -
    Traceback (most recent call last):
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1997, in call
    return self.wsgi_app(environ, start_response)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1985, in wsgi_app
    response = self.handle_exception(e)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_cors\extension.py”, line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_compat.py”, line 33, in reraise
    raise value
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1982, in wsgi_app
    response = self.full_dispatch_request()
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_cors\extension.py”, line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_compat.py”, line 33, in reraise
    raise value
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1612, in full_dispatch_request
    rv = self.dispatch_request()
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1598, in dispatch_request
    return self.view_functionsrule.endpoint
    File “C:\mflix-python\mflix\api\movies.py”, line 26, in api_get_movies
    None, page=0, movies_per_page=MOVIES_PER_PAGE)
    File “C:\mflix-python\mflix\db.py”, line 222, in get_movies
    total_num_movies = db.movies.count_documents(query)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\collection.py”, line 1683, in count_documents
    with self._socket_for_reads(session) as (sock_info, slave_ok):
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\mongo_client.py”, line 1101, in _socket_for_reads
    with self._get_socket(server) as sock_info:
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\mongo_client.py”, line 1058, in _get_socket
    with server.get_socket(self.__all_credentials) as sock_info:
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 1006, in get_socket
    sock_info.check_auth(all_credentials)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 677, in check_auth
    auth.authenticate(credentials, self)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 542, in authenticate
    auth_func(credentials, sock_info)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 517, in _authenticate_default
    return _authenticate_scram(credentials, sock_info, ‘SCRAM-SHA-1’)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 245, in _authenticate_scram
    res = sock_info.command(source, cmd)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 579, in command
    unacknowledged=unacknowledged)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\network.py”, line 150, in command
    parse_write_concern_error=parse_write_concern_error)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\helpers.py”, line 155, in _check_command_response
    raise OperationFailure(msg % errmsg, code, response)
    pymongo.errors.OperationFailure: Authentication failed.
    127.0.0.1 - - [14/Jan/2019 12:56:20] “GET /api/v1/movies/search?cast=Griffin%20Gluck HTTP/1.1” 500 -
    Traceback (most recent call last):
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1997, in call
    return self.wsgi_app(environ, start_response)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1985, in wsgi_app
    response = self.handle_exception(e)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_cors\extension.py”, line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_compat.py”, line 33, in reraise
    raise value
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1982, in wsgi_app
    response = self.full_dispatch_request()
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_cors\extension.py”, line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_compat.py”, line 33, in reraise
    raise value
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1612, in full_dispatch_request
    rv = self.dispatch_request()
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1598, in dispatch_request
    return self.view_functionsrule.endpoint
    File “C:\mflix-python\mflix\api\movies.py”, line 68, in api_search_movies
    filters, page, DEFAULT_MOVIES_PER_PAGE)
    File “C:\mflix-python\mflix\db.py”, line 222, in get_movies
    total_num_movies = db.movies.count_documents(query)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\collection.py”, line 1683, in count_documents
    with self._socket_for_reads(session) as (sock_info, slave_ok):
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\mongo_client.py”, line 1101, in _socket_for_reads
    with self._get_socket(server) as sock_info:
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\mongo_client.py”, line 1058, in _get_socket
    with server.get_socket(self.__all_credentials) as sock_info:
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 1006, in get_socket
    sock_info.check_auth(all_credentials)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 677, in check_auth
    auth.authenticate(credentials, self)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 542, in authenticate
    auth_func(credentials, sock_info)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 517, in _authenticate_default
    return _authenticate_scram(credentials, sock_info, ‘SCRAM-SHA-1’)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 245, in _authenticate_scram
    res = sock_info.command(source, cmd)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 579, in command
    unacknowledged=unacknowledged)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\network.py”, line 150, in command
    parse_write_concern_error=parse_write_concern_error)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\helpers.py”, line 155, in _check_command_response
    raise OperationFailure(msg % errmsg, code, response)
    pymongo.errors.OperationFailure: Authentication failed.
    127.0.0.1 - - [14/Jan/2019 12:56:21] “GET /api/v1/movies/search?cast=Morgan%20Freeman&page=0 HTTP/1.1” 500 -
    Traceback (most recent call last):
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1997, in call
    return self.wsgi_app(environ, start_response)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1985, in wsgi_app
    response = self.handle_exception(e)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_cors\extension.py”, line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_compat.py”, line 33, in reraise
    raise value
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1982, in wsgi_app
    response = self.full_dispatch_request()
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_cors\extension.py”, line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask_compat.py”, line 33, in reraise
    raise value
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1612, in full_dispatch_request
    rv = self.dispatch_request()
    File “C:\Users\asam2\Anaconda3\lib\site-packages\flask\app.py”, line 1598, in dispatch_request
    return self.view_functionsrule.endpoint
    File “C:\mflix-python\mflix\api\movies.py”, line 68, in api_search_movies
    filters, page, DEFAULT_MOVIES_PER_PAGE)
    File “C:\mflix-python\mflix\db.py”, line 222, in get_movies
    total_num_movies = db.movies.count_documents(query)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\collection.py”, line 1683, in count_documents
    with self._socket_for_reads(session) as (sock_info, slave_ok):
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\mongo_client.py”, line 1101, in _socket_for_reads
    with self._get_socket(server) as sock_info:
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\mongo_client.py”, line 1058, in _get_socket
    with server.get_socket(self.__all_credentials) as sock_info:
    File “C:\Users\asam2\Anaconda3\lib\contextlib.py”, line 112, in enter
    return next(self.gen)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 1006, in get_socket
    sock_info.check_auth(all_credentials)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 677, in check_auth
    auth.authenticate(credentials, self)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 542, in authenticate
    auth_func(credentials, sock_info)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 517, in _authenticate_default
    return _authenticate_scram(credentials, sock_info, ‘SCRAM-SHA-1’)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\auth.py”, line 245, in _authenticate_scram
    res = sock_info.command(source, cmd)
    File “C:\Users\asam2\Anaconda3\lib\site-packages\pymongo\pool.py”, line 579, in command

Hello Sab2016,

Were you able to solve the Connection ticket?
Also, check you Internet connection and make sure it is fine.

Thanks,
Shahul

No i could not solve it

OK. The pytest still gives me error. But I am able to execute run.py without any issue after my internet was fixed.

Hi Shahul,

I am very frustrated the error. No help

Thanks

Sorry to hear. I know it will be really frustrating. I am taking this course for the 2nd time since I couldnt do anything on my first attempt.

After executing python run.py, were you able to access mflix homepage using localhost:5000? Also, what validation codes are you getting at http://localhost:5000/status? It takes a while for the status page to show the statuses though.

Thanks,
Shahul

Hi @sab2016,

Sorry for the delay in the reply.

Have you edited the .ini file with your atlas mongodb uri?

Do not forget to enable the ip whitelisting in your Atlas dashboard, as instructed in the README file and lesson:


  1. Next, configure the security settings of this cluster, by enabling the IP
    Whitelist
    and MongoDB Users:

1 Like