oppia: [Setup Issue] Can not start the dev server in setup process while using Docker on Windows

Platform: Docker on Windows @justcrossheaven and @manishaag7 both have been facing the following issue while using python -m scripts.start while setting up the project.

image

Tried solutions(not worked)

  • deleting oppia_tools directory
  • pip install future and six

Diagnosis checks

  • python -c "import Queue" - No output and it is the expected behavior.

@manishaag7 only got python 2 installed in his laptop.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 46 (24 by maintainers)

Most upvoted comments

Hey @gp201 and @EricZLou , Thank you for your help. Finally the development server started successfully. I can access the website on localhost:8181. To make it work, I had to downgrade my WSL 2 to WSL 1 and then I started the elastic search server on a separate terminal using this command ./oppia_tools/elasticsearch-7.10.1/bin/elasticsearch .

Everything is working except for this page http://localhost:8181/community-library. It is not able to fetch the lessons from the elastic search server. On the terminal is showing timeout error and elastic search is not able to fetch data.

community-library-error

WARNING  2021-03-22 11:43:20,920 base.py:281] PUT http://localhost:9200/collections [status:N/A request:10.007s]
Traceback (most recent call last):
  File "/home/skull/opensource/oppia/third_party/python_libs/elasticsearch/connection/http_urllib3.py", line 246, in perform_request
    method, url, body, retries=Retry(False), headers=request_headers, **kw
  File "/home/skull/opensource/oppia/third_party/python_libs/urllib3/connectionpool.py", line 727, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/skull/opensource/oppia/third_party/python_libs/urllib3/util/retry.py", line 386, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/home/skull/opensource/oppia/third_party/python_libs/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/home/skull/opensource/oppia/third_party/python_libs/urllib3/connectionpool.py", line 428, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/home/skull/opensource/oppia/third_party/python_libs/urllib3/connectionpool.py", line 336, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
ReadTimeoutError: HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10)
ERROR    2021-03-22 11:43:21,079 base.py:464] Traceback (most recent call last):
  File "/home/skull/opensource/oppia/third_party/python_libs/webapp2.py", line 604, in dispatch
    return method(*args, **kwargs)
  File "/home/skull/opensource/oppia/core/controllers/acl_decorators.py", line 86, in test_can_access
    return handler(self, *args, **kwargs)
  File "/home/skull/opensource/oppia/core/controllers/library.py", line 121, in get
    constants.DEFAULT_LANGUAGE_CODE])
INFO     2021-03-22 11:43:21,177 module.py:865] default: "GET /libraryindexhandler HTTP/1.1" 500 168
  File "/home/skull/opensource/oppia/core/domain/summary_services.py", line 494, in get_library_groups
    '', group['search_categories'], language_codes, 8)[0]
  File "/home/skull/opensource/oppia/core/domain/search_services.py", line 247, in search_collections
    offset=offset, size=size, ids_only=True)
  File "/home/skull/opensource/oppia/core/platform/search/elastic_search_services.py", line 222, in search
    _create_index(index_name)
  File "/home/skull/opensource/oppia/core/platform/search/elastic_search_services.py", line 48, in _create_index
    ES.indices.create(index_name)
  File "/home/skull/opensource/oppia/third_party/python_libs/elasticsearch/client/utils.py", line 152, in _wrapped
    return func(*args, params=params, headers=headers, **kwargs)
  File "/home/skull/opensource/oppia/third_party/python_libs/elasticsearch/client/indices.py", line 124, in create
    "PUT", _make_path(index), params=params, headers=headers, body=body
  File "/home/skull/opensource/oppia/third_party/python_libs/elasticsearch/transport.py", line 392, in perform_request
    raise e
ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10))

ERROR    2021-03-22 11:43:21,080 base.py:474] Exception raised: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10))

@EricZLou and @gp201. I had to reset my Ubuntu 18.04 on WSL. Cleared all the data. Then again tried installing Oppia and finally this time it worked. 🎉 . I would like to know the port number at which the Oppia is running. I am unable to find it. 😅

@EricZLou and @gp201. I am trying to do a fresh install of WSL2 and will install Ubuntu 18.04 on it. I hope this will work, I will update you about the result.

Great to hear you got the devserver working @MohdImran001!!

Looks like you’ve run into some connection bug that pops up every now and then for Windows developers. If a page doesn’t load (like the library page), just try refreshing it and see if it loads correctly the 2nd time. In the meantime, I’ll file a bug report for this and see if we can find anything.

@MohdImran001 can you probably put a couple of print stmts in the below file and see where the problem is? https://github.com/oppia/oppia/blob/8d39eb9a2f1f1443c1b7af06e6cc43c00cafa218/scripts/start.py#L107

@MohdImran001 Can you send a picture? can you also take a pic of the CPU load and disk usage. (Not sure if it will change anything)

For development on Windows machines, we actually need to use python -m scripts.start --no_browser. Also, there’s an ongoing issue with failing to start localhost, and you will probably need to make the change noted here before running the start command.

Let us know if that works!

@EricZLou I doubt it is an issue for Docker alone since it is occurring in WSL too. @MohdImran001 had installed Oppia in windows WSL and is facing it. see the comment above

Also if we think there may be an error in the urllib3 package, maybe it’d be easier to post an issue on their Github? They’re active on Github and may have some insights. @gp201

Not sure if this would make a difference, but note that the Docker for Windows instructions were never tested inside WSL or WSL2. It is meant to be done directly in Windows Command Prompt.

@MohdImran001 @manishaag7 @justcrossheaven are you all using Docker inside WSL/WSL2? If you already have WSL2 installed, you’re very close to completing the first option for Windows setup instructions (Installing Oppia in Windows and WSL2").

And I’ll try the Docker setup in Windows Command Prompt to see if it’s still functional or if it throws the same error as you’re all getting.

@manishaag7 @justcrossheaven and @MohdImran001 can you do the following change to the code:

Can you try what’s given in the thread below and report the results here? https://github.com/python-zk/kazoo/issues/239

@manishaag7 and @justcrossheaven can you follow this wiki. The “Setup related questions” section.

@MohdImran001 can you also follow this and report it here?