cookiecutter / cookiecutter-django

Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
https://cookiecutter-django.readthedocs.io
BSD 3-Clause "New" or "Revised" License
11.98k stars 2.88k forks source link

ERROR: Stopping generation because pre_gen_project hook script didn't exit successfully #4243

Closed an-dev closed 1 year ago

an-dev commented 1 year ago

What happened?

debug [n]: y
  File "/tmp/tmp8xbl07nw.py", line 87
        sys.exit(1)
                   ^
SyntaxError: EOF while scanning triple-quoted string literal
ERROR: Stopping generation because pre_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

What should've happened instead?

Successfully create django project. I think. Also, had a look at https://github.com/cookiecutter/cookiecutter-django/issues/3681 but the error there is more verbose

Additional details

Host system configuration:

{
  "cookiecutter": {
    "project_name": "App",
    "project_slug": "app",
    "description": "\"\"",
    "author_name": "\"\"",
    "domain_name": "example.com",
    "email": "\"\"@example.com",
    "version": "0.1.0",
    "open_source_license": "Not open source",
    "timezone": "UTC",
    "windows": "n",
    "use_pycharm": "n",
    "use_docker": "n",
    "postgresql_version": "14",
    "cloud_provider": "None",
    "mail_service": "SendinBlue",
    "use_async": "n",
    "use_drf": "n",
    "frontend_pipeline": "None",
    "use_celery": "y",
    "use_mailhog": "y",
    "use_sentry": "n",
    "use_whitenoise": "y",
    "use_heroku": "n",
    "ci_tool": "None",
    "keep_local_envs_in_vcs": "y",
    "debug": "y",
    "_template": "https://github.com/cookiecutter/cookiecutter-django",
    "_output_dir": "<a dir>"
  }
}
Logs:
$ cookiecutter https://github.com/cookiecutter/cookiecutter-django
project_name [My Awesome Project]: App
project_slug [app]: app
description [Behold My Awesome Project!]: ""
author_name [Daniel Roy Greenfeld]: ""
domain_name [example.com]: 
email [""@example.com]: 
version [0.1.0]: 
Select open_source_license:
1 - MIT
2 - BSD
3 - GPLv3
4 - Apache Software License 2.0
5 - Not open source
Choose from 1, 2, 3, 4, 5 [1]: 5
timezone [UTC]: 
windows [n]: 
use_pycharm [n]: 
use_docker [n]: 
Select postgresql_version:
1 - 14
2 - 13
3 - 12
4 - 11
5 - 10
Choose from 1, 2, 3, 4, 5 [1]:  
Select cloud_provider:
1 - AWS
2 - GCP
3 - Azure
4 - None
Choose from 1, 2, 3, 4 [1]: 4
Select mail_service:
1 - Mailgun
2 - Amazon SES
3 - Mailjet
4 - Mandrill
5 - Postmark
6 - Sendgrid
7 - SendinBlue
8 - SparkPost
9 - Other SMTP
Choose from 1, 2, 3, 4, 5, 6, 7, 8, 9 [1]: 7
use_async [n]: 
use_drf [n]: 
Select frontend_pipeline:
1 - None
2 - Django Compressor
3 - Gulp
4 - Webpack
Choose from 1, 2, 3, 4 [1]: 1
use_celery [n]: y
use_mailhog [n]: y
use_sentry [n]: n
use_whitenoise [n]: y
use_heroku [n]: n
Select ci_tool:
1 - None
2 - Travis
3 - Gitlab
4 - Github
Choose from 1, 2, 3, 4 [1]: 1
keep_local_envs_in_vcs [y]: 
debug [n]: y
  File "/tmp/tmpg6mubots.py", line 92
        sys.exit(1)
                   ^
SyntaxError: EOF while scanning triple-quoted string literal
ERROR: Stopping generation because pre_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

browniebroke commented 1 year ago

Some of your inputs look odd, do they contain some bad characters?

{
  "cookiecutter": {
...
    "description": "\"\"",
    "author_name": "\"\"",
...
    "email": "\"\"@example.com",
...
  }
}
an-dev commented 1 year ago

@browniebroke for description and author_name I added an empty string, so that's probably why the dump looks like that? For email I presume it was just @example.com

browniebroke commented 1 year ago

Did you find out what was the problem in the end? I cannot reproduce on my side, so I'm having little luck here.

One thing that might help is to open the Python file where the error happens ("/tmp/tmpg6mubots.py", line 92 in your original logs) and see what it looks like. I assume the file no longer exists on your system, but if you can reproduce it would give you a new path...

github-actions[bot] commented 1 year ago

Automatically closing after waiting for additional info. To re-open, please provide the additional information requested.