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

No docker website on http://localhost:8081 #119

Closed
larseggert opened this issue Sep 7, 2021 · 4 comments
Closed

No docker website on http://localhost:8081 #119

larseggert opened this issue Sep 7, 2021 · 4 comments
Labels
internal Fix internally

Comments

@larseggert
Copy link
Contributor

Trying to follow the instructions in main/install.md. docker-compose seems to have finished and all containers are running. Last line in console log is:

frontend_1     | webpack 5.41.1 compiled successfully in 45383 ms

But nothing seems to be listening on http://localhost:8081?

@larseggert
Copy link
Contributor Author

OK, it seems a website is brought up on http://localhost:8001/
But that throws the following error on access:

Environment:


Request Method: GET
Request URL: http://localhost:8001/

Django Version: 2.2.19
Python Version: 3.6.14
Installed Applications:
('ietf.home',
 'ietf.blog',
 'ietf.events',
 'ietf.search',
 'ietf.forms',
 'ietf.snippets',
 'ietf.standard',
 'ietf.topics',
 'ietf.glossary',
 'ietf.utils',
 'ietf.bibliography',
 'ietf.images',
 'ietf.documents',
 'ietf.iesg_statement',
 'wagtail.contrib.forms',
 'wagtail.contrib.redirects',
 'wagtail.embeds',
 'wagtail.sites',
 'wagtail.users',
 'wagtail.snippets',
 'wagtail.documents',
 'wagtail.images',
 'wagtail.search',
 'wagtail.contrib.search_promotions',
 'wagtail.admin',
 'wagtail.core',
 'wagtail.contrib.settings',
 'wagtail.contrib.table_block',
 'wagtail.contrib.postgres_search',
 'wagtail.contrib.routable_page',
 'modelcluster',
 'compressor',
 'taggit',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admindocs',
 'mod_wsgi.server',
 'analytical')
Installed Middleware:
['django.middleware.cache.UpdateCacheMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'wagtail.contrib.redirects.middleware.RedirectMiddleware',
 'django.middleware.cache.FetchFromCacheMiddleware']



Traceback:

File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py" in _execute
  84.                 return self.cursor.execute(sql, params)

The above exception (relation "wagtailcore_site" does not exist
LINE 1: ...vision_id", "wagtailcore_page"."alias_of_id" FROM "wagtailco...
                                                             ^
) was the direct cause of the following exception:

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.6/site-packages/wagtail/core/views.py" in serve
  12.     site = Site.find_for_request(request)

File "/usr/local/lib/python3.6/site-packages/wagtail/core/models.py" in find_for_request
  244.             site = Site._find_for_request(request)

File "/usr/local/lib/python3.6/site-packages/wagtail/core/models.py" in _find_for_request
  254.             site = get_site_for_hostname(hostname, port)

File "/usr/local/lib/python3.6/site-packages/wagtail/core/sites.py" in get_site_for_hostname
  36.         'root_page'

File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py" in __iter__
  274.         self._fetch_all()

File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py" in _fetch_all
  1242.             self._result_cache = list(self._iterable_class(self))

File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py" in __iter__
  55.         results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)

File "/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py" in execute_sql
  1142.             cursor.execute(sql, params)

File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
  99.             return super().execute(sql, params)

File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py" in execute
  67.         return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)

File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py" in _execute_with_wrappers
  76.         return executor(sql, params, many, context)

File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py" in _execute
  84.                 return self.cursor.execute(sql, params)

File "/usr/local/lib/python3.6/site-packages/django/db/utils.py" in __exit__
  89.                 raise dj_exc_value.with_traceback(traceback) from exc_value

File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py" in _execute
  84.                 return self.cursor.execute(sql, params)

Exception Type: ProgrammingError at /
Exception Value: relation "wagtailcore_site" does not exist
LINE 1: ...vision_id", "wagtailcore_page"."alias_of_id" FROM "wagtailco...
                                                             ^


@kesara kesara added the internal Fix internally label Sep 7, 2021
@kesara kesara self-assigned this Sep 7, 2021
@kesara
Copy link
Member

kesara commented Sep 7, 2021

Looks like the steps in install.md doesn't cover the scenario where database dump is missing.
To get this working locally, you will to take extra steps like:

# assuming wagtail_website_application_1 is the docker label for the python application instance

# run migrations
docker exec -ti wagtail_website_application_1 python manage.py migrate

# create cache table
docker exec -ti wagtail_website_application_1 python manage.py createcachetable

# create an admin user
docker exec -ti wagtail_website_application_1 python manage.py createsuperuser
  • Log in to http://localhost:8001/admin/
  • Create a new "Home Page" (page type must be Home Page) and publish.
  • Then go to "settings" -> "sites" and select the new Home Page as the root page for the localhost and save.
    Now http://localhost:8001/ will show something similar to IETF website.

I'll update the instructions for now, but we should come up with some stub data to make this experience better.

@rjsparks
Copy link
Member

rjsparks commented Sep 7, 2021

I ran through a fresh install, and if you put the database dump in the right place, all the steps above (except for the createsuperuser step) just happen.

@larseggert
Copy link
Contributor Author

larseggert commented Sep 8, 2021

I'll try this again, first with the database dump @rjsparks sent me, and then without.

OK, with a clean docker setup (after docker system prune) and with the compressed database dump in place, docker-compose up seems to do things related to setting up the database.

What I had done yesterday was run docker-compose up without a database dump, which failed, and then moved the database dump into place, followed by docker-compose up again, which then didn't run through the database setup steps I see it run through now, and hence still failed. I think this is an issue with how you build your docker images based on what is in place and what isn't?

One suggestion would be to have CI build the images with the database and media file dumps regularly, and have people pull them instead of building them locally?

@kesara kesara removed their assignment Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Fix internally
Projects
None yet
Development

No branches or pull requests

3 participants