collective / cookiecutter-plone-starter

Cookiecutter Plone Starter is a framework for jumpstarting Plone 6 projects quickly.
MIT License
20 stars 11 forks source link

ERROR: Stopping generation because post_gen_project hook script didn't exit successfully #34

Closed adam139 closed 1 year ago

adam139 commented 1 year ago

https://6.dev-docs.plone.org/install/install-from-packages.html

run : cookiecutter https://github.com/collective/cookiecutter-plone-starter raise error: Running sanity checks

Summary:

Frontend codebase:

adam139 commented 1 year ago

I have re-installed nvm,nodejs,yo,yarn and rebuild python3108 virtual env and re-installed cookiecutter in env. Run the script: cookiecutter https://github.com/collective/cookiecutter-plone-starter raise new error: ` project_title [Project Title]: Emc Plone6 project_slug [emc-plone6]: description [A new project using Plone 6.]: emc project using Plone 6. author [Plone Foundation]: adam email [collective@plone.org]: 568066794@qq.com python_package_name [emc_plone6]: plone_version [6.0.0b3]: volto_version [16.0.0-alpha.49]: Select language_code: 1 - en 2 - de 3 - es 4 - pt-br Choose from 1, 2, 3, 4 [1]: github_organization [collective]: Select container_registry: 1 - Docker Hub 2 - GitHub Choose from 1, 2 [1]:

Emc Plone6 generation

Running sanity checks

Summary:

Frontend codebase:

