Repository navigation
fix(content): store the sqlite database in /tmp - #251
Merged
Merged
Conversation
Nuxt Content restores its bundled dump to ./contents.sqlite at startup, which resolves against /app. The runtime image runs as nonroot and the deployment uses a read-only root filesystem, so the file could not be created and every content query returned 500. /tmp is the writable emptyDir mount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jordan Jones <git@svcs.ok8.sh>
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.
What
Set
content.databaseto{ type: 'sqlite', filename: '/tmp/contents.sqlite' }innuxt.config.ts.Why
In production every
/__nuxt_content/blog/queryrequest returned 500 withunable to open database file(ERR_SQLITE_ERROR, errcode 14). The blog's runtime queries were all failing.With the
node-serverpreset, Nuxt Content 3.16.1 defaults the runtime database to./contents.sqlite, which resolves against the cwd (/app). That path can't be written in production:nonroot, but/appis owned by rootok8-shdeployment setsreadOnlyRootFilesystem: true, and its only writable mount is the/tmpemptyDirThe database is restored from the bundled dump at startup, so it doesn't need to persist.
/tmpis enough.Testing
NITRO_PRESET=node-serverand ran.output/server/index.mjsfrom/, where the user can't write./tmp/contents.sqlite._content_blogquery returned[{"path":"/blog/hello-world"}].馃 Generated with Claude Code