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
6.48k stars 235 forks source link

Bookmarks on Homepage not showing up #626

Closed DevGoran closed 1 week ago

DevGoran commented 2 weeks ago

Describe the Bug

Out of nowhere I saw the "Something went wrong" message in the "Home" tab. However, when clicking on the tags in the Tags page, it will show me the bookmarks accordingly.

Steps to Reproduce

Open hoarder

Expected Behaviour

Bookmarks show up in home tab.

Screenshots or Additional Context

Container Log shows following error:

s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
Running db migration script
s6-rc: info: service init-db-migration successfully started
s6-rc: info: service svc-workers: starting
s6-rc: info: service svc-web: starting
s6-rc: info: service svc-web successfully started
s6-rc: info: service svc-workers successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
  ▲ Next.js 14.2.13
  - Local:        http://localhost:3000
  - Network:      http://0.0.0.0:3000
 ✓ Starting...
> @hoarder/workers@0.1.0 start:prod /app/apps/workers
> tsx index.ts
 ✓ Ready in 2s
2024-11-07T09:03:58.989Z info: Workers version: 0.18.0
2024-11-07T09:03:59.059Z info: [Crawler] Connecting to existing browser instance: http://chrome:9222
(node:121) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
2024-11-07T09:03:59.083Z info: [Crawler] Successfully resolved IP address, new address: http://172.25.0.4:9222/
2024-11-07T09:03:59.674Z info: Starting crawler worker ...
2024-11-07T09:03:59.675Z info: Starting inference worker ...
2024-11-07T09:03:59.675Z info: Starting search indexing worker ...
2024-11-07T09:03:59.676Z info: Starting tidy assets worker ...
s [TRPCError]: Output validation failed
    at p (/app/apps/web/.next/server/chunks/105.js:4:32422)
    at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
    ... 4 lines matching cause stack trace ...
    at async u (/app/apps/web/.next/server/app/dashboard/bookmarks/page.js:1:5511) {
  code: 'INTERNAL_SERVER_ERROR',
  digest: '3286899713',
  [cause]: o [ZodError]: [
    {
      "validation": "url",
      "code": "invalid_string",
      "message": "Invalid url",
      "path": [
        "bookmarks",
        0,
        "content",
        "imageUrl"
      ]
    }
  ]
      at get error (/app/apps/web/.next/server/chunks/109.js:58:14318)
      at Q.parseAsync (/app/apps/web/.next/server/chunks/109.js:58:16801)
      at async p (/app/apps/web/.next/server/chunks/105.js:4:32371)
      at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
      at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
      at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
      at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
      at async p (/app/apps/web/.next/server/chunks/105.js:4:33299)
      at async u (/app/apps/web/.next/server/app/dashboard/bookmarks/page.js:1:5511) {
    issues: [ [Object] ],
    addIssue: [Function (anonymous)],
    addIssues: [Function (anonymous)],
    errors: [ [Object] ]
  }
}
s [TRPCError]: Output validation failed
    at p (/app/apps/web/.next/server/chunks/105.js:4:32422)
    at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
    ... 4 lines matching cause stack trace ...
    at async u (/app/apps/web/.next/server/app/dashboard/bookmarks/page.js:1:5511) {
  code: 'INTERNAL_SERVER_ERROR',
  digest: '3286899713',
  [cause]: o [ZodError]: [
    {
      "validation": "url",
      "code": "invalid_string",
      "message": "Invalid url",
      "path": [
        "bookmarks",
        0,
        "content",
        "imageUrl"
      ]
    }
  ]
      at get error (/app/apps/web/.next/server/chunks/109.js:58:14318)
      at Q.parseAsync (/app/apps/web/.next/server/chunks/109.js:58:16801)
      at async p (/app/apps/web/.next/server/chunks/105.js:4:32371)
      at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
      at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
      at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
      at async a (/app/apps/web/.next/server/chunks/105.js:4:32960)
      at async p (/app/apps/web/.next/server/chunks/105.js:4:33299)
      at async u (/app/apps/web/.next/server/app/dashboard/bookmarks/page.js:1:5511) {
    issues: [ [Object] ],
    addIssue: [Function (anonymous)],
    addIssues: [Function (anonymous)],
    errors: [ [Object] ]
  }
}

Compose:

