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

Docs (sphinx-autobuild) fails with Docker #5346

Open
ljfp opened this issue Sep 5, 2024 · 1 comment · May be fixed by #5347
Open

Docs (sphinx-autobuild) fails with Docker #5346

ljfp opened this issue Sep 5, 2024 · 1 comment · May be fixed by #5347
Labels

Comments

@ljfp
Copy link

ljfp commented Sep 5, 2024

What happened?

The container executes the following command at startup:
sphinx-autobuild -b html --host 0.0.0.0 --port 9000 --watch /app -c . . ./_build/html
It fails with "Errno 2" because the directory '_build' doesn't exist.
The container stops, docs are not generated.

What should've happened instead?

Container should run and docs should be accessible at http://localhost:9000/

Additional details

Logs from the container:
2024-09-05 08:13:45 sphinx-autobuild -b html --host 0.0.0.0 --port 9000 --watch /app -c . . ./_build/html
2024-09-05 08:13:46 Traceback (most recent call last):
2024-09-05 08:13:46 File "/usr/local/bin/sphinx-autobuild", line 8, in
2024-09-05 08:13:46 sys.exit(main())
2024-09-05 08:13:46 ^^^^^^
2024-09-05 08:13:46 File "/usr/local/lib/python3.12/site-packages/sphinx_autobuild/main.py", line 34, in main
2024-09-05 08:13:46 args, build_args = _parse_args(list(argv))
2024-09-05 08:13:46 ^^^^^^^^^^^^^^^^^^^^^^^
2024-09-05 08:13:46 File "/usr/local/lib/python3.12/site-packages/sphinx_autobuild/main.py", line 101, in _parse_args
2024-09-05 08:13:46 args.outdir = Path(sphinx_args.outputdir).resolve(strict=True)
2024-09-05 08:13:46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-09-05 08:13:46 File "/usr/local/lib/python3.12/pathlib.py", line 1240, in resolve
2024-09-05 08:13:46 s = self._flavour.realpath(self, strict=strict)
2024-09-05 08:13:46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-09-05 08:13:46 File "", line 427, in realpath
2024-09-05 08:13:46 File "", line 462, in _joinrealpath
2024-09-05 08:13:46 FileNotFoundError: [Errno 2] No such file or directory: '_build'
2024-09-05 08:13:46 make: *** [Makefile:20: livehtml] Error 1

  • Host system configuration:

    • Version of cookiecutter CLI: Cookiecutter 2.6.0

    • OS name and version:

      
      # OS Name:                   Microsoft Windows 11 Pro
      # OS Version:                10.0.22631 N/A Build 22631
      
      
    • Python version: Python 3.12.5

    • Docker version: Docker version 27.1.1, build 6312585

    • docker compose version: Docker Compose version v2.29.1-desktop.1

  • Options selected:

{
  "cookiecutter": {
    "project_name": "REDACTED",
    "project_slug": "REDACTED",
    "description": "REDACTED",
    "author_name": "REDACTED",
    "domain_name": "REDACTED",
    "email": "REDACTED",
    "version": "0.1.0",
    "open_source_license": "GPLv3",
    "username_type": "username",
    "timezone": "Europe/London",
    "windows": "y",
    "editor": "PyCharm",
    "use_docker": "y",
    "postgresql_version": "16",
    "cloud_provider": "AWS",
    "mail_service": "Amazon SES",
    "use_async": "y",
    "use_drf": "y",
    "frontend_pipeline": "Django Compressor",
    "use_celery": "y",
    "use_mailpit": "y",
    "use_sentry": "y",
    "use_whitenoise": "y",
    "use_heroku": "n",
    "ci_tool": "Github",
    "keep_local_envs_in_vcs": "n",
    "debug": "n",
    "_template": "gh:cookiecutter/cookiecutter-django",
    "_output_dir": "C:\\source",
    "_repo_dir": "C:\\Users\\REDACTED\\.cookiecutters\\cookiecutter-django",
    "_checkout": null
  },
  "_cookiecutter": {
    "project_name": "My Awesome Project",
    "project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}",
    "description": "Behold My Awesome Project!",
    "author_name": "Daniel Roy Greenfeld",
    "domain_name": "example.com",
    "email": "{{ cookiecutter.author_name.lower() | trim() |replace(' ', '-') }}@{{ cookiecutter.domain_name.lower() | trim() }}",
    "version": "0.1.0",
    "open_source_license": [
      "MIT",
      "BSD",
      "GPLv3",
      "Apache Software License 2.0",
      "Not open source"
    ],
    "username_type": [
      "username",
      "email"
    ],
    "timezone": "UTC",
    "windows": "n",
    "editor": [
      "None",
      "PyCharm",
      "VS Code"
    ],
    "use_docker": "n",
    "postgresql_version": [
      "16",
      "15",
      "14",
      "13",
      "12"
    ],
    "cloud_provider": [
      "AWS",
      "GCP",
      "Azure",
      "None"
    ],
    "mail_service": [
      "Mailgun",
      "Amazon SES",
      "Mailjet",
      "Mandrill",
      "Postmark",
      "Sendgrid",
      "Brevo",
      "SparkPost",
      "Other SMTP"
    ],
    "use_async": "n",
    "use_drf": "n",
    "frontend_pipeline": [
      "None",
      "Django Compressor",
      "Gulp",
      "Webpack"
    ],
    "use_celery": "n",
    "use_mailpit": "n",
    "use_sentry": "n",
    "use_whitenoise": "n",
    "use_heroku": "n",
    "ci_tool": [
      "None",
      "Travis",
      "Gitlab",
      "Github",
      "Drone"
    ],
    "keep_local_envs_in_vcs": "y",
    "debug": "n"
  }
}
$ cookiecutter https://github.com/cookiecutter/cookiecutter-django
project_name [Project Name]: ...
@ljfp
Copy link
Author

ljfp commented Sep 5, 2024

I've found the root cause of the issue and created a PR to fix it: #5347

The problem was in this and this lines.

According to the Sphinx documentation, "help" is NOT a valid builder. My guess is that the author's intention was to use "html" and a script or autocorrect program modified that part of the Makefile/make.bat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant