cookiecutter-openedx / openedx-plugin-example

Python-Django scaffolding for common use cases
GNU Affero General Public License v3.0
14 stars 7 forks source link

Facing issues while installation process #18

Closed zameel7 closed 8 months ago

zameel7 commented 9 months ago

Steps done:

Facing issue:

Traceback (most recent call last):
  File "./manage.py", line 106, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/openedx/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/openedx/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/openedx/venv/lib/python3.8/site-packages/openedx_plugin_api/management/commands/openedx_plugin_api_init.py", line 42, in handle
    raise Exception("Missing required parameters")
Exception: Missing required parameters
command terminated with exit code 1

The error seems to be raised because the handle function inside openedx_plugin_api_init tries to get PLUGIN_API_USER_EMAIL, PLUGIN_API_USER_NAME, PLUGIN_API_USER_PASSWORD, OPENEDX_COMPLETE_DOMAIN_NAME, which is being taken from os.env.

https://github.com/cookiecutter-openedx/openedx-plugin-example/blob/1d343d5bc107ce3c9ff73923e046a449ee45b755/openedx_plugin_api/management/commands/openedx_plugin_api_init.py#L20C1-L25C78

Should we be adding these to the env or somewhere in the plugin?

lpm0073 commented 9 months ago

That's by design. the manage.py command is looking for the following environment variables:

                PLUGIN_API_USER_EMAIL,
                PLUGIN_API_USER_NAME,
                PLUGIN_API_USER_PASSWORD,
                OPENEDX_COMPLETE_DOMAIN_NAME

you might consider searching for these in the cookiecutter code base. i believe that some/all of these are created w terraform and added to the tutor deployment(s)

zameel7 commented 9 months ago

@lpm0073 , I don't see these anywhere in the cookiecutter code base. Could you please confirm that it is to be there in the cookiecutter itself?

lpm0073 commented 9 months ago

Confirmed. My mistake. The documentation is missing setup instructions for these. So in hindsight, to run this command you'll first need to set those four environment variables from the command line.

zameel7 commented 9 months ago

Shouldn't that be in the .env inside the container?

lpm0073 commented 9 months ago

Not by default. it depends on how you deployed the pod. i checked a couple of installations earlier today and none of the four variables were set in the lms pods.

But, if you haven't created a .env file, or if these variables aren't present in the .env then you can easily set them on the command line just before running the manage.py command.

lpm0073 commented 8 months ago

checking in on this issue. did you resolve the problems you were having?

zameel7 commented 8 months ago

Yep, I added those values and it worked!

On Mon, 1 Jan 2024 at 1:00 AM, Lawrence McDaniel @.***> wrote:

checking in on this issue. did you resolve the problems you were having?

— Reply to this email directly, view it on GitHub https://github.com/cookiecutter-openedx/openedx-plugin-example/issues/18#issuecomment-1873022475, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNZFTOXOHTKC36EM5WXP43YMG4OTAVCNFSM6AAAAABAQYOQE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGAZDENBXGU . You are receiving this because you authored the thread.Message ID: @.*** com>

lpm0073 commented 8 months ago

Excellent! closing this issue :)