Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop handling SQLite too many variables error #12032

Closed
ErisDS opened this issue Jul 9, 2020 · 4 comments
Closed

Stop handling SQLite too many variables error #12032

ErisDS opened this issue Jul 9, 2020 · 4 comments
Labels
server / core Issues relating to the server or core of Ghost

Comments

@ErisDS
Copy link
Member

ErisDS commented Jul 9, 2020

Problem

People using SQLite3 in production sometimes fall foul of SQLite's 999 variable limit. We've been thinking about how to refactor to cope with this, and we have a few bits and pieces in the codebase, but actually SQLite fixed it in their 3.32 version: https://www.sqlite.org/releaselog/3_32_0.html

Hopefully Node's SQLite project will come bundled with 3.32 by default soon as it's already in master.

Appetite: 0.5 day

Solution:

  1. We should remove all workarounds that we have for this in the codebase, they are code we don't need to maintain anymore.
    E.g. 08f54d2
    E.g. c701293
    E.g. a29ac26
  2. We should maybe look at adding an error handler that catches the error and converts it to a nicely formatted Ghost error telling people to upgrade to SQLite 3.32 - but only if this can be done quickly and easily in one place.

SQLITE_ERROR: too many SQL variables

  1. Maybe mention this as a minimum requirement in our docs
@ErisDS ErisDS added the server / core Issues relating to the server or core of Ghost label Jul 9, 2020
@stale
Copy link

stale bot commented Oct 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale [triage] Issues that were closed to to lack of traction label Oct 11, 2020
@naz naz added pinned [triage] Ignored by stalebot and removed stale [triage] Issues that were closed to to lack of traction labels Oct 12, 2020
@naz
Copy link
Member

naz commented Jan 8, 2021

Hopefully Node's SQLite project will come bundled with 3.32 by default soon as it's already in master.

@ErisDS saw your conversation in the thread asking for maintenance help for node-sqllte3 and having commit rights to the repo. The 5.0.1 version was merged on GH but never published to npm because the build failed. Would be cool if you could influence a proper release of 5.0.1 (also happy to help in any way possible myself).

To do a proper cleanup we'd need new binaries, so that Ghost could use worker_threads instead of current workaround with child processes.

@naz
Copy link
Member

naz commented Jan 11, 2021

Tried out fresh 5.0.1 build of node-sqlite3. Unfortunately it does not compile the binaries locally (my environment is Ubuntu 20.04, with Node v12, and python 3). The issue is this one described in node-sqlite3 here (outdated node-gyp dependency).

Another issue I've spotted was that most popular Linux server distro hosting Ghost (Ubuntu) installs sqlite3 at version 3.31 using apt install sqlite3. Getting 3.32 running locally requires manual compilation of binaries.

Given above issues, I don't think it would make sense to remove the workarounds just yet. Otherwise we leave self-hosters in a world of pain trying to install latest sqlite3 version (TryGhost/Ghost-CLI#1373 with regular sqlite3 installations already).

I think to move forward with this issue we need to have an easy way to run sqlite3 either through bundled binaries that come with node-sqlite (solve TryGhost/node-sqlite3#1415) OR be able to install sqlite3@3.32 easily through apt on Ubuntu.

@ErisDS ErisDS removed the pinned [triage] Ignored by stalebot label Feb 24, 2021
@ErisDS
Copy link
Member Author

ErisDS commented Feb 24, 2021

Closing this, we can resurface it when it becomes possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

No branches or pull requests

2 participants