我正在使用github操作作为ci/cd工具对nextjs项目运行sonarqube分析。我的工作流文件如下所示。
on:
push:
branches:
- dev
jobs:
sonaranalysis:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarQube Analysis
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: Sonarqube Quality Gate Check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: "Example show SonarQube Quality Gate Status value"
run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}"
createpr:
needs: sonaranalysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: staging
- name: Reset branch
run: |
git fetch origin dev:dev
git reset --hard dev
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: stage-promotion
delete-branch: true
运行工作流时看到的错误日志如下所示
INFO: SCM Publisher 487 source files to be analyzed
INFO: SCM Publisher 487/487 source files have been analyzed (done) | time=6530ms
INFO: CPD Executor 59 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 387 files
INFO: CPD Executor CPD calculation finished (done) | time=175ms
INFO: Analysis report generated in 141ms, dir size=4.5 MB
INFO: Analysis report compressed in 994ms, zip size=2.6 MB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:26.977s
INFO: Final Memory: 18M/64M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Failed to upload report: Error 413 on ***/api/ce/submit?projectKey=astris-fe : <html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.20.1</center>
</body>
</html>
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:226)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:154)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:376)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
at org.sonarsource.scanner.cli.Main.main(Main.java:62)
Caused by: org.sonarqube.ws.client.HttpException: Error 413 on ***/api/ce/submit?projectKey=astris-fe : <html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.20.1</center>
</body>
</html>
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
at org.sonar.scanner.bootstrap.DefaultScannerWsClient.failIfUnauthorized(DefaultScannerWsClient.java:126)
at org.sonar.scanner.bootstrap.DefaultScannerWsClient.call(DefaultScannerWsClient.java:89)
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:224)
... 21 more
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Sonarqube是NGINX代理的幕后推手。我是github和sonarqube的新手。我不知道是不是错过了什么傻事。
我试着重新安装声纳。一切从头开始。我从八分之一变成七分之一。然而,这个问题仍然存在。有人面临同样的问题吗?