version: "3.8"
services:
  web:
    image: ghcr.io/hoarder-app/hoarder:${HOARDER_VERSION:-release}
    restart: unless-stopped
    volumes:
      - data:/data
    ports:
      - 3232:3000
    env_file:
      - stack.env
    environment:
      MEILI_ADDR: http://meilisearch:7700
      BROWSER_WEB_URL: http://chrome:9222
      DATA_DIR: /data
    dns: ip

  chrome:
    image: gcr.io/zenika-hub/alpine-chrome:123
    restart: unless-stopped
    command:
      - --no-sandbox
      - --disable-gpu
      - --disable-dev-shm-usage
      - --remote-debugging-address=0.0.0.0
      - --remote-debugging-port=9222
      - --hide-scrollbars
  meilisearch:
    image: getmeili/meilisearch:v1.6
    restart: unless-stopped
    env_file:
      - stack.env
    environment:
      MEILI_NO_ANALYTICS: "true"
    volumes:
      - meilisearch:/meili_data

volumes:
  meilisearch:
  data:

Device Details

No response

Exact Hoarder Version

v0.18.0

MohamedBassem commented 2 weeks ago

Ok, so this is a bug. What happened is that one of the bookmarks you added has an invalid image url. The crawler stored this in the database, but the API is refusing to return it. So any UI that attempts to render this bookmark will fail. Other lists that don't have it will be fine.

Are you comfortable with using the CLI? We might have to remove this bookmark manually from the database to fix the issue (until I send a fix to Hoarder).

DevGoran commented 2 weeks ago

Yes I'm fine with using CLI. I would just need to know the commands to execute.

MohamedBassem commented 2 weeks ago

So you'll need to:

  1. Go to your data dir.
  2. Run 'sqlite3 db.db'
  3. Inside the sqlite3 shell, run 'select id, imageUrl from bookmarkLinks'. You should find some image url that doesn't look right or invalid.
  4. Get its id and run "delete from bookmarks where id=''".

Hopefully this should resolve it.

DevGoran commented 2 weeks ago

I'm unable to run the command inside the container, any advice?

/data # ls -la
total 2116
drwxr-xr-x    3 root     root          4096 Oct 31 12:54 .
drwxr-xr-x    1 root     root          4096 Oct 31 12:43 ..
drwxr-xr-x    3 root     root          4096 Oct 16 19:32 assets
-rw-r--r--    1 root     root       2105344 Oct 31 12:54 db.db
-rw-r--r--    1 root     root         45056 Oct 31 12:54 queue.db
/data # sqlite3 db.db
sh: sqlite3: not found
MohamedBassem commented 2 weeks ago

you'll need to install sqlite3 inside the container.

'apk add --no-cache sqlite'

DevGoran commented 2 weeks ago

Gotcha. These are the ones that are different to the others. As you see, 4 of those here don't have any URL and the last one does not point to a file (I think). Would you remove all of those?

bs2h2qy94x6gf22nmzp0ud19|
lmuvkurcrtsw134o2dnysclx|
rigpg1jk8ko8gri46lmlrl8w|
rwnamnphwxjk9afbjruyecnc|
h746t2i2as8knyt67wdld5n6|https://techcommunity.microsoft.com/t5/image/serverpage/image-id/121179i70E1255B17FD53B9/image-size/original?v=v2&px=-1

PS: the SQL command is missing a semicolon in the end. Maybe you can add it in case someone else faces this issue meanwhile. :)

MohamedBassem commented 2 weeks ago

hmmm, not having an image url is supposed to be ok. What do you mean by the last one not pointing to a file?

Can you go in the browser to

/dashboard/bookmarks/preview/\ and see which ones results in the same error?
DevGoran commented 2 weeks ago

What do you mean by the last one not pointing to a file?

Opening the URL of ID h746t2i2as8knyt67wdld5n6 gets me a Page Not Found Error

Can you go in the browser to

/dashboard/bookmarks/preview/ and see which ones results in the same error?

I get a not found error for any ID I tried (even some not listed above).

MohamedBassem commented 2 weeks ago

Ah sorry, it's

/dashboard/preview/ID

DevGoran commented 2 weeks ago

So this is the complete list of bookmarks currently:

