Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-5643

The build log can't be checked by super user after build trigger was deleted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • quay-v3.9.0
    • quay-builder
    • False
    • None
    • False

      Description of problem:

      Normally, super user can check the build logs generated by normal user by build ID, but when the build trigger was deleted, the build logs still can be checked by normal user, but can't by super user

      Version-Release number of selected component (if applicable):

      quay-operator-bundle-container-v3.9.0-115
      Index image v4.12: registry-proxy.engineering.redhat.com/rh-osbs/iib:514828
      
      $ oc get $(oc get pod -l name=quay-operator-alm-owned -o name -n quay-enterprise) -o jsonpath='{.spec.containers[0].image}' -n quay-enterprise
      registry.redhat.io/quay/quay-operator-rhel8@sha256:87ed70306e56c29e3063b3b44b506c91f1431aaeecac9b47f5870da7512a6555
      
      ------------------------------
      $ oc get $(oc get pod -l app=quay -o NAME -n quay-enterprise|head -n 1) -o jsonpath='{.spec.containers[0].image}' -n quay-enterprise
      registry.redhat.io/quay/quay-rhel8@sha256:d805cd3c17fb673ab8ba6e34a06e36a5999fcb1d0ae75d8af21d6574f904e2f4
      

       

      How reproducible:

      always

       

      Steps to Reproduce:
      1. login with a normal user "user1" and create a build trigger

      P1

      2. trigger a build "db1b1cfd-d1a5-48e6-854c-2f8d7a4f4623" and generate  build log

      p2

      3. delete the build trigger

      p3

      4. check build "db1b1cfd-d1a5-48e6-854c-2f8d7a4f4623" logs by normal user "user1"

      p4

      $ curl -k -X GET -H "Authorization: Bearer EaBOzN2JA48LgN5HS3kzRuY3sDYBZMSMkgF9jN4r" https://quayregistry-quay-quay-enterprise.apps.whu412az30.qe.azure.devcluster.openshift.com/api/v1/repository/build_test1/gitlab1/build/db1b1cfd-d1a5-48e6-854c-2f8d7a4f4623/status|jq .
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100   822  100   822    0     0    757      0  0:00:01  0:00:01 --:--:--   757
      {
        "id": "db1b1cfd-d1a5-48e6-854c-2f8d7a4f4623",
        "phase": "complete",
        "started": "Tue, 13 Jun 2023 09:54:43 -0000",
        "display_name": "735350b",
        "status": {},
        "subdirectory": "/Dockerfile",
        "dockerfile_path": "/Dockerfile",
        "context": "/",
        "tags": [
          "main",
          "latest"
        ],
        "manual_user": "user1",
        "is_writer": true,
        "trigger": null,
        "trigger_metadata": {
          "commit": "735350bf3f3dade7ad676f8dcb7fffbc22b35dea",
          "ref": "refs/heads/main",
          "default_branch": "main",
          "git_url": "git@gitlab.com:h4051/quay_build_test.git",
          "commit_info": {
            "url": "https://gitlab.com/h4051/quay_build_test/commit/735350bf3f3dade7ad676f8dcb7fffbc22b35dea",
            "message": "Update pushbuildtrigger",
            "date": "2023-06-07T13:06:38.000+00:00"
          }
        },
        "resource_key": null,
        "pull_robot": null,
        "repository": {
          "namespace": "build_test1",
          "name": "gitlab1"
        },
        "error": null
      }
       

      5. check build "db1b1cfd-d1a5-48e6-854c-2f8d7a4f4623" logs by super user "whuquay"

      p5

      $ curl -k -X GET -H "Authorization: Bearer ePSMa4BZj1motIGdMaU7DqjX4QFrgf1iS1VymHYQ" https://quayregistry-quay-quay-enterprise.apps.whu412az30.qe.azure.devcluster.openshift.com/api/v1/superuser/db1b1cfd-d1a5-48e6-854c-2f8d7a4f4623/status
      <html>
        <head>
          <title>Internal Server Error</title>
        </head>
        <body>
          <h1><p>Internal Server Error</p></h1>
          
        </body>
      </html> 

       

      6. create build trigger again and trigger a new build "0d60de6b-2d7c-462f-94a5-27b865a3b31e"

      7. check build "0d60de6b-2d7c-462f-94a5-27b865a3b31e" logs by normal user "user1"

      p6

        $ curl -k -X GET -H "Authorization: Bearer EaBOzN2JA48LgN5HS3kzRuY3sDYBZMSMkgF9jN4r" https://quayregistry-quay-quay-enterprise.apps.whu412az30.qe.azure.devcluster.openshift.com/api/v1/repository/build_test1/gitlab1/build/0d60de6b-2d7c-462f-94a5-27b865a3b31e/status|jq .
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100  1737  100  1737    0     0   1478      0  0:00:01  0:00:01 --:--:--  1478
      {
        "id": "0d60de6b-2d7c-462f-94a5-27b865a3b31e",
        "phase": "complete",
        "started": "Tue, 13 Jun 2023 10:19:34 -0000",
        "display_name": "735350b",
        "status": {},
        "subdirectory": "/Dockerfile",
        "dockerfile_path": "/Dockerfile",
        "context": "/",
        "tags": [
          "main",
          "latest"
        ],
        "manual_user": "user1",
        "is_writer": true,
        "trigger": {
          "id": "87bcd647-d284-4392-a94a-9e567b447205",
          "service": "gitlab",
          "is_active": true,
          "build_source": "h4051/quay_build_test",
          "repository_url": "https://gitlab.com/h4051/quay_build_test",
          "config": {
            "build_source": "h4051/quay_build_test",
            "dockerfile_path": "/Dockerfile",
            "context": "/",
            "default_tag_from_ref": true,
            "latest_for_default_branch": true,
            "tag_templates": [],
            "credentials": [
              {
                "name": "SSH Public Key",
                "value": "ssh-rsa AAAAB3N....Ct7pIT"
              }
            ],
            "key_id": 11834785,
            "hook_id": 22277601
          },
          "can_invoke": true,
          "enabled": true,
          "disabled_reason": null
        },
        "trigger_metadata": {
          "commit": "735350bf3f3dade7ad676f8dcb7fffbc22b35dea",
          "ref": "refs/heads/main",
          "default_branch": "main",
          "git_url": "git@gitlab.com:h4051/quay_build_test.git",
          "commit_info": {
            "url": "https://gitlab.com/h4051/quay_build_test/commit/735350bf3f3dade7ad676f8dcb7fffbc22b35dea",
            "message": "Update pushbuildtrigger",
            "date": "2023-06-07T13:06:38.000+00:00"
          }
        },
        "resource_key": null,
        "pull_robot": null,
        "repository": {
          "namespace": "build_test1",
          "name": "gitlab1"
        },
        "error": null
      }
      

       

      8. check build "0d60de6b-2d7c-462f-94a5-27b865a3b31e" logs by super user "whuquay"

      p7

      $ curl -k -X GET -H "Authorization: Bearer ePSMa4BZj1motIGdMaU7DqjX4QFrgf1iS1VymHYQ" https://quayregistry-quay-quay-enterprise.apps.whu412az30.qe.azure.devcluster.openshift.com/api/v1/superuser/0d60de6b-2d7c-462f-94a5-27b865a3b31e/status|jq .
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100   592  100   592    0     0    546      0  0:00:01  0:00:01 --:--:--   546
      {
        "id": "0d60de6b-2d7c-462f-94a5-27b865a3b31e",
        "phase": "complete",
        "started": "Tue, 13 Jun 2023 10:19:34 -0000",
        "display_name": "735350b",
        "status": {},
        "subdirectory": "",
        "dockerfile_path": "",
        "context": "",
        "tags": [],
        "manual_user": null,
        "is_writer": false,
        "trigger": {
          "id": "87bcd647-d284-4392-a94a-9e567b447205",
          "service": "gitlab",
          "is_active": true,
          "build_source": null,
          "repository_url": null,
          "config": {},
          "can_invoke": false
        },
        "trigger_metadata": null,
        "resource_key": null,
        "pull_robot": null,
        "repository": {
          "namespace": "build_test1",
          "name": "gitlab1"
        },
        "error": null
      }
      

      Expected results:

      Super user should check all build logs successfully. 

       

        1. Screenshot from 2023-06-13 17-54-28.png
          88 kB
          Weihua Hu
        2. Screenshot from 2023-06-13 18-01-35.png
          125 kB
          Weihua Hu
        3. Screenshot from 2023-06-13 18-02-36.png
          124 kB
          Weihua Hu
        4. Screenshot from 2023-06-13 18-04-42.png
          109 kB
          Weihua Hu
        5. Screenshot from 2023-06-13 18-09-23.png
          89 kB
          Weihua Hu
        6. Screenshot from 2023-06-13 18-23-49.png
          125 kB
          Weihua Hu
        7. Screenshot from 2023-06-13 18-25-10.png
          74 kB
          Weihua Hu

              Unassigned Unassigned
              rhwhu Weihua Hu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: