Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish test results failure /check-runs failed with 403: Forbidden when triggered by dependabot. Falsely looks like a cache issue #641

Open
dojones1 opened this issue Dec 17, 2024 · 1 comment

Comments

@dojones1
Copy link

When working on a branch, triggering builds the pipeline was successfully publishing test results.
The changes got merged to master and I thought was working fine. However now when the build runs for dependabot initiated pull requests, the publish test results stage fails:
2024-12-16T18:09:00.1824477Z 2024-12-16 18:09:00 +0000 - publish - INFO - Publishing success results for commit cbe10ab149eac25400bc7fb7aca532cbfbcc8410
2024-12-16T18:09:00.5210149Z Request POST /repos/dojones1/parserService/check-runs failed with 403: Forbidden
2024-12-16T18:09:00.5223344Z 2024-12-16 18:09:00 +0000 - github.GithubRetry - INFO - Request POST /repos/dojones1/parserService/check-runs failed with 403: Forbidden

This then initates a downstream failure which is slightly more obvious in the logs where the cache fails.

Advice please.

Workflow file

  test-python:
    needs: [lint-dockerfile-files, lint-yaml-files, lint-python-files, lint-js-files]
    runs-on: ubuntu-latest
    container: ubuntu:24.04
    steps:
      - uses: actions/checkout@v4
      - run: |
          export SERVICE_BUILD_TIME_DATE="2021-02-02T15:24:16Z"
          export GIT_COMMIT_SHA="e7267"
          export BUILD_EXPIRY_TIME_DAYS="99999"
          apt-get update
          apt-get install -y python3-pip python3-pytest python3-flask python3-venv
          mkdir -p /opt/parser/uploads
          mkdir -p /opt/parser/processed
          cp -r services/logparser/parser /opt/parser/parser
          mkdir services/logparser/parser/parsers/pkgs/test/output
          mkdir test-results
          cd services/logparser
          python3 -m pytest test/*.py parser/parsers/pkgs/test/*.py -v --junitxml ../../test-results/pytest.xml
      - name: Publish Test Results
        uses: EnricoMi/publish-unit-test-result-action/linux@v2
        if: always()
        with:
          files: |
            test-results/**/*.xml
            test-results/**/*.trx
            test-results/**/*.json

Log

