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

Duplicated logs returned calling /api/v1/superuser/logs API

XMLWordPrintable

    • False
    • None
    • False
    • User Experience

      This is a bug affecting Quay 3.8.0

      One of our customers observed that when the listAllLogs API is called, it will return duplicate logs.
      The next-page token is returned on the first invocation and all the next invocations return the same logs without ever getting to the last page.

      This is how the API is being called:

      # First invocation
      $ curl -X GET -H "Authorization: Bearer XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx" "https://<quay-endpoint-here>/api/v1/superuser/logs?endtime=mm/dd/yyyy&starttime=mm/dd/yyyy"
      # Second invocation
      $ curl -X GET -H "Authorization: Bearer XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx" "https://<quay-endpoint-here>/api/v1/superuser/logs?endtime=mm/dd/yyyy&starttime=mm/dd/yyyy&next_page=<token-here>"
      # Third invocation
      $ curl -X GET -H "Authorization: Bearer XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx" "https://<quay-endpoint-here>/api/v1/superuser/logs?endtime=mm/dd/yyyy&starttime=mm/dd/yyyy&next_page=<token-here>"

      The same behavior has been observed also in the web UI from the "Super User Admin Panel Usage Logs" page.

      The bug is repeatable following the below commands

      curl -X GET -k -H "Authorization: Bearer qz9NZ2Np1f55CSZ3RVOvxjeUdkzYuCp0pKggABCD" https://example-registry-quay-quay-enterprise.apps.example.com/api/v1/superuser/logs | jq >> file1
      nextPage=$(cat file1 | grep next_page| awk '{print $2}')
      curl -X GET -k -H "Authorization: Bearer qz9NZ2Np1f55CSZ3RVOvxjeUdkzYuCp0pKggABCD" https://example-registry-quay-quay-enterprise.apps.example.com/api/v1/superuser/logs?next_page=$nextPage | jq >> file2
      nextPage=$(cat file2 | grep next_page| awk '{print $2}')
      curl -X GET -k -H "Authorization: Bearer qz9NZ2Np1f55CSZ3RVOvxjeUdkzYuCp0pKggABCD" https://example-registry-quay-quay-enterprise.apps.example.com/api/v1/superuser/logs?next_page=$nextPage | jq >> file3
      vimdiff file1 file2 file3
      Page 1
      gAAAAABkVQ5PFgdDQoY-yHRH3gEHAupCFn5MvacYHtdjMSkqdQG3BpFwlJ_1CdbvSdSjeoq0qKrhSemffSNhATk3L4stthjEztVHIzlDFHnJaBfWQWagf2Wfz3_W2YXqgVVu_OaYvIPQxjG6exXYxOA3v-DevZypI0cbRtuzE9McUmaJ1Uoz61GZZT-qizc4eA2yo2Ro0Nt0
       
      Page 2 
      gAAAAABkVQ5ia4UCAUbdwFDAmlguydrLGI2ZhBIwhJ7GAoK3drAc2PISziVTlEl9lvkni6geS8ecy8kId1A-CROARRRQqL9fc_UHxwPvzkb-MWGVhmEl3ik3LzAqmpsGHGkqcH5NuiExYkxvw37fEjEcF_bYW0aVEALfBkQmTFXiTHs8z7vQfRsWESRoFxs1w8YtykLK1pi_
      Page 3
      gAAAAABkVQ50xoik4_pwhvJ1adfcanguVd5xkEFEGZUtu8XjREQUHWsbBNEd5Ab3UNqtJ2BUYeBVa10yCv3ypRPfomFRfKn6xS7W-Dg3flx3auETp-oLTxZyvPhRtBjetOghGvR48BDiRP2E-YnAilwZhiaLCjg99hLjsK2ftbUVuAr1Vu4thzXqen8vaAtUty04V6RpIAOQ
      {'start_index': '2023-05-05T14:03:07.417552Z', 'page_number': 1, 'is_datetime': True}
      {'start_index': '2023-05-05T14:03:07.417552Z', 'page_number': 2, 'is_datetime': True}
      {'start_index': '2023-05-05T14:03:07.417552Z', 'page_number': 3, 'is_datetime': True} 

      The customer shared with us their nextPage tokens and we decrypted them to make sure nothing was a miss which is shown above. 

              sdadi@redhat.com Sunanda Dadi
              rhn-support-ggeraci Giovanni Geraci
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: