Tasks stuck with "waiting for Pulp to start the task" - foreman-2.4 / Katello 4.0.0 / Pulp3

Hello @iballou

Looks like pulp endpoint status still show all workers history even after the restart, so my guess is that here we have all worker (dead + running workers)

[root@foremanserver ~]# curl https://`hostname`/pulp/api/v3/workers/  --cert /etc/pki/katello/certs/pulp-client.crt  --key /etc/pki/katello/private/pulp-client.key  | jq
{
  "count": 37,
  "next": null,
  "previous": null,
  "results": [
    {
      "pulp_href": "/pulp/api/v3/workers/a550b928-00dd-4120-ad13-3684fd7584ff/",
      "pulp_created": "2021-05-13T19:03:58.809276Z",
      "name": "1668@foremanserver",
      "last_heartbeat": "2021-05-13T19:25:35.835841Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/60aa23a9-fc3a-4313-b02e-5b1d3f1e98a2/",
      "pulp_created": "2021-05-13T19:03:58.743991Z",
      "name": "1654@foremanserver",
      "last_heartbeat": "2021-05-13T19:25:22.762238Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/9374fa13-9dcc-46cf-9afe-2bbff8f0c7ec/",
      "pulp_created": "2021-05-13T19:03:58.100518Z",
      "name": "1653@foremanserver",
      "last_heartbeat": "2021-05-13T19:25:22.910338Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/a82636f5-bb7b-4456-aee7-17231ca37e71/",
      "pulp_created": "2021-05-13T19:03:56.555437Z",
      "name": "1658@foremanserver",
      "last_heartbeat": "2021-05-13T19:25:22.846506Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/9102e1f4-c59a-47ea-ae84-918fc0f45304/",
      "pulp_created": "2021-05-13T18:08:14.705376Z",
      "name": "10019@foremanserver",
      "last_heartbeat": "2021-05-13T19:01:41.480059Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/0f518d29-3f8b-4f0c-a81b-28af2f6b4c62/",
      "pulp_created": "2021-05-13T18:08:14.179399Z",
      "name": "10010@foremanserver",
      "last_heartbeat": "2021-05-13T19:01:40.880128Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/d3199e5f-ab91-40d1-a0f2-5b09aecbc7d2/",
      "pulp_created": "2021-05-13T18:08:14.153266Z",
      "name": "10027@foremanserver",
      "last_heartbeat": "2021-05-13T19:01:40.779578Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/d6aad0e4-a522-4620-899f-acf297bca673/",
      "pulp_created": "2021-05-13T18:08:13.651049Z",
      "name": "10017@foremanserver",
      "last_heartbeat": "2021-05-13T19:01:40.678951Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/90cbdcdb-327a-488d-9c4b-0c808dc43065/",
      "pulp_created": "2021-05-13T17:31:42.428137Z",
      "name": "26701@foremanserver",
      "last_heartbeat": "2021-05-13T18:34:23.515731Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/91411f1a-03be-403b-b3f5-c4edb0d0cd1a/",
      "pulp_created": "2021-05-13T17:31:42.373061Z",
      "name": "26677@foremanserver",
      "last_heartbeat": "2021-05-13T18:07:17.443641Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/fc8b9d31-ba0b-4053-9a9a-116cc6c8e1ca/",
      "pulp_created": "2021-05-13T17:31:42.269198Z",
      "name": "26700@foremanserver",
      "last_heartbeat": "2021-05-13T18:07:17.439743Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/fc664998-785e-4800-ad78-423ac6ce6c85/",
      "pulp_created": "2021-05-13T17:31:40.980137Z",
      "name": "26702@foremanserver",
      "last_heartbeat": "2021-05-13T18:07:17.437649Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/9fb8274a-2c9b-4342-98c6-00e6eaa6fad3/",
      "pulp_created": "2021-05-13T17:30:40.044771Z",
      "name": "25070@foremanserver",
      "last_heartbeat": "2021-05-13T17:36:29.689844Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/e72de69d-ee72-4a71-ac9f-205a9a2995e7/",
      "pulp_created": "2021-05-13T17:30:39.539500Z",
      "name": "25063@foremanserver",
      "last_heartbeat": "2021-05-13T17:36:29.685318Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/2c052d0e-374f-4a72-a747-32cd4d2dd900/",
      "pulp_created": "2021-05-13T17:30:39.273674Z",
      "name": "25068@foremanserver",
      "last_heartbeat": "2021-05-13T17:36:29.680712Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/9cd24ff1-f9e9-4f3a-a3b8-5ceaeef5b8e1/",
      "pulp_created": "2021-05-13T17:30:38.717770Z",
      "name": "25049@foremanserver",
      "last_heartbeat": "2021-05-13T17:48:52.055121Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/d8271182-4fca-49c1-848c-de6c05784a59/",
      "pulp_created": "2021-05-13T17:09:01.266486Z",
      "name": "15526@foremanserver",
      "last_heartbeat": "2021-05-13T17:30:31.345292Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/94f68319-31c7-4e40-b888-c579e32c8e25/",
      "pulp_created": "2021-05-13T17:09:00.053095Z",
      "name": "15528@foremanserver",
      "last_heartbeat": "2021-05-13T17:30:31.346726Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/7cba785b-7531-47d1-8c9b-c50e0ff3d3c9/",
      "pulp_created": "2021-05-13T17:08:59.933685Z",
      "name": "15524@foremanserver",
      "last_heartbeat": "2021-05-13T17:30:31.339498Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/a7f79c21-c919-44df-a2ef-b4419c8928fe/",
      "pulp_created": "2021-05-13T17:08:58.865349Z",
      "name": "15529@foremanserver",
      "last_heartbeat": "2021-05-13T17:30:31.342916Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/9f17f8b0-d442-40a6-8501-060ea06368d5/",
      "pulp_created": "2021-05-12T19:08:23.327781Z",
      "name": "8635@foremanserver",
      "last_heartbeat": "2021-05-13T17:07:25.808826Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/26ac8319-e622-4e7e-83f3-680b3902eb27/",
      "pulp_created": "2021-05-12T19:08:23.289755Z",
      "name": "8632@foremanserver",
      "last_heartbeat": "2021-05-13T17:07:25.818912Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/2971eb63-fdea-4ba3-9a38-bc68deede1e0/",
      "pulp_created": "2021-05-12T19:08:22.862526Z",
      "name": "8633@foremanserver",
      "last_heartbeat": "2021-05-13T17:12:35.095642Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/341b23e0-30d3-4e34-9ab2-edae26b54982/",
      "pulp_created": "2021-05-12T19:08:22.333356Z",
      "name": "8634@foremanserver",
      "last_heartbeat": "2021-05-13T17:07:25.786884Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/8989bba9-aeab-409a-baf0-ab0ac42d0340/",
      "pulp_created": "2021-05-12T10:15:28.605294Z",
      "name": "18431@foremanserver",
      "last_heartbeat": "2021-05-12T19:13:24.527504Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/5273f427-20ce-4a89-a5ac-76cf6d0644f9/",
      "pulp_created": "2021-05-12T10:15:28.240457Z",
      "name": "18441@foremanserver",
      "last_heartbeat": "2021-05-12T19:11:59.079129Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/4899e382-d255-45ba-8ee7-c33a8f9733eb/",
      "pulp_created": "2021-05-12T10:15:27.533365Z",
      "name": "18440@foremanserver",
      "last_heartbeat": "2021-05-12T19:13:24.018947Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/1a990a41-af81-4d21-b8c6-ba163e1dff05/",
      "pulp_created": "2021-05-12T10:15:25.442660Z",
      "name": "18439@foremanserver",
      "last_heartbeat": "2021-05-12T19:13:23.501735Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/c72bc34e-f372-4376-bd65-c9066690577f/",
      "pulp_created": "2021-05-12T09:44:08.915210Z",
      "name": "1713@foremanserver",
      "last_heartbeat": "2021-05-12T10:20:17.923549Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/c5bd1542-6c93-41ee-99f5-c955ee8e563d/",
      "pulp_created": "2021-05-12T09:44:08.104734Z",
      "name": "1697@foremanserver",
      "last_heartbeat": "2021-05-12T10:20:17.910476Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/e05038dd-1e54-4cc8-8676-f7b96af455d3/",
      "pulp_created": "2021-05-12T09:44:07.870187Z",
      "name": "1709@foremanserver",
      "last_heartbeat": "2021-05-12T10:20:17.919404Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/2e8a38b0-f879-4e15-9bd0-d640c14e9fd2/",
      "pulp_created": "2021-05-12T09:44:07.422913Z",
      "name": "1715@foremanserver",
      "last_heartbeat": "2021-05-12T10:20:17.915188Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/32cbe404-fd67-4e7d-a248-0382bac60c0c/",
      "pulp_created": "2021-05-10T19:48:14.375531Z",
      "name": "resource-manager",
      "last_heartbeat": "2021-05-13T19:25:22.775829Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/9672bf48-032d-4625-a377-1cd0c7fe36f8/",
      "pulp_created": "2021-05-10T19:48:09.909268Z",
      "name": "6347@foremanserver",
      "last_heartbeat": "2021-05-12T18:56:45.955889Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "pulp_created": "2021-05-10T19:48:09.629296Z",
      "name": "6214@foremanserver",
      "last_heartbeat": "2021-05-12T18:56:45.960076Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/45a584ae-3e51-45ab-8e33-aa003f84a91e/",
      "pulp_created": "2021-05-10T19:48:08.906922Z",
      "name": "6086@foremanserver",
      "last_heartbeat": "2021-05-12T18:56:45.964094Z"
    },
    {
      "pulp_href": "/pulp/api/v3/workers/ccfbef95-5387-467d-99e5-420ced8dedbf/",
      "pulp_created": "2021-05-10T19:48:08.191210Z",
      "name": "5955@foremanserver",
      "last_heartbeat": "2021-05-12T18:49:12.252583Z"
    }
  ]
}

