#5407 Crash when config:[ENABLE_DOCS = False]
Closed: Fixed 4 months ago by wombelix. Opened a year ago by klauskoder.

Pagure crash at when ENABLE_DOCS is disabled:

pagure.cfg:

ENABLE_DOCS = False

The log

Writing objects: 100% (42/42), 2.64 KiB | 420.00 KiB/s, done.
Total 42 (delta 13), reused 0 (delta 0), pack-reused 0
remote: Traceback (most recent call last):
remote:   File "/srv/git/repositories/kode.git/hooks/pre-receive", line 48, in <module>
remote:     run_hook_file(hooktype)
remote:   File "/usr/lib/python3.11/site-packages/pagure/hooks/__init__.py", line 528, in run_hook_file
remote:     ) = pagure.lib.git.get_repo_info_from_path(gitdir)
remote:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
remote:   File "/usr/lib/python3.11/site-packages/pagure/lib/git.py", line 1502, in get_repo_info_from_path
remote:     "docs": pagure_config["DOCS_FOLDER"],
remote:             ~~~~~~~~~~~~~^^^^^^^^^^^^^^^
remote: KeyError: 'DOCS_FOLDER'
To ssh://beat.local/kode.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://beat.local/kode.git'

The reason seem pretty obvious. If ENABLE_DOCS==False, then config["DOCS_FOLDER"]
is not defined.

pagure/config.py:34

    if config["ENABLE_DOCS"]:
        config["DOCS_FOLDER"] = os.path.join(config["GIT_FOLDER"], "docs")

Metadata Update from @wombelix:
- Issue set to the milestone: 5.14

4 months ago

Metadata Update from @wombelix:
- Issue assigned to wombelix

4 months ago

Log in to comment on this ticket.

Metadata
Related Pull Requests
  • #5478 Merged 4 months ago
  • #5475 Merged 4 months ago