sqlite> SELECT id, imageUrl FROM bookmarkLinks;
yd0tddiqb3ajwn66ih3lpnu6|https://www.ixsystems.com/documentation/freenas/11.2/_static/freenaslogo.png
sthwph0swginhtcvhv8s2nlx|https://cdn.sstatic.net/Sites/superuser/Img/apple-touch-icon@2.png?v=e869e4459439
e99v3vbya4wh2dyke32mdpcd|https://styles.redditmedia.com/t5_arli6b/styles/profileIcon_tsiqy41jvqjc1.jpeg?width=48&height=48&frame=1&auto=webp&crop=48:48,smart&s=4c78397cbdf88856f472fafa49527b267c67145d
clgljqd6y0654dswk2l9jkgj|http://answers.microsoft.com/static/images/icon_fb_answers3.png
h746t2i2as8knyt67wdld5n6|https://techcommunity.microsoft.com/t5/image/serverpage/image-id/121179i70E1255B17FD53B9/image-size/original?v=v2&px=-1
ecmnf7bp9dcwj2s19cf8mty8|https://packetpushers.net/wp-content/uploads/2024/01/BlogThumb.jpg
jkbviwmsn5ypigw3yb9zlx9v|https://cdn.sstatic.net/Sites/askubuntu/Img/apple-touch-icon@2.png?v=c492c9229955
k1rdlfjqksdf2oh2mtqw84br|https://community-assets.home-assistant.io/optimized/4X/6/a/4/6a4b31c4bc7a606500beb7171565308bdfbfb711_2_1024x512.png
w3i3acnz275wtj03zc1ea1qc|https://pureinfotech.com/wp-content/uploads/2023/06/windows-11-classic-context-menu-hero-mauro-huculak.webp
a4rbkebqc4jj7rmr3x5nygu3|https://global.discourse-cdn.com/plex/original/3X/b/f/bf4da7e4a0c1ed2fd6faf0decc0f3846e352c6fa.png
dhxmrpwo5av588jfldcfjsfq|https://styles.redditmedia.com/t5_2w844/styles/communityIcon_krq4riav5m191.png
bs2h2qy94x6gf22nmzp0ud19|
lmuvkurcrtsw134o2dnysclx|
rigpg1jk8ko8gri46lmlrl8w|
rwnamnphwxjk9afbjruyecnc|
ihh12anzi7otn6puegp7apd7|https://technotim.live/assets/img/headers/lightning-island.webp
ggej6xe48w190qlz8j11yv14|https://www.stationx.net/wp-content/uploads/2023/01/Og-Wireshark-Cheat-Sheet.jpg
xymtw2iuxodqeypieqnppvib|https://blog.victormendonca.com/img/zfs-cheat-sheet-for-dummies/zfs%20-components.png
ylnhigdihlwj2a0zdzbdb3nh|https://forum.proxmox.com/styles/uix/images/Proxmox-logo-stacked-white-background-1200.png
mxynajzq3rkekkxbagb0iqbl|https://community-assets.home-assistant.io/original/4X/5/0/e/50e585faea85010ebb16d3d466f071ef90ec1393.png
vbs5h3dydckhe6hfezvgyjd4|https://data%3Aimage/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%201024%201024%22%20style=%22background:%2362c4b1%22%3E%3Cg%3E%3Ctext%20text-anchor=%22middle%22%20dy=%22.35em%22%20x=%22512%22%20y=%22512%22%20fill=%22%23ffffff%22%20font-size=%22700%22%20font-family=%22-apple-system,%20BlinkMacSystemFont,%20Roboto,%20Helvetica,%20Arial,%20sans-serif%22%3ET%3C/text%3E%3C/g%3E%3C/svg%3E

h746t2i2as8knyt67wdld5n6 had some thumbnails in the preview page missing, which is why I attempted tor remove this one:

delete from bookmarks where id='h746t2i2as8knyt67wdld5n6';

However, when listing again the entries in the table, this bookmark appears again. Now, however, the preview shows not found.

MohamedBassem commented 1 week ago

Sorry for the late response. I've sent a fix to this issue. You can upgrade to nightly build to get your homepage back.

DevGoran commented 4 days ago

Sorry for the late response. I've sent a fix to this issue. You can upgrade to nightly build to get your homepage back.

No worries, what's the docker tag for the nightly build?

MohamedBassem commented 4 days ago

@DevGoran it's called latest

DevGoran commented 4 days ago

Works again, thanks!