Hello @iballou ,

So the 10000$ question is how can we delete/cleanup these zombi pulp tasks:

[root@formanserver~]# curl https://`hostname`/pulp/api/v3/tasks/?state=waiting --cert /etc/pki/katello/certs/pulp-client.crt  --key /etc/pki/katello/private/pulp-client.key | jq
{
  "count": 25,
  "next": null,
  "previous": null,
  "results": [
    {
      "pulp_href": "/pulp/api/v3/tasks/aedc074b-154b-4ade-870b-16fd20798b77/",
      "pulp_created": "2021-05-13T18:10:04.406312Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_create",
      "logging_cid": "c764efa507e6437cbaaa63af0e97b0c4",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/90cbdcdb-327a-488d-9c4b-0c808dc43065/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/75c597d0-a855-462c-921e-130296e3e723/",
      "pulp_created": "2021-05-13T17:42:12.810332Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_create",
      "logging_cid": "e363212c9e624c998a1d53e561c73e19",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9cd24ff1-f9e9-4f3a-a3b8-5ceaeef5b8e1/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/81ba10d3-ab4b-4555-8155-bd7f306d62e2/",
      "pulp_created": "2021-05-13T17:42:12.686424Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_create",
      "logging_cid": "f880b8010da94742a019ca0730ff5eff",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9cd24ff1-f9e9-4f3a-a3b8-5ceaeef5b8e1/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/eb568fdf-725b-4ba3-b1a7-5c67746adcc3/",
      "pulp_created": "2021-05-13T17:42:12.640478Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_create",
      "logging_cid": "ffce54a8b4374ca081d3e6f0b11adc70",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9cd24ff1-f9e9-4f3a-a3b8-5ceaeef5b8e1/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/303e258e-537b-4f81-8d17-574461c2c03b/",
      "pulp_created": "2021-05-13T17:38:36.842542Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "d6177b7999234a4a9ea8f7e1fe17ccbd",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9cd24ff1-f9e9-4f3a-a3b8-5ceaeef5b8e1/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/f3f01f33-aa4a-4d9e-9791-715113c8a79a/",
      "pulp_created": "2021-05-13T17:38:36.806879Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "2a1126604ca140469e8c82c25018844f",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9cd24ff1-f9e9-4f3a-a3b8-5ceaeef5b8e1/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/bb985d13-c1fc-4f37-ad1f-36420c46c05a/",
      "pulp_created": "2021-05-13T17:38:36.766661Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "6350213afc8a465a924725bab133e510",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9cd24ff1-f9e9-4f3a-a3b8-5ceaeef5b8e1/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/ae84cabb-1531-4192-9b48-be973bf9f3e2/",
      "pulp_created": "2021-05-12T18:53:35.937847Z",
      "state": "waiting",
      "name": "pulp_deb.app.tasks.publishing.publish",
      "logging_cid": "5a002c96598f45b7aea925a79fda9d9b",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9672bf48-032d-4625-a377-1cd0c7fe36f8/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/pulp/api/v3/repositories/deb/apt/827815db-7f88-4d77-89e1-d351a2bce120/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/042def9d-550b-4eb0-af31-ddfb7c7fa893/",
      "pulp_created": "2021-05-12T18:53:35.599286Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_update",
      "logging_cid": "72c6e943d2d4461d8d25e24449998172",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/45a584ae-3e51-45ab-8e33-aa003f84a91e/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/43e6ac99-fedb-416a-acbc-5872bf7113fb/",
      "pulp_created": "2021-05-12T18:53:34.914631Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_update",
      "logging_cid": "c28d58d04a054293a382f00880e3260b",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/pulp/api/v3/remotes/deb/apt/cbe41858-7231-4b76-b292-71b1730cbfa3/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/a8d6c790-2d18-41bd-b7d4-892266d34584/",
      "pulp_created": "2021-05-12T18:53:34.473959Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_update",
      "logging_cid": "679c6e77133c417fb9f5437447b654ee",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9672bf48-032d-4625-a377-1cd0c7fe36f8/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/pulp/api/v3/repositories/deb/apt/827815db-7f88-4d77-89e1-d351a2bce120/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/1a6fd4b9-4c8e-4f79-8957-3406da0bdbb0/",
      "pulp_created": "2021-05-12T09:49:22.053688Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "cda05c77fc4d4a4fb17a05e1be8b0435",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/9291001d-ec28-4fb6-96ad-264611c64f69/",
      "pulp_created": "2021-05-12T09:49:22.017887Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "10d768d618ea4c4a96b0eb45c2218634",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/9e520a02-6819-4b6b-a919-d0a98ae08878/",
      "pulp_created": "2021-05-12T09:49:21.978039Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "115a3110ccb54ab3a86ed222daea3915",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/b79c5fef-3333-4afb-8249-b4ea5787daac/",
      "pulp_created": "2021-05-12T09:49:21.937124Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "703886c2909943a5adfa05a82795602a",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/63fbb419-3c1e-4c8f-8d10-b604baf00d1e/",
      "pulp_created": "2021-05-12T09:49:00.128477Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "3c48339155b044618dd6bda7d825c447",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/45a584ae-3e51-45ab-8e33-aa003f84a91e/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/pulp/api/v3/repositories/deb/apt/c4e0d43b-176c-4a26-a386-75cf85cde6b6/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/926775aa-4f59-46bd-877e-5c30d580661e/",
      "pulp_created": "2021-05-12T09:49:00.047113Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "938a6f4729ab477eb1de1d172650291e",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/9672bf48-032d-4625-a377-1cd0c7fe36f8/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/pulp/api/v3/repositories/deb/apt/ea23faa4-eb56-4d1b-bdc2-d9779fb91051/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/3c71dbc0-936b-47fd-ae31-12ddcbaf9377/",
      "pulp_created": "2021-05-12T09:48:59.913419Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "d110524ce2e348cf9a878e9117bfd1a6",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/ccfbef95-5387-467d-99e5-420ced8dedbf/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/pulp/api/v3/repositories/deb/apt/3bed5208-06f1-44a2-9b98-ab449f231a41/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/4472cad9-8390-46c7-a9ba-3dbe06689049/",
      "pulp_created": "2021-05-12T09:48:42.350770Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "c9d9b62b4ff340a1b805346656573ada",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/107b4468-f579-4e2a-8939-70251f98150f/",
      "pulp_created": "2021-05-12T09:48:42.318951Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "de888e671f7444d392395acb40a3bdc3",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/c256f1a8-3be8-4fd2-a191-051c2d186b9b/",
      "pulp_created": "2021-05-12T09:48:42.285439Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "770a6a7d48e74080aebeb66ae6591783",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/f665b048-c19b-455b-a90d-06dde3c3c71c/",
      "pulp_created": "2021-05-12T09:48:15.892560Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "cd75feb1de3341e48bd429408577a0b1",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/8a756286-c136-485c-a412-df48c43d47aa/",
      "pulp_created": "2021-05-12T09:48:15.858513Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "efcc734a843e4589983299a8257bbede",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/34b6bd43-ea9d-43ef-9332-d18dae566546/",
      "pulp_created": "2021-05-12T09:48:15.826673Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "39b5eff1df4741c1abdc65418c01f1ed",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    },
    {
      "pulp_href": "/pulp/api/v3/tasks/f5505640-03aa-44d5-9c73-b40a919d5102/",
      "pulp_created": "2021-05-12T09:48:15.717927Z",
      "state": "waiting",
      "name": "pulpcore.app.tasks.base.general_delete",
      "logging_cid": "d04844a051ca49d1ac120e8d7d9f3e8e",
      "started_at": null,
      "finished_at": null,
      "error": null,
      "worker": "/pulp/api/v3/workers/7caaee7d-c496-40b7-9069-0e063c2440a5/",
      "parent_task": null,
      "child_tasks": [],
      "task_group": null,
      "progress_reports": [],
      "created_resources": [],
      "reserved_resources_record": [
        "/api/v3/distributions/"
      ]
    }
  ]
}

You pasted the /workers endpoint, does curl https://foremanserver/pulp/api/v3/status/ show the dead workers too?

Also, do you see any messages similar to the following in /var/log/messages?

May 13 19:39:10 server.example.com rq[46406]: pulp [None]: pulpcore.tasking.worker_watcher:ERROR: The worker named 46249@server.example.com is missing. Canceling the tasks in its queue.

I have another idea to try. We can manually cancel all of the stuck tasks in Pulp 3. To make this easier, I’d like to have you set up the pulp-cli:

  1. pip install pulp-cli

  2. Open up ~/.config/pulp/settings.toml and add the following:

[cli]
base_url = "https://<your FQDN>"
cert = "/etc/pki/katello/certs/pulp-client.crt"
key = "/etc/pki/katello/private/pulp-client.key"
verify_ssl = false

Then, we can cancel the tasks:

  1. Find the tasks with pulp task list --state waiting
  2. Cancel the tasks like so: pulp task cancel --href <task pulp_href>

I’m not certain if that will kill the waiting tasks, but it should in theory. Let me know if it doesn’t.

1 Like

Hello @iballou

Yes curl https://foremanserver/pulp/api/v3/status/ show the dead workers too
No, I don’t see any messages similar to the following in /var/log/messages.
May 13 19:39:10 server.example.com rq[46406]: pulp [None]: pulpcore.tasking.worker_wa

I was able to delete the zombi tasks using pulp api and curl as below :

[root@foremanserver~]# curl -X DELETE https://`hostname`/pulp/api/v3/tasks/4472cad9-8390-46c7-a9ba-3dbe06689049/ --cert /etc/pki/katello/certs/pulp-client.crt   --key /etc/pki/katello/private/pulp-client.key
[root@foremanserver~]#

[root@foremanserver~]# curl -X GET https://`hostname`/pulp/api/v3/tasks/4472cad9-8390-46c7-a9ba-3dbe06689049/ --cert /etc/pki/katello/certs/pulp-client.crt  --key /etc/pki/katello/private/pulp-client.key | jq
{
  "detail": "Not found."
}
[root@foremanserver~]#

After deleting all these zombi tasks (waiting tasks) + foreman-maintain service restart now I’m able to run new tasks successfully.

At this point we dont have the RCA of this issue and it can happen again.

Regards,

1 Like

Okay, I’m glad you can run new tasks now. The dead workers are still a concern. I think they’re not being cleaned up, especially if they’re showing up under “online_workers”. I am slightly confused that the workers from your workers = [w.name for w in Worker.objects.online_workers()] ... query were all actual workers. There’s a mismatch between that pulpcore-manager shell output and the online workers in the status api output? I would assume that they come from the same database records, but maybe not.

To move forward, I’ll first see if the Pulp team has any more suggestions. If not, perhaps you can just monitor the number of dead vs alive workers. If the dead worker number keeps rising, and they aren’t being cleaned, I think it would be good to make a bug report here that shows the dead workers and some information about your system: https://pulp.plan.io/issues/new

Hello @iballou

OK noted, I’ll continue monitoring the number of dead vs alive workers on my system
I really appreciate your help! thanks a lot :slight_smile:

Regards,

1 Like

Hello, I have the same issue. But I can’t delete waiting tasks. On my "curl -X DELETE … " I get HTTP 409 Conflict error. How can you delete this waiting tasks?
< HTTP/1.1 409 Conflict
< Date: Tue, 18 May 2021 09:13:40 GMT
< Server: gunicorn/20.0.4
< Vary: Accept,Cookie
< Allow: GET, PATCH, DELETE, HEAD, OPTIONS
< X-Frame-Options: SAMEORIGIN
< Content-Length: 0

Hello @fedextm ,

Here what I used :

[root@foremanserver~]# curl -X DELETE https://hostname/pulp/api/v3/tasks/4472cad9-8390-46c7-a9ba-3dbe06689049/ --cert /etc/pki/katello/certs/pulp-client.crt --key /etc/pki/katello/private/pulp-client.key
[root@foremanserver~]#

Regards,

I’m also having this issue on a fresh install of Foreman 2.4 and Katello 4.0. I’m running Katello on Oracle Linux 8 and I’ve added the Oracle Linux repos for OL6/7/8 as well as some other repos and I triggered them all to sync at the same time.

I tried syncing A large number of repositories and now I’ve got a task thats waiting for Pulp to start. Looking at the history of this post I can see that pulp had 4 workers + resource-manger running. But according to the API (https://hostname/pulp/api/v3/workers/) there are 25 workers, 5 are active and 20 have last_heartbeats from 4+ days ago (when things died).

The task list has 1 task the hung one, which is assigned to one of the workers that is dead. Once I cancelled that task, things started moving again.

I did see entries in the logs about missing workers that match up with the IDs in my API /workers/ list.

I’ll add in all my my outputs too incase it helps someone else:

/pulp/api/v3/stats/ output

# curl "https://`hostname`/pulp/api/v3/status/" --cert /etc/pki/katello/certs/pulp-client.crt  --key /etc/pki/katello/private/pulp-client.key | jq
{
  "versions": [
    {
      "component": "pulpcore",
      "version": "3.9.1"
    },
    {
      "component": "pulp_rpm",
      "version": "3.10.0"
    },
    {
      "component": "pulp_file",
      "version": "1.5.0"
    },
    {
      "component": "pulp_deb",
      "version": "2.9.2"
    },
    {
      "component": "pulp_container",
      "version": "2.2.2"
    },
    {
      "component": "pulp_certguard",
      "version": "1.1.0"
    }
  ],
  "online_workers": [
    {
      "pulp_created": "2021-06-17T23:25:41.745736Z",
      "pulp_href": "/pulp/api/v3/workers/f7bd8f4c-3f14-4443-9924-2b1cabe48f19/",
      "name": "1402@<servername>",
      "last_heartbeat": "2021-06-21T03:43:53.646216Z"
    },
    {
      "pulp_created": "2021-06-17T23:25:42.326468Z",
      "pulp_href": "/pulp/api/v3/workers/83f67f6d-d547-4627-836f-99e69ac7b437/",
      "name": "1408@<servername>",
      "last_heartbeat": "2021-06-21T03:44:07.504398Z"
    },
    {
      "pulp_created": "2021-06-17T23:25:42.933978Z",
      "pulp_href": "/pulp/api/v3/workers/8e881a23-cf2b-4556-909c-a75f72f34c45/",
      "name": "1401@<servername>",
      "last_heartbeat": "2021-06-21T03:42:40.659272Z"
    },
    {
      "pulp_created": "2021-06-15T10:51:04.127965Z",
      "pulp_href": "/pulp/api/v3/workers/9590f209-11ae-42b0-b9a9-67d48022596b/",
      "name": "resource-manager",
      "last_heartbeat": "2021-06-21T03:42:40.058114Z"
    },
    {
      "pulp_created": "2021-06-17T23:25:42.929995Z",
      "pulp_href": "/pulp/api/v3/workers/9b2825df-16e3-493e-a0c7-6b0e30c431fa/",
      "name": "1407@<servername>",
      "last_heartbeat": "2021-06-21T03:43:54.148199Z"
    }
  ],
  "online_content_apps": [
    {
      "name": "1955@<servername>",
      "last_heartbeat": "2021-06-21T03:44:06.263164Z"
    },
    {
      "name": "1936@<servername>",
      "last_heartbeat": "2021-06-21T03:44:08.705915Z"
    },
    {
      "name": "1952@<servername>",
      "last_heartbeat": "2021-06-21T03:44:09.400131Z"
    },
    {
      "name": "1950@<servername>",
      "last_heartbeat": "2021-06-21T03:44:09.357857Z"
    },
    {
      "name": "1943@<servername>",
      "last_heartbeat": "2021-06-21T03:44:09.414391Z"
    },
    {
      "name": "1962@<servername>",
      "last_heartbeat": "2021-06-21T03:44:04.110343Z"
    },
    {
      "name": "1956@<servername>",
      "last_heartbeat": "2021-06-21T03:44:09.356084Z"
    },
    {
      "name": "1958@<servername>",
      "last_heartbeat": "2021-06-21T03:44:04.110480Z"
    },
    {
      "name": "1959@<servername>",
      "last_heartbeat": "2021-06-21T03:44:09.411785Z"
    }
  ],
  "database_connection": {
    "connected": true
  },
  "redis_connection": {
    "connected": true
  },
  "storage": {
    "total": 321961070592,
    "used": 19971796992,
    "free": 301989273600
  }
}

pulp-core output

# sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' pulpcore-manager shell <<EOF
from pulpcore.app.models import Worker                  
workers = [w.name for w in Worker.objects.online_workers()]
for rwork in workers:
  if rwork in workers:
    print(f'Worker {rwork}')
EOF

Worker 1402@<servername>
Worker 1408@<servername>
Worker 1401@<servername>
Worker 1407@<servername>
Worker resource-manager

/pulp/api/v3/workers/ output

# curl https://`hostname`/pulp/api/v3/workers/  --cert /etc/pki/katello/certs/pulp-client.crt  --key /etc/pki/katello/private/pulp-client.key  | jq 
{
  "count": 25,
  "next": null,
  "previous": null,
  "results": [
    {
      "pulp_created": "2021-06-17T23:25:42.933978Z",
      "pulp_href": "/pulp/api/v3/workers/8e881a23-cf2b-4556-909c-a75f72f34c45/",
      "name": "1401@<servername>",
      "last_heartbeat": "2021-06-21T03:30:32.876435Z"
    },
    {
      "pulp_created": "2021-06-17T23:25:42.929995Z",
      "pulp_href": "/pulp/api/v3/workers/9b2825df-16e3-493e-a0c7-6b0e30c431fa/",
      "name": "1407@<servername>",
      "last_heartbeat": "2021-06-21T03:30:32.274900Z"
    },
    {
      "pulp_created": "2021-06-17T23:25:42.326468Z",
      "pulp_href": "/pulp/api/v3/workers/83f67f6d-d547-4627-836f-99e69ac7b437/",
      "name": "1408@<servername>",
      "last_heartbeat": "2021-06-21T03:30:45.523285Z"
    },
    {
      "pulp_created": "2021-06-17T23:25:41.745736Z",
      "pulp_href": "/pulp/api/v3/workers/f7bd8f4c-3f14-4443-9924-2b1cabe48f19/",
      "name": "1402@<servername>",
      "last_heartbeat": "2021-06-21T03:30:31.773271Z"
    },
    {
      "pulp_created": "2021-06-17T04:45:53.460706Z",
      "pulp_href": "/pulp/api/v3/workers/63bc74cc-ac55-42d8-8485-7e9312aef588/",
      "name": "87641@<servername>",
      "last_heartbeat": "2021-06-17T23:23:53.921023Z"
    },
    {
      "pulp_created": "2021-06-17T04:45:51.516344Z",
      "pulp_href": "/pulp/api/v3/workers/361e0bc2-79fd-481c-86ec-72881b090a74/",
      "name": "87558@<servername>",
      "last_heartbeat": "2021-06-17T23:29:02.317408Z"
    },
    {
      "pulp_created": "2021-06-17T04:45:51.470894Z",
      "pulp_href": "/pulp/api/v3/workers/f820d466-eeab-4bca-b424-f65eada5919b/",
      "name": "87591@<servername>",
      "last_heartbeat": "2021-06-17T23:23:53.946154Z"
    },
    {
      "pulp_created": "2021-06-17T04:45:51.385979Z",
      "pulp_href": "/pulp/api/v3/workers/6c7cb505-46f6-45cb-b364-ccdf0e8dbe9c/",
      "name": "87567@<servername>",
      "last_heartbeat": "2021-06-17T23:23:53.938188Z"
    },
    {
      "pulp_created": "2021-06-16T23:29:51.450305Z",
      "pulp_href": "/pulp/api/v3/workers/341351fe-2801-4bc3-b7fb-b805ef5fc0c1/",
      "name": "69639@<servername>",
      "last_heartbeat": "2021-06-17T04:45:50.113995Z"
    },
    {
      "pulp_created": "2021-06-16T23:28:55.317166Z",
      "pulp_href": "/pulp/api/v3/workers/46f1252d-3674-46a1-9895-cb431c28d4db/",
      "name": "69501@<servername>",
      "last_heartbeat": "2021-06-17T04:45:50.071885Z"
    },
    {
      "pulp_created": "2021-06-16T23:28:54.390401Z",
      "pulp_href": "/pulp/api/v3/workers/317098bb-a71f-4e5f-b400-6cbfb454d4d3/",
      "name": "69495@<servername>",
      "last_heartbeat": "2021-06-17T04:45:50.028776Z"
    },
    {
      "pulp_created": "2021-06-16T23:28:45.296031Z",
      "pulp_href": "/pulp/api/v3/workers/26b68f40-de97-49a8-82a5-a54d896abbe2/",
      "name": "69469@<servername>",
      "last_heartbeat": "2021-06-17T04:45:49.998275Z"
    },
    {
      "pulp_created": "2021-06-15T11:51:43.238418Z",
      "pulp_href": "/pulp/api/v3/workers/19fc28bd-fd42-479e-ac6c-9baa8fe43074/",
      "name": "1444@<servername>",
      "last_heartbeat": "2021-06-16T23:32:06.182504Z"
    },
    {
      "pulp_created": "2021-06-15T11:51:43.116338Z",
      "pulp_href": "/pulp/api/v3/workers/b1a39420-bc73-4fbb-9e3b-0d501b59748c/",
      "name": "1459@<servername>",
      "last_heartbeat": "2021-06-16T23:32:15.442657Z"
    },
    {
      "pulp_created": "2021-06-15T11:51:43.073757Z",
      "pulp_href": "/pulp/api/v3/workers/078fbcce-8bc4-4430-b679-a19d5bf0bb34/",
      "name": "1451@<servername>",
      "last_heartbeat": "2021-06-16T23:32:15.170233Z"
    },
    {
      "pulp_created": "2021-06-15T11:51:42.988822Z",
      "pulp_href": "/pulp/api/v3/workers/743bef47-7d2b-4987-af60-2e83d0807cb7/",
      "name": "1448@<servername>",
      "last_heartbeat": "2021-06-16T23:33:12.355166Z"
    },
    {
      "pulp_created": "2021-06-15T10:55:59.257146Z",
      "pulp_href": "/pulp/api/v3/workers/b21e0ec0-9f59-447f-a75f-dbba5faa1199/",
      "name": "25247@<servername>",
      "last_heartbeat": "2021-06-15T11:51:42.895031Z"
    },
    {
      "pulp_created": "2021-06-15T10:55:57.836954Z",
      "pulp_href": "/pulp/api/v3/workers/fb0965e3-f1e6-4e62-8366-d571f711c49a/",
      "name": "25240@<servername>",
      "last_heartbeat": "2021-06-15T11:22:08.912543Z"
    },
    {
      "pulp_created": "2021-06-15T10:55:56.111694Z",
      "pulp_href": "/pulp/api/v3/workers/11576ae6-8ed0-4fc7-88fa-b39dcc064694/",
      "name": "25230@<servername>",
      "last_heartbeat": "2021-06-15T11:51:42.875015Z"
    },
    {
      "pulp_created": "2021-06-15T10:55:54.378224Z",
      "pulp_href": "/pulp/api/v3/workers/bacb1c40-620e-4b17-8097-b19b1534d1ca/",
      "name": "25225@<servername>",
      "last_heartbeat": "2021-06-15T11:22:08.854539Z"
    },
    {
      "pulp_created": "2021-06-15T10:51:04.127965Z",
      "pulp_href": "/pulp/api/v3/workers/9590f209-11ae-42b0-b9a9-67d48022596b/",
      "name": "resource-manager",
      "last_heartbeat": "2021-06-21T03:30:39.100613Z"
    },
    {
      "pulp_created": "2021-06-15T10:50:51.726137Z",
      "pulp_href": "/pulp/api/v3/workers/1fe78503-8037-47c5-adfc-cf2343d129fb/",
      "name": "22859@<servername>",
      "last_heartbeat": "2021-06-15T10:59:15.207717Z"
    },
    {
      "pulp_created": "2021-06-15T10:50:50.228626Z",
      "pulp_href": "/pulp/api/v3/workers/22e44eb6-c2c5-4436-b7c0-ad155cacf37f/",
      "name": "22770@<servername>",
      "last_heartbeat": "2021-06-15T10:59:15.193882Z"
    },
    {
      "pulp_created": "2021-06-15T10:50:48.372229Z",
      "pulp_href": "/pulp/api/v3/workers/5530928d-8df7-424c-a50a-89c2c2bdd3ac/",
      "name": "22684@<servername>",
      "last_heartbeat": "2021-06-15T10:59:15.177090Z"
    },
    {
      "pulp_created": "2021-06-15T10:50:46.895867Z",
      "pulp_href": "/pulp/api/v3/workers/5d7ff8ba-1d17-49e9-9ff7-efc4653eed6e/",
      "name": "22599@<servername>",
      "last_heartbeat": "2021-06-15T10:59:15.166665Z"
    }
  ]
}

pulp task list --state waiting output

# pulp task list --state waiting
[
  {
    "pulp_href": "/pulp/api/v3/tasks/c4352eca-cf08-47ff-aa84-4c03b6c7cd48/",
    "pulp_created": "2021-06-17T23:32:31.291011Z",
    "state": "waiting",
    "name": "pulp_rpm.app.tasks.publishing.publish",
    "logging_cid": "45bdee2ce16448b394addf08d079b3d7",
    "started_at": null,
    "finished_at": null,
    "error": null,
    "worker": "/pulp/api/v3/workers/361e0bc2-79fd-481c-86ec-72881b090a74/",
    "parent_task": null,
    "child_tasks": [],
    "task_group": null,
    "progress_reports": [],
    "created_resources": [],
    "reserved_resources_record": [
      "/pulp/api/v3/repositories/rpm/rpm/2749521d-75bf-4e85-adfc-e6d1fd497606/"
    ]
  }
]

“worker named X is missing” output

# grep "is missing" messages-20210620                                                                                       2:02PM
Jun 15 20:59:15 server pulpcore-worker-1[25225]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 22599@<servername> is missing. Canceling the tasks in its queue.
Jun 15 20:59:15 server pulpcore-worker-1[25225]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 22684@<servername> is missing. Canceling the tasks in its queue.
Jun 15 20:59:15 server pulpcore-worker-1[25225]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 22770@<servername> is missing. Canceling the tasks in its queue.
Jun 15 20:59:15 server pulpcore-worker-1[25225]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 22859@<servername> is missing. Canceling the tasks in its queue.
Jun 15 21:51:42 server pulpcore-resource-manager[1447]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 25230@<servername> is missing. Canceling the tasks in its queue.
Jun 15 21:51:42 server pulpcore-resource-manager[1447]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 25247@<servername> is missing. Canceling the tasks in its queue.
Jun 17 09:32:05 server pulpcore-worker-4[69469]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 1444@<servername> is missing. Canceling the tasks in its queue.
Jun 17 09:32:14 server pulpcore-worker-2[69495]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 1451@<servername> is missing. Canceling the tasks in its queue.
Jun 17 09:32:15 server pulpcore-worker-2[69495]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 1459@<servername> is missing. Canceling the tasks in its queue.
Jun 17 09:33:11 server pulpcore-worker-1[69639]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 1448@<servername> is missing. Canceling the tasks in its queue.
Jun 18 09:29:02 server pulpcore-worker-2[1402]: pulp [None]: pulpcore.tasking.services.worker_watcher:ERROR: The worker named 87558@<servername> is missing. Canceling the tasks in its queue.

This seems similar to issues being discussed during upgrades (Missing Pulp 3 workers on upgrade to Katello 4.0 - #7 by x9c4)

@x9c4 do you have any thoughts on how this can be navigated or if need to investigate ways to prevent or handle this situation better?

The relevant info I see is:
Worker:

Task:

So ~ 3 seconds after the last Heartbeat the task was scheduled, and another ~ 10 h later the worker was considered missing. The two known issues with similar symptoms are:
https://pulp.plan.io/issues/8779
https://pulp.plan.io/issues/8708

Thanks I’ll follow those issues now.

Also a note for anyone else reading this having the same issues. Do not install pulp-cli globally. Make sure you install it into a virtualenv. pulp-cli requires a newer version of PyYAML than pulp can deal with (5.4.1) so pulp breaks if you install pulp-cli without an virtualenv.

Also I believe the Oracle Linux 8 AppStream triggers this issue pretty reliably. I upgraded to 4.0 because I was hitting this on 3.18 too (now I know it’s a pulp issue the makes sense). This is what I’m using for the Repo that breaks incase anyone wants to reproduce it:

curl -o /tmp/RPM-GPG-KEY-oracle-ol8 https://yum.oracle.com/RPM-GPG-KEY-oracle-ol8
hammer content-credentials create --content-type gpg_key --name "RPM-GPG-KEY-oracle-ol8" --organization Default --path "/tmp/RPM-GPG-KEY-oracle-ol8"
hammer product create --description "Oracle Linux" --label "Oracle_Linux" --name "Oracle_Linux" --organization Default --gpg-key-id 1
hammer repository create --name "Oracle Linux 8 - AppStream Latest" --label "oraclelinux8-x86_64-appstream" --organization-label "Default" --content-type "yum" --gpg-key "RPM-GPG-KEY-oracle-ol8" --product "Oracle_Linux"  --download-policy "on_demand" --publish-via-http "yes" --url "http://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64" --ignorable-content "distribution,srpm"

Syncing that repo ends in the task timing out.

It looks like those fixes are coming out in the new pulp core soon. Whats the normal time between a pulp core release and it making it into a Katello release?

Hi, have the same issues.
Did clean install on rhel8 + katello 4.0 and it broke during 1st day when syncing and configuring all things.
After that i did all data reset, but it stared to missing workers after next day :confused:

Is there any way to clean up these zombie processes until this issue is fixed normally? - reset all data is not an option.

I have three satellite servers (CentOS 7.9, foreman 2.4.1, katello 4.0.3) with all three having sync status stuck with note: waiting for Pulp to start the task. I can’t do a database reset since all three are serving production systems. Can’t have these running without being able to have tasks run.

For example, I have a sync task that is in a cancelled state because it could not reach the uplink URL. There was a network problem that has been resolved. However, I can’t start a new sync process because the lock is held by this one that has result: warning and Task: cancelled. Does not make sense.

@bradawk can you show us the output of the following from above?

[root@formanserver ~]# sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' pulpcore-manager shell <<EOF
> from pulpcore.app.models import ReservedResource, Worker
> worker_to_res = {}
> for rr in ReservedResource.objects.all():
>   worker_to_res[rr.worker_id] = rr.pulp_id
> workers = [w.pulp_id for w in Worker.objects.online_workers()]
> for rwork in worker_to_res:
>   if rwork not in workers:
>     print(f'Worker {rwork} owns ReservedResource {worker_to_res[rwork]} and is not in online_workers!!')
> EOF

Also, can you share any related Dynflow task outputs from your cancelled task?

I did run that and the cleanup portion also. That got rid of a lot of my stuck tasks. I think our basic problem is the uplink repository is having issues. The metadata says rpm “x” is available, but when our satellite server attempts to download, it gets 404 file not found message which then hangs our sync process. I think I need to wait on them to fix their issues before pursuing this further.

If you’re able to upgrade to Katello 4.1 that probably would be helpful for the hanging tasks at least. Katello 4.1 and later has a newer version of Pulpcore with a revamped tasking system.