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

Issues with docker installation #423

Open
mrkvon opened this issue Feb 11, 2022 · 8 comments
Open

Issues with docker installation #423

mrkvon opened this issue Feb 11, 2022 · 8 comments

Comments

@mrkvon
Copy link
Contributor

mrkvon commented Feb 11, 2022

When we tried to install this application with docker, we encountered an error described below

Preparation

  • clone this repository
  • copy .env-sample to .env
  • run docker-compose build
  • run docker-compose up

The issue:

The command docker-compose up fails with the following error:

OCI runtime create failed: starting container process caused: exec: "/klub-v/venv/bin/celery": stat /klub-v/venv/bin/celery: no such file or directory: unknown

What we expect

docker-compose up runs without failure

Details

The two attempts described below came from two different computers, but the error is the same. Therefore the error seems to be in this repository, not on our side.
(This can be reproduced on clean install. Not necessarily on rebuild.)

Error may refer to docker-compose.yaml (or not)

Error & log reported by @agatatalitatest (Debian or Ubuntu)

Pulling postgres (mdillon/postgis:9.6-alpine)...
9.6-alpine: Pulling from mdillon/postgis
8e402f1a9c57: Already exists
12541ba6b234: Already exists
005e29442040: Already exists
5d85b185b262: Already exists
1ab8f9222924: Already exists
1c01fc6659ed: Already exists
93353b12fcd7: Already exists
ae14d4876582: Already exists
f35790dc2ae9: Already exists
9d39721c8905: Already exists
3b3262b526bf: Already exists
c6d924bd497b: Already exists
Digest: sha256:1c5fd456109ccb065d7fccd8e24da18600a35c9db488dcdfa40b2ebc03dab8b5
Status: Downloaded newer image for mdillon/postgis:9.6-alpine
Starting klub_redis_1      ... done
Recreating klub_postgres_1 ... done
Creating klub_web_1        ...
Creating klub_celery_1      ... error
Creating klub_celery-beat_1 ...
Creating klub_flower_1      ... done

ERROR: for klub_celery_1  Cannot start service celery: b'OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/klub-v/veCreating klub_celery-beat_1 ... error
'

Creating klub_web_1         ... done
reate failed: container_linux.go:380: starting container process caused: exec: "/klub-v/venv/bin/celery": stat /klub-v/venv/bin/celery: no such file or directory: unknown'

ERROR: for celery  Cannot start service celery: b'OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/klub-v/venv/bin/celery": stat /klub-v/venv/bin/celery: no such file or directory: unknown'

ERROR: for celery-beat  Cannot start service celery-beat: b'OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/klub-v/venv/bin/celery": stat /klub-v/venv/bin/celery: no such file or directory: unknown'
ERROR: Encountered errors while bringing up the project.

Error & log reported by @mrkvon (Arch Linux)

[+] Running 7/7
 ⠿ Network klub_default          Created
 ⠿ Container klub-redis-1        Created
 ⠿ Container klub-postgres-1     Created
 ⠿ Container klub-celery-beat-1  Created
 ⠿ Container klub-web-1          Created
 ⠿ Container klub-celery-1       Created
 ⠿ Container klub-flower-1       Created
Attaching to klub-celery-1, klub-celery-beat-1, klub-flower-1, klub-postgres-1, klub-redis-1, klub-web-1
klub-redis-1        | 1:C 11 Feb 2022 09:28:47.319 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
klub-redis-1        | 1:C 11 Feb 2022 09:28:47.319 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
klub-redis-1        | 1:C 11 Feb 2022 09:28:47.319 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
klub-redis-1        | 1:M 11 Feb 2022 09:28:47.320 * monotonic clock: POSIX clock_gettime
klub-redis-1        | 1:M 11 Feb 2022 09:28:47.320 * Running mode=standalone, port=6379.
klub-redis-1        | 1:M 11 Feb 2022 09:28:47.320 # Server initialized
klub-redis-1        | 1:M 11 Feb 2022 09:28:47.320 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
klub-redis-1        | 1:M 11 Feb 2022 09:28:47.321 * Ready to accept connections
klub-postgres-1     | LOG:  database system was shut down at 2022-02-11 09:28:26 UTC
klub-postgres-1     | LOG:  MultiXact member wraparound protections are now enabled
klub-postgres-1     | LOG:  database system is ready to accept connections
klub-postgres-1     | LOG:  autovacuum launcher started
klub-flower-1       | [I 220211 10:28:53 base:219] Raven is not configured (logging is disabled). Please see the documentation for more information.
klub-flower-1       | [I 220211 10:28:54 command:138] Visit me at http://localhost:5555
klub-flower-1       | [I 220211 10:28:54 command:145] Broker: redis://redis:6379//
klub-flower-1       | [I 220211 10:28:54 command:146] Registered tasks: 
klub-flower-1       |     ['aklub.tasks.check_autocom_daily',
klub-flower-1       |      'aklub.tasks.check_darujme',
klub-flower-1       |      'aklub.tasks.clear_expired_tokens',
klub-flower-1       |      'aklub.tasks.create_mass_communication_tasks',
klub-flower-1       |      'aklub.tasks.generate_tax_confirmations',
klub-flower-1       |      'aklub.tasks.parse_account_statement',
klub-flower-1       |      'aklub.tasks.post_office_send_mail',
klub-flower-1       |      'aklub.tasks.send_communication_task',
klub-flower-1       |      'celery.accumulate',
klub-flower-1       |      'celery.backend_cleanup',
klub-flower-1       |      'celery.chain',
klub-flower-1       |      'celery.chord',
klub-flower-1       |      'celery.chord_unlock',
klub-flower-1       |      'celery.chunks',
klub-flower-1       |      'celery.group',
klub-flower-1       |      'celery.map',
klub-flower-1       |      'celery.starmap',
klub-flower-1       |      'djcelery_email_send_multiple',
klub-flower-1       |      'helpdesk.tasks.helpdesk_process_email',
klub-flower-1       |      'import_export_celery.tasks.run_export_job',
klub-flower-1       |      'import_export_celery.tasks.run_import_job',
klub-flower-1       |      'smmapdfs.tasks.make_pdfsandwich',
klub-flower-1       |      'smmapdfs.tasks.send_pdfsandwich']
klub-flower-1       | [I 220211 10:28:54 mixins:229] Connected to redis://redis:6379//
Error response from daemon: failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: exec: "/klub-v/venv/bin/celery": stat /klub-v/venv/bin/celery: no such file or directory: unknown
@mrkvon mrkvon changed the title docker-compose up fails with /klub-v/venv/bin/celery: no such file or directory docker-compose up fails with /klub-v/venv/bin/celery: no such file or directory Feb 11, 2022
@timthelion
Copy link
Member

