[GH-ISSUE #716] How to delete a task? #464

Open
opened 2026-03-02 11:50:06 +03:00 by kerem · 3 comments
Owner

Originally created by @dinnouti on GitHub (Dec 4, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/716

I have a task getting stuck and crashing Hoarder. Is there a documentation (newbie level) in how to delete a stuck task? Or unstuck the task? Any guidance is welcome.

Just as FYI, the message log:

web-1         |2024-12-04T15:36:13.639Z info: [search][2502] Attempting to index bookmark with id jd8kjzygyolynqg656k0nfkh ...
meilisearch-1 |2024-12-04T15:36:13.651268Z  INFO HTTP request{method=POST host="meilisearch:7700" route=/indexes/bookmarks/documents query_parameters=primaryKey=id user_agent=node status_code=202}: meilisearch: close time.busy=353µs time.idle=2.33ms
web-1         |2024-12-04T15:36:13.663Z info: [Crawler][508] Finished capturing page content and a screenshot. FullPageScreenshot: false
meilisearch-1 |2024-12-04T15:36:13.667029Z  INFO HTTP request{method=GET host="meilisearch:7700" route=/tasks/1888 query_parameters= user_agent=node status_code=200}: meilisearch: close time.busy=161µs time.idle=151µs
web-1         |2024-12-04T15:36:13.686Z info: [Crawler][508] Will attempt to extract metadata from page ...
meilisearch-1 |2024-12-04T15:36:14.190332Z  INFO index_scheduler::batch: document indexing done indexing_result=DocumentAdditionResult { indexed_documents: 1, number_of_documents: 617 } processed_in=538.899159ms
meilisearch-1 |2024-12-04T15:36:14.194805Z  INFO index_scheduler: A batch of tasks was successfully completed with 1 successful tasks and 0 failed tasks.
web-1         |2024-12-04T15:36:15.300Z info: [Crawler][508] Will attempt to extract readable content ...
web-1         |Error: Could not parse CSS stylesheet
web-1         |    at exports.createStylesheet (/app/apps/workers/node_modules/.pnpm/jsdom@24.0.0/node_modules/jsdom/lib/jsdom/living/helpers/stylesheets.js:37:21)
web-1         |    at HTMLStyleElementImpl._updateAStyleBlock (/app/apps/workers/node_modules/.pnpm/jsdom@24.0.0/node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js:68:5)
web-1         |    at HTMLStyleElementImpl._poppedOffStackOfOpenElements (/app/apps/workers/node_modules/.pnpm/jsdom@24.0.0/node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js:42:10)
web-1         |    at JSDOMParse5Adapter.onItemPop (/app/apps/workers/node_modules/.pnpm/jsdom@24.0.0/node_modules/jsdom/lib/jsdom/browser/parser/html.js:175:43)
web-1         |    at Parser.onItemPop (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/index.js:158:90)
web-1         |    at OpenElementStack.pop (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/open-element-stack.js:89:22)
web-1         |    at endTagInText (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/index.js:2287:20)
web-1         |    at Parser._endTagOutsideForeignContent (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/index.js:931:17)
web-1         |    at Parser.onEndTag (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/index.js:897:18)
Originally created by @dinnouti on GitHub (Dec 4, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/716 I have a task getting stuck and crashing Hoarder. Is there a documentation (newbie level) in how to delete a stuck task? Or unstuck the task? Any guidance is welcome. Just as FYI, the message log: ``` web-1 |2024-12-04T15:36:13.639Z info: [search][2502] Attempting to index bookmark with id jd8kjzygyolynqg656k0nfkh ... meilisearch-1 |2024-12-04T15:36:13.651268Z INFO HTTP request{method=POST host="meilisearch:7700" route=/indexes/bookmarks/documents query_parameters=primaryKey=id user_agent=node status_code=202}: meilisearch: close time.busy=353µs time.idle=2.33ms web-1 |2024-12-04T15:36:13.663Z info: [Crawler][508] Finished capturing page content and a screenshot. FullPageScreenshot: false meilisearch-1 |2024-12-04T15:36:13.667029Z INFO HTTP request{method=GET host="meilisearch:7700" route=/tasks/1888 query_parameters= user_agent=node status_code=200}: meilisearch: close time.busy=161µs time.idle=151µs web-1 |2024-12-04T15:36:13.686Z info: [Crawler][508] Will attempt to extract metadata from page ... meilisearch-1 |2024-12-04T15:36:14.190332Z INFO index_scheduler::batch: document indexing done indexing_result=DocumentAdditionResult { indexed_documents: 1, number_of_documents: 617 } processed_in=538.899159ms meilisearch-1 |2024-12-04T15:36:14.194805Z INFO index_scheduler: A batch of tasks was successfully completed with 1 successful tasks and 0 failed tasks. web-1 |2024-12-04T15:36:15.300Z info: [Crawler][508] Will attempt to extract readable content ... web-1 |Error: Could not parse CSS stylesheet web-1 | at exports.createStylesheet (/app/apps/workers/node_modules/.pnpm/jsdom@24.0.0/node_modules/jsdom/lib/jsdom/living/helpers/stylesheets.js:37:21) web-1 | at HTMLStyleElementImpl._updateAStyleBlock (/app/apps/workers/node_modules/.pnpm/jsdom@24.0.0/node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js:68:5) web-1 | at HTMLStyleElementImpl._poppedOffStackOfOpenElements (/app/apps/workers/node_modules/.pnpm/jsdom@24.0.0/node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js:42:10) web-1 | at JSDOMParse5Adapter.onItemPop (/app/apps/workers/node_modules/.pnpm/jsdom@24.0.0/node_modules/jsdom/lib/jsdom/browser/parser/html.js:175:43) web-1 | at Parser.onItemPop (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/index.js:158:90) web-1 | at OpenElementStack.pop (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/open-element-stack.js:89:22) web-1 | at endTagInText (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/index.js:2287:20) web-1 | at Parser._endTagOutsideForeignContent (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/index.js:931:17) web-1 | at Parser.onEndTag (/app/apps/workers/node_modules/.pnpm/parse5@7.1.2/node_modules/parse5/dist/cjs/parser/index.js:897:18) ```
Author
Owner

@Tukks commented on GitHub (Dec 5, 2024):

Manually, you need to find the db.db file, it's a SqLite database, connect to it and remove the task from bookmarks table.
Here's the code to delete a bookmark in hoarder :

deleteBookmark: authedProcedure
    .input(z.object({ bookmarkId: z.string() }))
    .use(ensureBookmarkOwnership)
    .mutation(async ({ input, ctx }) => {
      const bookmark = await ctx.db.query.bookmarks.findFirst({
        where: and(
          eq(bookmarks.id, input.bookmarkId),
          eq(bookmarks.userId, ctx.user.id),
        ),
        with: {
          asset: true,
          link: true,
          assets: true,
        },
      });
      const deleted = await ctx.db
        .delete(bookmarks)
        .where(
          and(
            eq(bookmarks.userId, ctx.user.id),
            eq(bookmarks.id, input.bookmarkId),
          ),
        );
      await triggerSearchDeletion(input.bookmarkId);
      if (deleted.changes > 0 && bookmark) {
        await cleanupAssetForBookmark({
          asset: bookmark.asset,
          userId: ctx.user.id,
          assets: bookmark.assets,
        });
      }
    }),
<!-- gh-comment-id:2519716150 --> @Tukks commented on GitHub (Dec 5, 2024): Manually, you need to find the db.db file, it's a SqLite database, connect to it and remove the task from bookmarks table. Here's the code to delete a bookmark in hoarder : ```typescript deleteBookmark: authedProcedure .input(z.object({ bookmarkId: z.string() })) .use(ensureBookmarkOwnership) .mutation(async ({ input, ctx }) => { const bookmark = await ctx.db.query.bookmarks.findFirst({ where: and( eq(bookmarks.id, input.bookmarkId), eq(bookmarks.userId, ctx.user.id), ), with: { asset: true, link: true, assets: true, }, }); const deleted = await ctx.db .delete(bookmarks) .where( and( eq(bookmarks.userId, ctx.user.id), eq(bookmarks.id, input.bookmarkId), ), ); await triggerSearchDeletion(input.bookmarkId); if (deleted.changes > 0 && bookmark) { await cleanupAssetForBookmark({ asset: bookmark.asset, userId: ctx.user.id, assets: bookmark.assets, }); } }), ```
Author
Owner

@MohamedBassem commented on GitHub (Dec 9, 2024):

@dinnouti when you say crashing hoarder, what exactly do you mean. Does the worker itself crash or is it just logging errors in the container?

<!-- gh-comment-id:2526554516 --> @MohamedBassem commented on GitHub (Dec 9, 2024): @dinnouti when you say crashing hoarder, what exactly do you mean. Does the worker itself crash or is it just logging errors in the container?
Author
Owner

@dinnouti commented on GitHub (Dec 23, 2024):

Initially, I encountered difficulties accessing the website, it got suck in a blank page trying to load Hoarder. The root cause was insufficient memory on the container host. The issue has been resolved by upgrading the resources to 4GB of RAM and 2 CPUs.

<!-- gh-comment-id:2560322834 --> @dinnouti commented on GitHub (Dec 23, 2024): Initially, I encountered difficulties accessing the website, it got suck in a blank page trying to load Hoarder. The root cause was insufficient memory on the container host. The issue has been resolved by upgrading the resources to 4GB of RAM and 2 CPUs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#464
No description provided.