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

backend setup failed #32

Closed
MrTango opened this issue Aug 4, 2024 · 2 comments
Closed

backend setup failed #32

MrTango opened this issue Aug 4, 2024 · 2 comments

Comments

@MrTango
Copy link

MrTango commented Aug 4, 2024

when i try to generate a full project with backend and frontend, the backend generation is failing.

  [1/17] Project Title (Project Title): mcfm
  [2/17] Project Description (A new project using Plone 6.): 
  [3/17] Project Slug (Used for repository id) (mcfm): 
  [4/17] Project URL (without protocol) (mcfm.example.com): 
  [5/17] Author (Plone Foundation): 
  [6/17] Author E-mail ([email protected]): 
  [7/17] Should we use prerelease versions? (No): 
  [8/17] Plone Version (6.0.12): 
  [9/17] Volto Version (18.0.0-alpha.42): 
  [10/17] Python Package Name (mcfm): 
  [11/17] Volto Addon Name (volto-mcfm): 
  [12/17] Language
    1 - English
    2 - Deutsch
    3 - Español
    4 - Português (Brasil)
    5 - Nederlands
    6 - Suomi
    Choose from [1/2/3/4/5/6] (1): 
  [13/17] GitHub or GitLab Username or Organization (collective): 
  [14/17] Container Registry
    1 - GitHub Container Registry
    2 - Docker Hub
    3 - GitLab
    Choose from [1/2/3] (1): 
  [15/17] Should we setup a caching server?
    1 - Yes
    2 - No
    Choose from [1/2] (1): 
  [16/17] Add Ansible playbooks?
    1 - Yes
    2 - No
    Choose from [1/2] (1): 
  [17/17] Add GitHub Action to Deploy this project?
    1 - Yes
    2 - No
    Choose from [1/2] (1): 
╭──────────────────────────────────────────────────────────────────────────── mcfm generation ─────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                          │
│ Summary:                                                                                                                                                                 │
│                                                                                                                                                                          │
│   - Plone version: 6.0.12                                                                                                                                                │
│   - Volto version: 18.0.0-alpha.42                                                                                                                                       │
│   - Output folder: /home/maik/develop/jlu/mcfm/tmp/mcfm                                                                                                                  │
│                                                                                                                                                                          │
│                                                                                                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
 -> Initialize Git repository
 -> Setup Backend
Traceback (most recent call last):
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/cookieplone/generator.py", line 56, in generate
    result = cookiecutter(
             ^^^^^^^^^^^^^
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/cookiecutter/main.py", line 161, in cookiecutter
    prompt_for_config(context_for_prompting, no_input)
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/cookiecutter/prompt.py", line 283, in prompt_for_config
    cookiecutter_dict[key] = render_variable(env, raw, cookiecutter_dict)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/cookiecutter/prompt.py", line 224, in render_variable
    return template.render(cookiecutter=cookiecutter_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/cookieplone/filters/__init__.py", line 14, in package_name
    return v.split(".")[1]
           ~~~~~~~~~~~~^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/tmp6i693i9f.py", line 175, in <module>
    main()
  File "/tmp/tmp6i693i9f.py", line 146, in main
    func(new_context, output_dir)
  File "/tmp/tmp6i693i9f.py", line 63, in generate_backend_addon
    generator.generate_subtemplate(
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/cookieplone/generator.py", line 133, in generate_subtemplate
    raise exc
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/cookieplone/generator.py", line 116, in generate_subtemplate
    result = generate(
             ^^^^^^^^^
  File "/home/maik/.local/pipx/.cache/874b532047f20f9/lib/python3.11/site-packages/cookieplone/generator.py", line 91, in generate
    raise GeneratorException(message=str(e), original=e)  # noQA:B904
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cookieplone.exceptions.GeneratorException
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
@stevepiercy
Copy link
Contributor

@MrTango can you try specifying Plone 6.0.11, same Volto? This is an issue with generating the backend. Maybe a package was renamed? I'd also check the Plone 6.0.12 release notes for any package shenanigans.

@davisagli
Copy link
Member

@MrTango The cookieplone templates don't currently support Python package names without a namespace. As a workaround you can generate collective.mcfm and then manually remove the namespace folder.

I'll close the issue because it's a duplicate of #34

@davisagli davisagli closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 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

3 participants