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

How to delete a task? #716

Open
dinnouti opened this issue Dec 4, 2024 · 2 comments
Open

How to delete a task? #716

dinnouti opened this issue Dec 4, 2024 · 2 comments
Labels
question Further information is requested

Comments

@dinnouti
Copy link

dinnouti commented Dec 4, 2024

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)
@Tukks
Copy link

Tukks commented 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,
        });
      }
    }),

@MohamedBassem
Copy link
Collaborator

@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?

@MohamedBassem MohamedBassem added the question Further information is requested label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants