You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue when deploying a Nuxt Content project in a production environment using Docker. Refreshing a page that displays parsed content (not navigating via routes) results in a 500 error. The error message is as follows:
After checking the server logs, I found this error:
Failed to execute SQL DROP TABLE IF EXISTS _content_docs;: Error loading shared library /home/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node: Exec format error...
Upon further investigation, I entered the Docker container and noticed that the contents.sqlite file is not generated in the server directory.
Strangely, navigating to the content page via route transitions works fine. The issue only occurs when refreshing a parsed content page directly.
Finally, this is my Dockerfile file
FROM node:20-alpine3.20
RUN mkdir -p /home
WORKDIR /home
ENV HOST 0.0.0.0
COPY ./.output /home
EXPOSE 3000/tcp
CMD ["node", "server/index.mjs"]
Could you please provide guidance on resolving this issue? Let me know if additional information is needed.
Thank you!
Additional context
No response
Logs
Listening on http://0.0.0.0:3000
Failed to execute SQL DROP TABLE IF EXISTS _content_docs;: Error loading shared library /home/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node: Exec format error
Failed to execute SQL CREATE TABLE IF NOT EXISTS _content_docs (id TEXT PRIMARY KEY, "title" VARCHAR, "body" TEXT, "date" VARCHAR, "description" VARCHAR, "extension" VARCHAR, "image" VARCHAR, "meta" TEXT, "navigation" TEXT DEFAULT true, "path" VARCHAR, "seo" TEXT DEFAULT '{}', "stem" VARCHAR, "tags" TEXT, "updated" VARCHAR);: Error loading shared library /home/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node: Exec format error
Failed to execute SQL INSERT INTO _content_docs VALUES ('docs/docs/1.index.md', 'demo1', '{"type":"minimal","value":[["h2",{"id":"title"},"title"],["p",{},"demo1"]],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"title","depth":2,"text":"title"}]}}', '2025-01-14 16:00:00', '', 'md', NULL, '{}', 'true', '/docs', '{"title":"demo1","description":""}', 'docs/1.index', '["Spring","AI"]', NULL);: Error loading shared library /home/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node: Exec format error
Failed to execute SQL INSERT INTO _content_docs VALUES ('docs/docs/2.index2.md', 'demo2', '{"type":"minimal","value":[["h2",{"id":"title"},"title"],["p",{},"demo2"]],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"title","depth":2,"text":"title"}]}}', '2025-01-14 16:00:00', '', 'md', NULL, '{}', 'true', '/docs/index2', '{"title":"demo2","description":""}', 'docs/2.index2', NULL, NULL);: Error loading shared library /home/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node: Exec format error
Failed to execute SQL CREATE TABLE IF NOT EXISTS _content_info (id TEXT PRIMARY KEY, "version" VARCHAR);: Error loading shared library /home/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node: Exec format error
Failed to execute SQL DELETE FROM _content_info WHERE id = 'checksum_docs';: Error loading shared library /home/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node: Exec format error
Failed to execute SQL INSERT INTO _content_info VALUES ('checksum_docs', 'TognxvETDU');: Error loading shared library /home/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node: Exec format error
The text was updated successfully, but these errors were encountered:
Since there is a native dependency in the project, you need to build your project inside your docker file. Building the project outside will install incompatible binary which cannot be execute in the alpine architecture.
Environment
Reproduction
minimal reproduction
Describe the bug
I'm encountering an issue when deploying a Nuxt Content project in a production environment using Docker. Refreshing a page that displays parsed content (not navigating via routes) results in a 500 error. The error message is as follows:
After checking the server logs, I found this error:
Upon further investigation, I entered the Docker container and noticed that the
contents.sqlite
file is not generated in theserver
directory.Strangely, navigating to the content page via route transitions works fine. The issue only occurs when refreshing a parsed content page directly.
Finally, this is my Dockerfile file
Could you please provide guidance on resolving this issue? Let me know if additional information is needed.
Thank you!
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: