Intermittent DirectoryNotEmptyException when running analyze@v2

オープン
#2,174 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
github-actions, java, typescript
領域
ci-cd, devops, security

調査の方向性

報告された CodeQL データベースの finalize コマンド、raw ログ、および Windows self-hosted runner の詳細から始めてください。csharp データベースの cache\working ディレクトリと同時実行中のプロセスに関係する、断続的なクリーンアップ失敗を調査してください。説明されているワークフローで finalize ステップが DirectoryNotEmptyException を断続的に発生させなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Getting the below error intermittently on Perform CodeQL Analysis step, specifically when running database finalize command. Ultimately the error is java.nio.file.DirectoryNotEmptyException, the directory in question being C:\actions-runner_work_temp\codeql_databases\csharp\db-csharp\default\cache\working

C:\actions-runner\_work\_tool\CodeQL\2.16.3\x64\codeql\codeql.exe database finalize --finalize-dataset --threads=4 --ram=12799 C:\actions-runner\_work\_temp\codeql_databases\csharp Running pre-finalize script C:\actions-runner\_work\_tool\CodeQL\2.16.3\x64\codeql\csharp\tools\pre-finalize.cmd in C:\actions-runner\_work\REPO\REPO. Running TRAP import for CodeQL database at C:\actions-runner\_work\_temp\codeql_databases\csharp... Falling back to 2.15.x RAM sizing, for CodeQL Action compatibility. Importing TRAP files Merging relations A fatal error occurred: Could not clear working directory: C:\actions-runner\_work\_temp\codeql_databases\csharp\db-csharp\default\cache\working after saving relation files. (eventual cause: MultiIOException "java.nio.file.DirectoryNotEmptyException: C:\actions-runner\_work\_temp\codeql_d...") A fatal error occurred: Dataset import for C:\actions-runner\_work\_temp\codeql_databases\csharp\db-csharp failed with code 2. Error: A fatal error occurred.

Looking at raw logs:

2024-02-28T19:28:53.9246062Z [2024-02-28 19:25:22] [ERROR] An exception occurred during TRAP import. The database may be partial.
2024-02-28T19:28:53.9246522Z java.util.concurrent.CompletionException: Could not clear working directory: C:\actions-runner_work_temp\codeql_databases\csharp\db-csharp\default\cache\working after saving relation files.
2024-02-28T19:28:53.9246862Z (eventual cause: MultiIOException "java.nio.file.DirectoryNotEmptyException: C:\actions-runner_work_temp\codeql_d...")
2024-02-28T19:28:53.9247154Z at java.base/java.util.concurrent.CompletableFuture.encodeRelay(Unknown Source)
2024-02-28T19:28:53.9247446Z at java.base/java.util.concurrent.CompletableFuture.completeRelay(Unknown Source)
2024-02-28T19:28:53.9247714Z at java.base/java.util.concurrent.CompletableFuture$UniRelay.tryFire(Unknown Source)
2024-02-28T19:28:53.9248000Z at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
2024-02-28T19:28:53.9248324Z at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
2024-02-28T19:28:53.9248615Z at com.semmle.util.concurrent.FutureUtils.lambda$futureAutoclose$14(FutureUtils.java:227)
2024-02-28T19:28:53.9248890Z at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
2024-02-28T19:28:53.9249156Z at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
2024-02-28T19:28:53.9249441Z at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
2024-02-28T19:28:53.9249709Z at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)
2024-02-28T19:28:53.9249991Z at com.semmle.util.concurrent.Paralleliser.startMoreJobs(Paralleliser.java:134)
2024-02-28T19:28:53.9250284Z at com.semmle.util.concurrent.Paralleliser.lambda$startMoreJobs$2(Paralleliser.java:119)
2024-02-28T19:28:53.9250581Z at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
2024-02-28T19:28:53.9251475Z at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
2024-02-28T19:28:53.9251767Z at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
2024-02-28T19:28:53.9252018Z at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
2024-02-28T19:28:53.9252301Z at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
2024-02-28T19:28:53.9252549Z at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
2024-02-28T19:28:53.9252724Z at java.base/java.lang.Thread.run(Unknown Source)

Details:

  • GHES v3.9.5
  • Self-hosted Windows runner
  • Running CodeQL workflow using advanced setup on 100+ repos in enterprise setting. This error is not restricted to any certain repo or repos.
  • Began getting this error on v2.16.0, although we jumped there from v2.12.x so unsure about versions in between. Recently updated to v2.16.3 and still seeing it.

When I see this error, I re-trigger the workflow manually and it usually runs fine the second time, although it could get the same error again. Behavior is very intermittent.

My best guess at this point is that there are perhaps processes running concurrently that may lock some working files as read-only, or something similar.

Any assistance is greatly appreciated!

主要言語
TypeScript
スター
1.6k
フォーク
493
平均マージ
1日 13時間
マージ済み PR(30日)
44

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/codeql-action のほかの issue

github/codeql-action の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。