This is totally normal and expected behavior. We're launching cellery on first run, before it has been installed. The next bit in the readme where we do pip3 install -r requirements.txt installs celery,and when we run ./develop.sh celery is restarted properly.

@mrkvon
Copy link
Contributor Author

mrkvon commented Feb 11, 2022

I can confirm that when i got all the way to the step pip3 install -r requirements.txt, docker-compose up succeeded the second time.

It would be helpful if this is reflected in the documentation. Otherwise the failure is confusing.

Now, the further step: django-admin.py migrate fails with

(venv) test@e7b597e9efbf:/klub-v$ django-admin.py migrate
Traceback (most recent call last):
  File "/klub-v/venv/bin/django-admin.py", line 21, in <module>
    management.execute_from_command_line()
  File "/klub-v/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/klub-v/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/klub-v/venv/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/klub-v/venv/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "/klub-v/venv/lib/python3.8/site-packages/django/core/management/base.py", line 82, in wrapped
    saved_locale = translation.get_language()
  File "/klub-v/venv/lib/python3.8/site-packages/django/utils/translation/__init__.py", line 254, in get_language
    return _trans.get_language()
  File "/klub-v/venv/lib/python3.8/site-packages/django/utils/translation/__init__.py", line 57, in __getattr__
    if settings.USE_I18N:
  File "/klub-v/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 82, in __getattr__
    self._setup(name)
  File "/klub-v/venv/lib/python3.8/site-packages/django/conf/__init__.py", line 63, in _setup
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

According to this stackoverflow answer I tried to set the environment variable with

export DJANGO_SETTINGS_MODULE=project.settings.local_sample

(as written in .env file)

but that fails with

ModuleNotFoundError: No module named 'project'

So there seems to be a double issue:

How to resolve this?

(btw I run into the same issue when installing without docker as well (as described in README of this project))

@mrkvon mrkvon changed the title docker-compose up fails with /klub-v/venv/bin/celery: no such file or directory Issues with docker installation Feb 11, 2022
@timthelion
Copy link
Member

Vzorová lokální konfigurace je v .env-sample, stačí přejmenovat na .env a doplnit SECRET_KEY.

@timthelion
Copy link
Member

Yeah,the README could use some cleanup

@mrkvon
Copy link
Contributor Author

mrkvon commented Feb 11, 2022

Vzorová lokální konfigurace je v .env-sample, stačí přejmenovat na .env a doplnit SECRET_KEY.

Yes, we did that. As I mentioned before:

When you set up the project from scratch, it works for you out of the box? I wonder whether these are quirks of my local system (shouldn't be! it's docker. it should just work.), or whether you have some historical settings that new setups don't.

@timthelion
Copy link
Member

I just tried setting up the project from scratch and indeed I noticed a number of issues with the README. Here are full up to date instructions https://youtu.be/KPfagaDdAKI

@timthelion
Copy link
Member

Hopefully you can understand, I only figured out that there was a problem with microphone echo after I finished recording :/

@mrkvon
Copy link
Contributor Author

mrkvon commented Feb 13, 2022

@timthelion The screencast was indeed helpful with running the project. Thank you for making it. It may be useful to include the link to the video in README.

The issues encountered in the screencast were very similar to the issues i encountered.
The key points to be aware of during installation:

  • it's necessary to run all the steps to pip3 install -r requirements.txt, then restarting the process (without installation)
  • fixing the ownership issues with folders db and venv
  • using python3 manage.py ... instead of django-admin.py ... for the steps migrate and createsuperuser2

I think the last two points are not reflected in README. Otherwise IMO this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants