Repository navigation
Apply the bundled RavenDB license at startup when the data volume has none - #6054
Draft
andreasohlund wants to merge 1 commit into
Draft
andreasohlund wants to merge 1 commit into
andreasohlund wants to merge 1 commit into
Conversation
Member
Author
|
@mauroservienti @ramonsmits not sure if the scenario is common enough to fix this, but we had a user today affected by this |
Member
Seems like an ok change as we would always have a valid license. Only concern here is that when a user currently has misconfigured the container and updates to this version it seems it could fail to start. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
RavenDB 6.2 reads
LicenseandLicense.Pathonly once, when a node with no cluster yet bootstraps one (ServerStore.EnsureNotPassiveAsynccallsLicenseManager.TryActivateLicenseAsync). After that, it ignores the configured license.So if the data volume mounted into
servicecontrol-ravendbwas first used by a RavenDB server without the ServiceControl license, for example the officialravendb/ravendbimage or a volume reused from another setup, the database container stays onAGPL - Open Source. It doesn't apply the bundled license and logs nothing about licensing. Since 6.9 (#5235), the Error and Audit instances then stop at startup withCannot validate the current RavenDB license. Please, contact support. This came up in a support case.Change
Sets
RAVEN_License_ThrowOnInvalidOrMissingLicense=truein theservicecontrol-ravendbimage. With this RavenDB setting, the server checks at every startup whether a license is stored. If none is, it activates the license fromLicenseorLicense.Path. If that fails too, the server refuses to start and logs which configuration keys it tried.Observable effect:
Constraints:
servicecontrol-ravendbimage, which the bundled license is meant for. External, separately licensed RavenDB servers are not affected.Alternatives considered
sc-container-startup.sh. The base image'srun-raven.shsupports this, but it does the same job as a built-in setting with more shell code to maintain, and it would need extra handling for servers secured with certificates.Not in this PR: a clearer
LicenseStatusCheckerror message, and the same setting for the embedded database. Each is a separate change.Verification
Built the image from this branch (
BASETAG=6.2.18-ubuntu.22.04-arm64v8) and checked/license/status:ravendb/ravendb:6.2.18with a database: the bundled license is applied at startup. Without this change, the same volume stays AGPL indefinitely.RAVEN_License_Pathpointing to a missing file: the container exits with code 255 and the errorThe RavenDB server cannot start due to a missing license.I also ran the same scenarios against the published 6.21.3 image with the setting passed as an environment variable. Once applied, the license stays on the volume when the container is later started without the setting.
CI's
container-testjobs exercise the full compose stack against the image built from this branch.Documentation
The RavenDB containers page gains a troubleshooting section for this case in Particular/docs.particular.net#8609. If this PR ships, that section should name the fixed version and only apply to earlier versions.