From 4fa4bcc6ad8a785c9216dd795ddb9d0490c2e40f Mon Sep 17 00:00:00 2001 From: Michal Konecny Date: Jan 29 2024 13:24:12 +0000 Subject: [PATCH 1/2] Add troubleshooting guide for pagure Add guide to Pagure SOP for troubleshooting when pull request throws 500 when opened. Signed-off-by: Michal Konecny --- diff --git a/modules/sysadmin_guide/pages/pagure.adoc b/modules/sysadmin_guide/pages/pagure.adoc index c9585f8..39953c6 100644 --- a/modules/sysadmin_guide/pages/pagure.adoc +++ b/modules/sysadmin_guide/pages/pagure.adoc @@ -107,3 +107,57 @@ If the project remains un-accessible, check the apache logs, it could be that the git repositories have not been created. In that case, the simplest course of action is to delete all the duplicates and let the users re-create the projects as they wish. + +== Troubleshooting + +=== Pull request throws 500 when opened + +. Check the permissions on `pagure02` ++ +The repositories could be found on `/srv/git/repositories/` and inside each +you can check `refs/pull/` directory. + +. Close the PR using `requests` repository ++ +If there isn't anything wrong with permissions or the directory is empty, +try to close the PR using `requests` repository. +You need to have commit/admin permissions on the repository. ++ +.. Clone the `requests` repository ++ +You can find the clone link in `Other Git URLs` in `Clone` button ++ +.. Find the correct pull requests by hash ++ +Use `git log` for that ++ +.. Update the status of the pull request to `Closed` +.. Push the change + +. Removing the PR from project ++ +This should be last resort when everything others fails. ++ +.. Log in to PostgreSQL db on `pagure02` ++ +.... +`sudo -u postgres psql` +.... ++ +.. Connect to pagure database ++ +.... +`\connect pagure` +.... ++ +.. Find the project_id by name ++ +.... +select id from projects where name='' and is_fork=false; +.... ++ +.. Delete the desired pull request ++ +.... +delete from pull_requests where id= and project_id=536 +.... From f2153739f0b2f53ba30ad5181da9f6195465d6ea Mon Sep 17 00:00:00 2001 From: Michal Konecny Date: Jan 29 2024 15:24:07 +0000 Subject: [PATCH 2/2] Add required permissions Add required permissions to steps in troubleshooting guide. Signed-off-by: Michal Konecny --- diff --git a/modules/sysadmin_guide/pages/pagure.adoc b/modules/sysadmin_guide/pages/pagure.adoc index 39953c6..241c163 100644 --- a/modules/sysadmin_guide/pages/pagure.adoc +++ b/modules/sysadmin_guide/pages/pagure.adoc @@ -116,6 +116,8 @@ users re-create the projects as they wish. + The repositories could be found on `/srv/git/repositories/` and inside each you can check `refs/pull/` directory. +For checking the permissions you don't need any special permissions, but +if you need to adjust anything you need to root permissions. . Close the PR using `requests` repository + @@ -137,6 +139,7 @@ Use `git log` for that . Removing the PR from project + This should be last resort when everything others fails. +You need to have root access to `pagure02`. + .. Log in to PostgreSQL db on `pagure02` +