The external registry folder watcher logs an ERROR with a NoSuchFileException stack trace for every temp file an editor's atomic save writes into the folder

Open Beginner friendly
#8,232 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, java
Domain
backend, devops

Research direction

Read components/core/core-registry and inspect RecursiveFolderWatcher.syncFile, especially the exception handling around file copying. Reproduce with an atomic-save edit to a file in the external registry folder and observe the logs. Done when a temp file removed before copying no longer produces an ERROR stack trace, while the real edited file is still synced.

Written by the indexing model from the issue text.

Description

  • Image: dirigiblelabs/dirigible:15.1.0-java (sha256:dac354be94f21f222e88b81fd7fc6e68d9616ee7b4e12bcb1e9eef0465bd213f)
  • Reference: dirigiblelabs/dirigible:15.1.0 (sha256:449b8c948738a2bd7a4294a7bec1000a08bc1da1cd20f312f0e54383a7af325d)

Same behaviour on both images.

Steps
mkdir -p /tmp/ext && cp -r <sample-intent-money> /tmp/ext/
docker run -d -p 8080:8080 -v /tmp/ext:/ext -e DIRIGIBLE_REGISTRY_EXTERNAL_FOLDER=/ext dirigiblelabs/dirigible:15.1.0-java
# once ready, edit a file the way most editors save (temp file + rename):
sed -i 's/.multiply(line.VatRate)/.multiply(line.VatRate).multiply(java.math.BigDecimal.TEN)/' /tmp/ext/sample-intent-money/custom/LineVatAction.java
docker logs <container>
Observed

The edit is picked up: it is recompiled and the new value is served in about 12 s. But every such save logs two ERRORs with full stack traces for the editor's temp file:

[ERROR] o.e.d.c.r.w.RecursiveFolderWatcher - Failed to sync: /ext/sample-intent-money/custom/sedeL8Fzd
java.nio.file.NoSuchFileException: /ext/sample-intent-money/custom/sedeL8Fzd
	at org.eclipse.dirigible.components.registry.watcher.RecursiveFolderWatcher.syncFile(RecursiveFolderWatcher.java:204)

(twice), then INFO Synced: .../LineVatAction.java. The default image logs the same pair.

Expected

A create/modify event for a file that is gone by the time it is copied is a benign race (sed -i, vim, most IDEs, git checkout). It should be skipped, or logged at DEBUG, not ERROR. The external registry folder is the deployment path the README names for applications (section "Java edition"), so these ERRORs reach log alerting on every edit.

Where

components/core/core-registry RecursiveFolderWatcher.syncFile: catch NoSuchFileException separately (or check Files.exists) before the generic IOException ERROR.

Dominant language
Java
Stars
278
Forks
97
Avg merge
15h 33m
Merged PRs (30d)
301

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-dirigible/dirigible

All issues in eclipse-dirigible/dirigible

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.