2024-12-16T18:08:59.6929322Z ##[group]Run # Publish Test Results
2024-12-16T18:08:59.6930485Z �[36;1m# Publish Test Results�[0m
2024-12-16T18:08:59.6930802Z �[36;1mecho '::group::Publish Test Results'�[0m
2024-12-16T18:08:59.6931188Z �[36;1m"$PYTHON_VENV" "$GITHUB_ACTION_PATH/../python/publish_test_results.py"�[0m
2024-12-16T18:08:59.6931555Z �[36;1mecho '::endgroup::'�[0m
2024-12-16T18:08:59.6931953Z shell: bash --noprofile --norc -e -o pipefail {0}
2024-12-16T18:08:59.6932263Z env:
2024-12-16T18:08:59.6932452Z   PYTHON_BIN: /usr/bin/python3
2024-12-16T18:08:59.6932926Z   DEPENDENCIES_VERSION: post-3.8
2024-12-16T18:08:59.6933357Z   PYTHON_VENV: /__w/parserService/parserService/enricomi-publish-action-venv/bin/python
2024-12-16T18:08:59.6933964Z   GITHUB_TOKEN: ***
2024-12-16T18:08:59.6934180Z   GITHUB_TOKEN_ACTOR: github-actions
2024-12-16T18:08:59.6934434Z   GITHUB_RETRIES: 10
2024-12-16T18:08:59.6934626Z   COMMIT: 
2024-12-16T18:08:59.6934797Z   CHECK_NAME: Test Results
2024-12-16T18:08:59.6935007Z   COMMENT_TITLE: 
2024-12-16T18:08:59.6935196Z   COMMENT_MODE: always
2024-12-16T18:08:59.6935391Z   FAIL_ON: test failures
2024-12-16T18:08:59.6935597Z   ACTION_FAIL: false
2024-12-16T18:08:59.6935802Z   ACTION_FAIL_ON_INCONCLUSIVE: false
2024-12-16T18:08:59.6936138Z   FILES: test-results/**/*.xml
test-results/**/*.trx
test-results/**/*.json

2024-12-16T18:08:59.6936477Z   JUNIT_FILES: 
2024-12-16T18:08:59.6936657Z   NUNIT_FILES: 
2024-12-16T18:08:59.6936837Z   XUNIT_FILES: 
2024-12-16T18:08:59.6937010Z   TRX_FILES: 
2024-12-16T18:08:59.6937177Z   TIME_UNIT: seconds
2024-12-16T18:08:59.6937377Z   TEST_FILE_PREFIX: 
2024-12-16T18:08:59.6937575Z   REPORT_INDIVIDUAL_RUNS: 
2024-12-16T18:08:59.6937787Z   REPORT_SUITE_LOGS: none
2024-12-16T18:08:59.6938007Z   DEDUPLICATE_CLASSES_BY_FILE_NAME: 
2024-12-16T18:08:59.6938242Z   LARGE_FILES: 
2024-12-16T18:08:59.6938414Z   IGNORE_RUNS: false
2024-12-16T18:08:59.6938614Z   COMPARE_TO_EARLIER_COMMIT: true
2024-12-16T18:08:59.6938850Z   PULL_REQUEST_BUILD: merge
2024-12-16T18:08:59.6939056Z   EVENT_FILE: 
2024-12-16T18:08:59.6939233Z   EVENT_NAME: 
2024-12-16T18:08:59.6939414Z   TEST_CHANGES_LIMIT: 
2024-12-16T18:08:59.6939859Z   CHECK_RUN_ANNOTATIONS: all tests, skipped tests
2024-12-16T18:08:59.6940234Z   CHECK_RUN_ANNOTATIONS_BRANCH: 
2024-12-16T18:08:59.6940478Z   SECONDS_BETWEEN_GITHUB_READS: 0.25
2024-12-16T18:08:59.6940726Z   SECONDS_BETWEEN_GITHUB_WRITES: 2.0
2024-12-16T18:08:59.6940973Z   SECONDARY_RATE_LIMIT_WAIT_SECONDS: 
2024-12-16T18:08:59.6941216Z   JSON_FILE: 
2024-12-16T18:08:59.6941400Z   JSON_THOUSANDS_SEPARATOR:  
2024-12-16T18:08:59.6941633Z   JSON_SUITE_DETAILS: false
2024-12-16T18:08:59.6941855Z   JSON_TEST_CASE_RESULTS: false
2024-12-16T18:08:59.6942069Z   CHECK_RUN: true
2024-12-16T18:08:59.6942253Z   JOB_SUMMARY: true
2024-12-16T18:08:59.6942449Z   SEARCH_PULL_REQUESTS: false
2024-12-16T18:08:59.6942659Z   ROOT_LOG_LEVEL: 
2024-12-16T18:08:59.6942840Z   LOG_LEVEL: 
2024-12-16T18:08:59.6943019Z ##[endgroup]
2024-12-16T18:08:59.7497798Z ##[group]Publish Test Results
2024-12-16T18:09:00.0104668Z 2024-12-16 18:09:00 +0000 - publish -  INFO - Available memory to read files: 6.7 GiB
2024-12-16T18:09:00.0111713Z 2024-12-16 18:09:00 +0000 - publish -  INFO - Reading files test-results/**/*.xml, test-results/**/*.trx, test-results/**/*.json (1 file, 11.2 KiB)
2024-12-16T18:09:00.0118994Z 2024-12-16 18:09:00 +0000 - publish -  INFO - Detected 1 JUnit XML file (11.2 KiB)
2024-12-16T18:09:00.0124940Z 2024-12-16 18:09:00 +0000 - publish -  INFO - Finished reading 1 files in 0.00 seconds
2024-12-16T18:09:00.1824477Z 2024-12-16 18:09:00 +0000 - publish -  INFO - Publishing success results for commit cbe10ab149eac25400bc7fb7aca532cbfbcc8410
2024-12-16T18:09:00.5210149Z Request POST /repos/dojones1/parserService/check-runs failed with 403: Forbidden
2024-12-16T18:09:00.5223344Z 2024-12-16 18:09:00 +0000 - github.GithubRetry -  INFO - Request POST /repos/dojones1/parserService/check-runs failed with 403: Forbidden
2024-12-16T18:09:00.5224283Z Traceback (most recent call last):
2024-12-16T18:09:00.5225213Z   File "/__w/_actions/EnricoMi/publish-unit-test-result-action/v2/linux/../python/publish_test_results.py", line 546, in <module>
2024-12-16T18:09:00.5226137Z     main(settings, gha)
2024-12-16T18:09:00.5226995Z   File "/__w/_actions/EnricoMi/publish-unit-test-result-action/v2/linux/../python/publish_test_results.py", line 269, in main
2024-12-16T18:09:00.5262624Z     Publisher(settings, gh, gha).publish(stats, results.case_results, conclusion)
2024-12-16T18:09:00.5264072Z   File "/__w/_actions/EnricoMi/publish-unit-test-result-action/v2/python/publish/publisher.py", line 233, in publish
2024-12-16T18:09:00.5264885Z     data = self.publish_check(data)
2024-12-16T18:09:00.5265244Z            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5266020Z   File "/__w/_actions/EnricoMi/publish-unit-test-result-action/v2/python/publish/publisher.py", line 461, in publish_check
2024-12-16T18:09:00.5266967Z     check_run = self._repo.create_check_run(name=self._settings.check_name,
2024-12-16T18:09:00.5267485Z                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5268503Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/github/Repository.py", line 3885, in create_check_run
2024-12-16T18:09:00.5269565Z     headers, data = self._requester.requestJsonAndCheck(
2024-12-16T18:09:00.5270170Z                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5271150Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/github/Requester.py", line 550, in requestJsonAndCheck
2024-12-16T18:09:00.5272452Z     return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url)))
2024-12-16T18:09:00.5273165Z                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5274144Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/github/Requester.py", line 715, in requestJson
2024-12-16T18:09:00.5275278Z     return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode)
2024-12-16T18:09:00.5275858Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5276843Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/github/Requester.py", line 812, in __requestEncode
2024-12-16T18:09:00.5278069Z     status, responseHeaders, output = self.__requestRaw(cnx, verb, url, requestHeaders, encoded_input)
2024-12-16T18:09:00.5278785Z                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5279983Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/github/Requester.py", line 846, in __requestRaw
2024-12-16T18:09:00.5280934Z     response = cnx.getresponse()
2024-12-16T18:09:00.5281271Z                ^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5282146Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/github/Requester.py", line 198, in getresponse
2024-12-16T18:09:00.5283042Z     r = verb(
2024-12-16T18:09:00.5283294Z         ^^^^^
2024-12-16T18:09:00.5284051Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/requests/sessions.py", line 637, in post
2024-12-16T18:09:00.5285267Z     return self.request("POST", url, data=data, json=json, **kwargs)
2024-12-16T18:09:00.5285759Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5286674Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
2024-12-16T18:09:00.5287592Z     resp = self.send(prep, **send_kwargs)
2024-12-16T18:09:00.5287961Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5288827Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
2024-12-16T18:09:00.5289903Z     r = adapter.send(request, **kwargs)
2024-12-16T18:09:00.5290250Z         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5291109Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
2024-12-16T18:09:00.5291980Z     resp = conn.urlopen(
2024-12-16T18:09:00.5292288Z            ^^^^^^^^^^^^^
2024-12-16T18:09:00.5293326Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 934, in urlopen
2024-12-16T18:09:00.5294437Z     retries = retries.increment(method, url, response=response, _pool=self)
2024-12-16T18:09:00.5294977Z               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5295893Z   File "/__w/parserService/parserService/enricomi-publish-action-venv/lib/python3.12/site-packages/github/GithubRetry.py", line 187, in increment
2024-12-16T18:09:00.5297086Z     raise Requester.createException(response.status, response.headers, content)  # type: ignore
2024-12-16T18:09:00.5297758Z     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-16T18:09:00.5298911Z github.GithubException.GithubException: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/checks/runs#create-a-check-run", "status": "403"}
2024-12-16T18:09:00.5622052Z ##[error]Process completed with exit code 1.
2024-12-16T18:09:00.5670762Z ##[group]Run actions/cache/save@v4
2024-12-16T18:09:00.5671004Z with:
2024-12-16T18:09:00.5671185Z   path: ~/.cache/pip
2024-12-16T18:09:00.5671543Z   key: enricomi-publish-action-Linux-X64-pip-3.12-b0048519e3287ae9cfc634aeda40cbfe
2024-12-16T18:09:00.5671962Z   enableCrossOsArchive: false
2024-12-16T18:09:00.5672184Z env:
2024-12-16T18:09:00.5672357Z   PYTHON_BIN: /usr/bin/python3
2024-12-16T18:09:00.5672593Z   DEPENDENCIES_VERSION: post-3.8
2024-12-16T18:09:00.5673002Z   PYTHON_VENV: /__w/parserService/parserService/enricomi-publish-action-venv/bin/python
2024-12-16T18:09:00.5673394Z ##[endgroup]
2024-12-16T18:09:00.5675655Z ##[command]/usr/bin/docker exec  07b217f03b82bef74010172b2306c71afad51414696ccc3a8ddee7a8bdcf7cd2 sh -c "cat /etc/*release | grep ^ID"
2024-12-16T18:09:00.8127341Z [warning]Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
2024-12-16T18:09:00.8143080Z ##[warning]Cache save failed.
2024-12-16T18:09:00.8288032Z Post job cleanup.
2024-12-16T18:09:00.8292058Z ##[command]/usr/bin/docker exec  07b217f03b82bef74010172b2306c71afad51414696ccc3a8ddee7a8bdcf7cd2 sh -c "cat /etc/*release | grep ^ID"
2024-12-16T18:09:01.0421296Z Stop and remove container: 421e22b367af49b09e4b02069ecb713f_ubuntu2404_477371
2024-12-16T18:09:01.0427297Z ##[command]/usr/bin/docker rm --force 07b217f03b82bef74010172b2306c71afad51414696ccc3a8ddee7a8bdcf7cd2
2024-12-16T18:09:01.9977137Z 07b217f03b82bef74010172b2306c71afad51414696ccc3a8ddee7a8bdcf7cd2
2024-12-16T18:09:02.0000989Z Remove container network: github_network_8f0877a0882344c395af6c87885f4b95
2024-12-16T18:09:02.0005671Z ##[command]/usr/bin/docker network rm github_network_8f0877a0882344c395af6c87885f4b95
2024-12-16T18:09:02.1026771Z github_network_8f0877a0882344c395af6c87885f4b95
2024-12-16T18:09:02.1114071Z Cleaning up orphan processes

For private repositories, please paste logs or your workflow yaml if you think this is relevant.

If the error occurs repeatedly, please consider adding this to the publish action, to collect more information on the issue:

with:
  root_log_level: DEBUG
  log_level: DEBUG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants