1

Topic: Unable to update from spider-v1.1.0 to v2.2.0

spider-v1.1.0-linux-amd64

when updating to v2.2.0  from v1.1.0 I get no error on the update script but unable to load the web ui after update
check the log file and get

2023-05-03 15:53:14 ERROR [SQL] Failed in updating sql schema: 2, SQL logic error: no such table: smtp (1)
2023-05-03 15:53:14 ERROR failed in initializing events db: failed in initializing event database: SQL logic error: no such table: smtp (1)

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Unable to update from spider-v1.1.0 to v2.2.0

Hi JamesBon,

Could you please try the latest v2.3.0 instead?
We will check the v2.2.0 issue and come back later.

3

Re: Unable to update from spider-v1.1.0 to v2.2.0

Turns out it's a bug of jumping upgrade. If you upgrade to each newer release, e.g. v1.1.0 -> 2.0.0 -> 2.1.0 -> 2.2.0 -> 2.3.0, then no such error. But it should work fine if you restart spiderd service.

We have to re-think about automatic SQL update. Stay tuned.

4

Re: Unable to update from spider-v1.1.0 to v2.2.0

Hi JamesBon,

As a temporary solution, please fix it with shell commands below:

sqlite3 /opt/spider/db/events.db <<EOF
-- Introduced in v2.1.0.
CREATE TABLE IF NOT EXISTS smtp (
    id              INTEGER PRIMARY KEY AUTOINCREMENT,
    ip              TEXT NOT NULL DEFAULT '',

    -- SMTP Reply.
    reply           TEXT NOT NULL DEFAULT '',

    -- Reject or retry reason.
    reason          TEXT NOT NULL DEFAULT '',

    -- Extra information
    msg             TEXT NOT NULL DEFAULT '',

    huid            TEXT NOT NULL DEFAULT '',
    message_id      TEXT NOT NULL DEFAULT '',
    epoch           INTEGER NOT NULL DEFAULT 0
) STRICT;

CREATE INDEX IF NOT EXISTS idx_smtp_ip ON smtp (ip);
CREATE INDEX IF NOT EXISTS idx_smtp_reply ON smtp (reply);
CREATE INDEX IF NOT EXISTS idx_smtp_reason ON smtp (reason);
CREATE INDEX IF NOT EXISTS idx_smtp_huid ON smtp (huid);
CREATE INDEX IF NOT EXISTS idx_smtp_message_id ON smtp (message_id);
CREATE INDEX IF NOT EXISTS idx_smtp_epoch ON smtp (epoch);
EOF

Then start/restart the "spiderd" service.

5

Re: Unable to update from spider-v1.1.0 to v2.2.0

Note: Spider uses SQLite "strict table"[1], at least SQLite 3.37.0 is required for command line access. If you don't have SQLite 3.37.0 or later on this server, it's ok to copy /opt/spider/db/events.db to another server which has SQLite 3.37.0 or later, do the modification then copy back to Spider server, be careful with the file owner/group (spider:spider) and permission (0700).

[1] https://www.sqlite.org/stricttables.html

6

Re: Unable to update from spider-v1.1.0 to v2.2.0

This issue has been fixed in v2.4.0.