wagtail / gitpod-wagtail-develop

6 stars 7 forks source link

gitpod-wagtail-develop environment fails during setup #7

Closed enzedonline closed 4 months ago

enzedonline commented 4 months ago

Issue Summary

Not sure if this is maintained here, but since it's included in the Contributing docs I'll report it here.

Setting up a dev environment with the gitpod-wagtail-develop project, the project fails with npm, pip and syntax errors:

## npm warnings:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'wagtail@1.0.0',
npm WARN EBADENGINE   required: { node: '>=20.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@sindresorhus/merge-streams@1.0.0',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'copy-webpack-plugin@12.0.2',
npm WARN EBADENGINE   required: { node: '>= 18.12.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'globby@14.0.0',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'expose-loader@5.0.0',
npm WARN EBADENGINE   required: { node: '>= 18.12.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'execa@8.0.1',
npm WARN EBADENGINE   required: { node: '>=16.17' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'human-signals@5.0.0',
npm WARN EBADENGINE   required: { node: '>=16.17.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'lru-cache@10.2.0',
npm WARN EBADENGINE   required: { node: '14 || >=16.14' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-loader@8.1.0',
npm WARN EBADENGINE   required: { node: '>= 18.12.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'react-docgen@7.0.3',
npm WARN EBADENGINE   required: { node: '>=16.14.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'sass-loader@14.1.0',
npm WARN EBADENGINE   required: { node: '>= 18.12.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'unicorn-magic@0.1.0',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
## pip errors:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
sphinx 7.1.2 requires docutils<0.21,>=0.18.1, but you have docutils 0.15.2 which is incompatible.
semgrep 1.40.0 requires urllib3~=1.26, but you have urllib3 1.25.11 which is incompatible.
myst-parser 2.0.0 requires docutils<0.21,>=0.16, but you have docutils 0.15.2 which is incompatible.
twine 3.8.0 requires urllib3>=1.26.0, but you have urllib3 1.25.11 which is incompatible.
## load_initial_data error
Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_from_command_line(sys.argv)
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/core/management/base.py", line 106, in wrapper
    res = handle_func(*args, **kwargs)
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 117, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/db/migrations/executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/db/migrations/loader.py", line 58, in __init__
    self.build_graph()
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/db/migrations/loader.py", line 235, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
    if self.has_table():
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/db/migrations/recorder.py", line 57, in has_table
    with self.connection.cursor() as cursor:
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/db/backends/base/base.py", line 330, in cursor
    return self._cursor()
  File "/workspace/.pip-modules/lib/python3.8/site-packages/django/db/backends/dummy/base.py", line 20, in complain
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
Unknown command: 'load_initial_data'. Did you mean loaddata?
## ALLOWED HOSTS error
CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False.

Steps to Reproduce

Set up a new environment from the link, either browser or VSCode based.

gasman commented 4 months ago

Thanks for reporting, @enzedonline! Can confirm I'm seeing the same thing.

The npm issues appear to be because Wagtail currently specifies node 20, but the gitpod environment apparently only provides node 16 as standard. The webpack command does still seem to be producing sensible output, but that may only be building the packaged js, not the css.

The final manage.py step is failing because we've changed the way bakerydemo's settings modules work - before https://github.com/wagtail/bakerydemo/commit/d7a607a26e5190bb49048f7041eef63ecea8f1e4, the bakerydemo.settings.local module imported all of the generic settings, so this was a valid thing to set as the DJANGO_SETTINGS_MODULE environment variable. The correct value is now bakerydemo.settings.dev (the default as set in manage.py), so the line that places DJANGO_SETTINGS_MODULE=bakerydemo.settings.local into .env should be removed.

gasman commented 4 months ago

Fixed in #8