Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions articles/flow/kb/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,31 @@
See <<{articles}/flow/configuration/licenses#offline-license-key,Offline License Key>> for details on which key type to use for your Vaadin version.
====

[[license-prefs-backing-store]]
.+++<h3>Repeated "Could Not Lock User Prefs" Warnings During License Validation</h3>+++

Check failure on line 152 in articles/flow/kb/index.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'Prefs'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'Prefs'?", "location": {"path": "articles/flow/kb/index.adoc", "range": {"start": {"line": 152, "column": 39}}}, "severity": "ERROR"}
[%collapsible]
====
When the JVM user has no writable home directory -- for example, a hardened Tomcat deployment, a CI agent, or any other process running as a locked-down user -- the JVM may repeatedly log warnings like the following while a Vaadin tool performs license validation:

[source]
----
WARNING: Could not lock User prefs. Unix error code 2.
WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
----

The Vaadin license checker uses the Java `Preferences` API as part of license validation. On Linux and other Unix-like systems, the JVM stores those preferences as files under `~/.java/.userPrefs/` and starts a background thread that periodically flushes them. If that directory is not writable, every flush attempt produces a warning.

Point the Java Preferences store to a directory the JVM user can write to by setting the `java.util.prefs.userRoot` system property on the JVM running the affected tool -- the application server, the Maven or Gradle build, the TestBench test runner, and so on. For example:

[source,terminal]
----
-Djava.util.prefs.userRoot=/path/to/writable/dir
----

The directory is created on first use if it doesn't exist. Any location the JVM user can write to works -- somewhere under the server's instance directory, `/var/tmp`, or similar.

[NOTE]
This affects only Linux and other Unix-like operating systems. Windows and macOS use different mechanisms that don't write to the user's home directory, so they aren't affected by this issue, and the `java.util.prefs.userRoot` property has no effect there.
====

// end::licenses[]
Loading