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

post_gen_project hook script fails upon attempting to create new extension #190

Open
felixk4 opened this issue Nov 19, 2024 · 0 comments
Open
Assignees

Comments

@felixk4
Copy link

felixk4 commented Nov 19, 2024

Even though I use the docker install, I get the exact same error as described in this issue from someone who installed ckan from source:

Traceback (most recent call last):
  File "/tmp/tmpqq3axb1k.py", line 88, in <module>
    "_checkout": null,
NameError: name 'null' is not defined
Stopping generation because post_gen_project hook script didn't exit successfully
Traceback (most recent call last):
  File "/usr/local/bin/ckan", line 8, in <module>
    sys.exit(ckan())
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/srv/app/src/ckan/ckan/cli/generate.py", line 114, in extension
    cookiecutter(template_loc, no_input=True, extra_context=context,
  File "/usr/local/lib/python3.10/site-packages/cookiecutter/main.py", line 182, in cookiecutter
    result = generate_files(
  File "/usr/local/lib/python3.10/site-packages/cookiecutter/generate.py", line 419, in generate_files
    run_hook_from_repo_dir(
  File "/usr/local/lib/python3.10/site-packages/cookiecutter/hooks.py", line 157, in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
  File "/usr/local/lib/python3.10/site-packages/cookiecutter/hooks.py", line 140, in run_hook
    run_script_with_context(script, project_dir, context)
  File "/usr/local/lib/python3.10/site-packages/cookiecutter/hooks.py", line 123, in run_script_with_context
    run_script(temp.name, cwd)
  File "/usr/local/lib/python3.10/site-packages/cookiecutter/hooks.py", line 94, in run_script
    raise FailedHookException(
cookiecutter.exceptions.FailedHookException: Hook script failed (exit status: 1)

According to this commit, the Cookicutter 2.6 update caused a problem and it seems like that was fixed by making some changes to post_gen_project.py, but when I build the containers and take a look inside, I get the pre-fix post_gen_project.py file with the whole 'context = {{ cookiecutter | jsonify }}' thing and if I manually alter that file according to the fix I can create a new extension without any problems. Is there something wrong on my end or was the fix just not adopted by ckan-docker?

@kowh-ai kowh-ai self-assigned this Nov 19, 2024
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