hoarder-app / hoarder

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
https://hoarder.app
GNU Affero General Public License v3.0
5.54k stars 176 forks source link

SqliteError: no such table: tasks #568

Closed callmemagnus closed 2 weeks ago

callmemagnus commented 2 weeks ago

Hello,

I just installed hoarder (0.10.0) with the proposed docker-compose.yml (with llama). I was able to sign up and sign in.

When I add an url, I get in the UI: no such table: tasks

And in the logs:

hoarder-1  | SqliteError: no such table: tasks
hoarder-1  |     at Database.prepare (/app/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
hoarder-1  |     ... 5 lines matching cause stack trace ...
hoarder-1  |     at QueryPromise.then (/app/apps/web/.next/server/chunks/109.js:46:57691) {
hoarder-1  |   code: 'INTERNAL_SERVER_ERROR',
hoarder-1  |   name: 'TRPCError',
hoarder-1  |   [cause]: SqliteError: no such table: tasks
hoarder-1  |       at Database.prepare (/app/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
hoarder-1  |       at v.prepareQuery (/app/apps/web/.next/server/chunks/109.js:46:47384)
hoarder-1  |       at v.prepareOneTimeQuery (/app/apps/web/.next/server/chunks/109.js:46:46289)
hoarder-1  |       at QueryPromise._prepare (/app/apps/web/.next/server/chunks/109.js:46:84112)
hoarder-1  |       at QueryPromise.all (/app/apps/web/.next/server/chunks/109.js:46:84289)
hoarder-1  |       at QueryPromise.execute (/app/apps/web/.next/server/chunks/109.js:46:84423)
hoarder-1  |       at QueryPromise.then (/app/apps/web/.next/server/chunks/109.js:46:57691) {
hoarder-1  |     code: 'SQLITE_ERROR'
hoarder-1  |   }

Is there something I can do to help solve this issue ?

kamtschatka commented 2 weeks ago

0.10.0 is an ancient version, there is already 0.18.0, it makes no sense to help you set up this version

callmemagnus commented 2 weeks ago

hmmm.. I wonder why I wrote 0.10.0. I used 0.18.0.

kamtschatka commented 2 weeks ago

sounds like you did not set up the data dir correctly, so the database did not get migrated correctly. what did you do exactly

callmemagnus commented 2 weeks ago

I added the content of the docker-compose.yml into my already existing docker-compose (which provides ssl and other things).

I changed some settings but just some paths changes

  hoarder:
    image: ghcr.io/hoarder-app/hoarder-web:0.18.0
    restart: unless-stopped
    volumes:
      - /srv/docker/hoarder/data:/data
    ports:
      - 3000:3000
    env_file:
      - hoarder.env
    environment:
      - VIRTUAL_HOST=notes.magooweb.com
      - VIRTUAL_PORT=3000
      - LETSENCRYPT_HOST=notes.magooweb.com
      - MEILI_ADDR=http://hoarder-meilisearch:7700
      - BROWSER_WEB_URL=http://hoarder-chrome:9222
      - DATA_DIR=/data
      - OLLAMA_BASE_URL=http://ollama:11434
      - INFERENCE_TEXT_MODEL=llama3.1
      - INFERENCE_IMAGE_MODEL=llava
#      - INFERENCE_CONTEXT_LENGTH
    networks:
      - nextcloud
      - default
    depends_on:
      - hoarder-chrome
      - ollama
      - hoarder-search

Pulled the images and up -d. No errors in the container. I register and boom when I add a link.

In the data directory` I have:

# ls -la /srv/docker/hoarder/data/
total 244
drwxr-xr-x 2 root root   4096 Oct 18 21:54 .
drwxr-xr-x 4 root root   4096 Oct 18 20:48 ..
-rw-r--r-- 1 root root 241664 Oct 18 21:54 db.db
-rw-r--r-- 1 root root      0 Oct 18 21:05 queue.db

The empty queue.db sounds bad. I tried stopping/killing the container, deleting the 2 db files and restart but same result.

kamtschatka commented 2 weeks ago

you are using "image: ghcr.io/hoarder-app/hoarder-web:0.18.0", whereas the docker-compose you linked, contains "image: ghcr.io/hoarder-app/hoarder:${HOARDER_VERSION:-release}" (hoarder-web vs hoarder). This container does not migrate the database (the worker does AFAIK), so you have an inconsistent state.

callmemagnus commented 2 weeks ago

hmmm. True, I was on release. The env file and the use of the variable is misleading as my setup does not expose the variable to the docker compose globally but only for specific containers.

I didn't see the hoarder and hoarder-web mixup. Good catch. Seems to be working now. Llama is just soooo slow on my machine ;-)

I'm closing.

greirson commented 1 week ago

you are using "image: ghcr.io/hoarder-app/hoarder-web:0.18.0", whereas the docker-compose you linked, contains "image: ghcr.io/hoarder-app/hoarder:${HOARDER_VERSION:-release}" (hoarder-web vs hoarder). This container does not migrate the database (the worker does AFAIK), so you have an inconsistent state.

@kamtschatka Thank you... I updated, and nothing would crawl. Was loosing my mind, turns out copy and pasting correctly is important :)