undefined `

ashishsah1000 commented 1 year ago

I am also facing the same issue

stevepiercy commented 1 year ago

Make sure you use a-z0-9 or _ only in project slug and name, no -.

Also make sure that the active node version is 16 with node -v.

ashishsah1000 commented 1 year ago

System that I am using is MacOs with M1 chip inside.

Versions of software

nvm: 0.39.3 node: 16.17.0 docker: 20.10.21 yarn: 1.22.19

The first command that I ran was

cookiecutter gh:collective/cookiecutter-plone-starter

It asked me certain questions which I simply pressed enter

and then while installing frontend it showed me error #57

Frontend codebase:
 - Installing @plone/generator-volto@6.2.3
There was an error, see /Users/flekenstine/Desktop/work/opensource/plone/plone_starter_error.log for details
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

Anyone who has faced the same issue ?

stevepiercy commented 1 year ago

Please include the contents of the error log from:

/Users/flekenstine/Desktop/work/opensource/plone/plone_starter_error.log

What are your versions of cookiecutter, Python, and make?

Meanwhile DuckDuckGo for other people who have experienced this issue.

ashishsah1000 commented 1 year ago

This is my error log file: plone_starter_error.log

Using chosen Volto version: 16.8.1
Retrieving Volto's yarn.lock
   create package.json
node:internal/fs/utils:347
    throw err;
    ^

Error: EACCES: permission denied, open '/Users/flekenstine/Desktop/work/opensource/project-title/frontend/package.json'
    at Object.openSync (node:fs:594:3)
    at Object.writeFileSync (node:fs:2207:35)
    at write (/usr/local/lib/node_modules/@plone/generator-volto/node_modules/mem-fs-editor/lib/actions/commit.js:15:6)
    at DestroyableTransform._transform (/usr/local/lib/node_modules/@plone/generator-volto/node_modules/mem-fs-editor/lib/actions/commit.js:49:7)
    at DestroyableTransform.Transform._read (/usr/local/lib/node_modules/@plone/generator-volto/node_modules/readable-stream/lib/_stream_transform.js:177:10)
    at DestroyableTransform.Transform._write (/usr/local/lib/node_modules/@plone/generator-volto/node_modules/readable-stream/lib/_stream_transform.js:164:83)
    at doWrite (/usr/local/lib/node_modules/@plone/generator-volto/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (/usr/local/lib/node_modules/@plone/generator-volto/node_modules/readable-stream/lib/_stream_writable.js:398:5)
    at DestroyableTransform.Writable.write (/usr/local/lib/node_modules/@plone/generator-volto/node_modules/readable-stream/lib/_stream_writable.js:307:11)
    at DestroyableTransform.ondata (/usr/local/lib/node_modules/@plone/generator-volto/node_modules/readable-stream/lib/_stream_readable.js:681:20) {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: '/Users/flekenstine/Desktop/work/opensource/project-title/frontend/package.json'
}
ashishsah1000 commented 1 year ago

if i install without sudo I get this error


Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/shutil.py", line 680, in _rmtree_safe_fd
    os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'groups.yml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/cookiecutter", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cookiecutter/cli.py", line 194, in main
    cookiecutter(
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cookiecutter/main.py", line 69, in cookiecutter
    repo_dir, cleanup = determine_repo_dir(
                        ^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cookiecutter/repository.py", line 106, in determine_repo_dir
    cloned_repo = clone(
                  ^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cookiecutter/vcs.py", line 89, in clone
    clone = prompt_and_delete(repo_dir, no_input=no_input)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cookiecutter/utils.py", line 96, in prompt_and_delete
    rmtree(path)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cookiecutter/utils.py", line 31, in rmtree
    shutil.rmtree(path, onerror=force_delete)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/shutil.py", line 731, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/shutil.py", line 659, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/shutil.py", line 659, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/shutil.py", line 659, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  [Previous line repeated 1 more time]
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/shutil.py", line 682, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cookiecutter/utils.py", line 22, in force_delete
    os.chmod(path, stat.S_IWRITE)
PermissionError: [Errno 1] Operation not permitted: '/Users/flekenstine/.cookiecutters/cookiecutter-plone-starter/{{ cookiecutter.project_slug }}/devops/group_vars/all/groups.yml'
stevepiercy commented 1 year ago

Never use sudo to install Python packages. That leads to pain and suffering. Instead always use a virtual environment or your user Python space.

Also please answer the questions.

ashishsah1000 commented 1 year ago

I am using:

cookiecutter  2.1.1.
Python 3.9.6
GNU Make 3.81
ashishsah1000 commented 1 year ago

tried the following things:

Nothing works.

While I can run volto with yeoman and docker as mentioned in Volto Installation

But installation via the package method does not work out.

stevepiercy commented 1 year ago

At this point, I would suggest that you post to the Community Forum. I've exhausted my knowledge. Thanks for your persistence.

ashishsah1000 commented 1 year ago

I signed up for the community forum yesterday but I guess someone has to approve my id before I can log in and ask any questions. Waiting for approval. Thanks @stevepiercy for your time and help.

ashishsah1000 commented 1 year ago

This is weird 😕

if I use sudo cookiecutter https://github.com/collective/cookiecutter-plone-starter then it shows the same error.

So just downloaded the repo and used the command cookiecutter .

and it created the project.

stevepiercy commented 1 year ago

That is very weird. Were you in two different working directories? I noticed that you started at Desktop for one attempt, and I wonder if macOS has some kind of security for Desktop, as it is one of the "special" directories? I typically put all my work in /Users/stevepiercy/projects.

ashishsah1000 commented 1 year ago

Basically, I have my work folder in /Users/flekenstine/Desktop/work/plone For any other project till now I have not faced any issues. Like cloning a repo or installing any package via npm. It can be how cookiecutter is working. Because when code is present locally it allows and successfully creates the project. I guess a debug is required at which point the things are breaking. It is breaking at the point of generating frontend.

RafaelMarquesFull commented 1 year ago

Getting this error when trying to install plone with cookiecutter https://github.com/collective/cookiecutter-plone-starter can anyone help me?

Running formatter: black ======================== Traceback (most recent call last): File "/docker-entrypoint.py", line 70, in status = ACTIONS[action](settings, tool, paths) File "/usr/local/lib/python3.10/site-packages/plone_code_analysis/format.py", line 58, in run_formatters status = run_formatter(formatter, paths) or status File "/usr/local/lib/python3.10/site-packages/plone_code_analysis/format.py", line 43, in run_formatter return func(*args, paths=paths) File "/usr/local/lib/python3.10/site-packages/plone_code_analysis/cmd.py", line 25, in run_command all_args = cmd + args + paths TypeError: can only concatenate list (not "str") to list make: *** [Makefile:118: format] Erro 1

stevepiercy commented 1 year ago

@RafaelMarquesFull this appears to be a bug in https://github.com/plone/code-quality/blob/main/src/plone_code_analysis/cmd.py#L25. Please file a bug report in the proper repository.

Also your issue appears to be unrelated to this issue, as the error message is completely different. Please do not hijack issues in the future. Thank you!

RafaelMarquesFull commented 1 year ago

@stevepiercy Could you help me to resolve this? I can't find anything relevant on the internet.

stevepiercy commented 1 year ago

@RafaelMarquesFull please file a bug report in the proper repository. For support see https://plone.org/support

davisagli commented 1 year ago

There are several different issues discussed here, and some of them are with old versions of the software, so it is difficult to unravel whether there is a remaining issue. If someone is still having similar problems, please open a new issue.