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

Switching the category of a bookmark without a feature image causes internal error #145

Closed
printerboi opened this issue Oct 27, 2024 · 2 comments · Fixed by #156
Closed
Assignees
Labels
bug Something isn't working

Comments

@printerboi
Copy link

Describe the bug
If I add a bookmark to a page without a features image (e.g. https://valgrind.org/docs/manual/cg-manual.html), the adding of the bookmark works without problems. If I want to switch the category afterward, the application encounters an internal error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to root of grimore
  2. Click on 'add bookmark'
  3. Insert e.g. https://valgrind.org/docs/manual/cg-manual.html and leave uncategorized
  4. Edit the bookmark
  5. Switch category to something other than uncategorized
  6. Save
  7. See internal error

Expected behavior
The category switch should redirect back to the bookmarks list without causing an error and should change the category of the bookmark

Desktop (please complete the following information):

  • OS: Linux, Debian
  • Browser Firefox
  • Version 128.3.1esr

Additional context
The error log of the container running grimoire yielded the following error message:

Fetched metadata {
  url: "https://valgrind.org/docs/manual/cg-manual.html",
  domain: "valgrind.org",
  title: "Valgrind",
  description: "Official Home Page for valgrind, a suite of tools for debugging and profiling. Automatically detect memory management and threading bugs, and perform detailed profiling.  The current stable version is valgrind-3.23.0.",
  author: "",
  contentText: "5. Cachegrind: a high-precision tracing profiler\nTo use this tool, specify --tool=cachegrind on the ...",
  contentHtml: "<div>\n <td>\n  <div>\n5. Cachegrind: a high-precision tracing profiler\n<div>\n<p>\nTo use this tool, spe...",
  contentType: "",
  contentPublishedDate: null,
  mainImageUrl: "",
  iconUrl: "https://valgrind.org/favicon.ico",
}
61 |     return file;
62 |   }
63 |   async storeImage(url, title, ownerId, relatedEntityId) {
64 |     const storage = new Storage();
65 |     if (!url || url.length === 0) {
66 |       throw new Error("Invalid image URL");
                 ^
error: Invalid image URL
      at /app/build/server/chunks/storage.js:66:13
      at storeImage (/app/build/server/chunks/storage.js:63:20)
      at /app/build/server/entries/pages/_page.server.ts.js:127:47
61 |     return file;
62 |   }
63 |   async storeImage(url, title, ownerId, relatedEntityId) {
64 |     const storage = new Storage();
65 |     if (!url || url.length === 0) {
66 |       throw new Error("Invalid image URL");
                 ^
error: Invalid image URL
      at /app/build/server/chunks/storage.js:66:13
      at storeImage (/app/build/server/chunks/storage.js:63:20)
      at /app/build/server/entries/pages/_page.server.ts.js:127:47
61 |     return file;
62 |   }
63 |   async storeImage(url, title, ownerId, relatedEntityId) {
64 |     const storage = new Storage();
65 |     if (!url || url.length === 0) {
66 |       throw new Error("Invalid image URL");
                 ^
error: Invalid image URL
      at /app/build/server/chunks/storage.js:66:13
      at storeImage (/app/build/server/chunks/storage.js:63:20)
      at /app/build/server/entries/pages/_page.server.ts.js:127:47
63 |   async storeImage(url, title, ownerId, relatedEntityId) {
64 |     const storage = new Storage();
65 |     if (!url || url.length === 0) {
66 |       throw new Error("Invalid image URL");
67 |     }
68 |     const response = await fetch(url);
                                ^
TypeError: fetch() URL is invalid
 code: "ERR_INVALID_URL"
      at /app/build/server/chunks/storage.js:68:28
      at storeImage (/app/build/server/chunks/storage.js:63:20)
      at /app/build/server/entries/pages/_page.server.ts.js:127:47
@tucker19
Copy link

tucker19 commented Oct 31, 2024

I am also seeing this on Ubuntu/Docker. This is also an issue with Tags

@goniszewski goniszewski self-assigned this Nov 1, 2024
@goniszewski goniszewski added the bug Something isn't working label Nov 1, 2024
@breezyfasano
Copy link

breezyfasano commented Nov 20, 2024

Just wanted to report I'm also seeing this error, but it isn't just with bookmarks without images - it is all bookmarks. This is on a fresh install on Ubuntu with Docker as well

Edit: Want to include that the bookmarks with main images that are failing are also ones that do not include an icon. It may have something to do with the fact that the updateBookmark API endpoint calls storeImage which throws a new error if either of those do not exist.

goniszewski added a commit that referenced this issue Dec 9, 2024
* chore: release v0.4.3 (#149)

* chore: release v0.4.1-hotfix.3

* fix(data-migration): early return if no categories have parents (#128)

Signed-off-by: Robert Goniszewski <[email protected]>

* Closes #130 (#131)

Signed-off-by: Robert Goniszewski <[email protected]>

* fix(database): use dynamic path for SQLite database file

Signed-off-by: Robert Goniszewski <[email protected]>

* docs(readme): use single README file for latest/preview version

Signed-off-by: Robert Goniszewski <[email protected]>

* feat(ci): add manual deployment workflow and adjust tag conditions

Signed-off-by: Robert Goniszewski <[email protected]>

* refactor(workflow): simplify manual-deploy GitHub Action

Signed-off-by: Robert Goniszewski <[email protected]>

* fix(metadata): handle multiple image URLs in mainImageUrl field

Signed-off-by: Robert Goniszewski <[email protected]>

* fix: auth error handling (#144)

* refactor(api): migrate Swagger UI to external documentation and enhance health endpoint

Signed-off-by: Robert Goniszewski <[email protected]>

* chore: release v0.4.3

---------

Signed-off-by: Robert Goniszewski <[email protected]>
Co-authored-by: Prabhanjan <[email protected]>

* Fix bookmark creation/update without image

---------

Signed-off-by: Robert Goniszewski <[email protected]>
Co-authored-by: Robert Goniszewski <[email protected]>
Co-authored-by: Prabhanjan <[email protected]>
goniszewski added a commit that referenced this issue Dec 9, 2024
* chore: release v0.4.1-hotfix.3

* fix(data-migration): early return if no categories have parents (#128)

Signed-off-by: Robert Goniszewski <[email protected]>

* Closes #130 (#131)

Signed-off-by: Robert Goniszewski <[email protected]>

* fix(database): use dynamic path for SQLite database file

Signed-off-by: Robert Goniszewski <[email protected]>

* docs(readme): use single README file for latest/preview version

Signed-off-by: Robert Goniszewski <[email protected]>

* feat(ci): add manual deployment workflow and adjust tag conditions

Signed-off-by: Robert Goniszewski <[email protected]>

* refactor(workflow): simplify manual-deploy GitHub Action

Signed-off-by: Robert Goniszewski <[email protected]>

* fix(metadata): handle multiple image URLs in mainImageUrl field

Signed-off-by: Robert Goniszewski <[email protected]>

* fix: auth error handling (#144)

* refactor(api): migrate Swagger UI to external documentation and enhance health endpoint

Signed-off-by: Robert Goniszewski <[email protected]>

* chore: release v0.4.3

* fix(docker): resolve issue with data directory permissions (#150)

* Fix issue #153: creation/update of root categories (#157)

* chore: release v0.4.3 (#149)

* chore: release v0.4.1-hotfix.3

* fix(data-migration): early return if no categories have parents (#128)

Signed-off-by: Robert Goniszewski <[email protected]>

* Closes #130 (#131)

Signed-off-by: Robert Goniszewski <[email protected]>

* fix(database): use dynamic path for SQLite database file

Signed-off-by: Robert Goniszewski <[email protected]>

* docs(readme): use single README file for latest/preview version

Signed-off-by: Robert Goniszewski <[email protected]>

* feat(ci): add manual deployment workflow and adjust tag conditions

Signed-off-by: Robert Goniszewski <[email protected]>

* refactor(workflow): simplify manual-deploy GitHub Action

Signed-off-by: Robert Goniszewski <[email protected]>

* fix(metadata): handle multiple image URLs in mainImageUrl field

Signed-off-by: Robert Goniszewski <[email protected]>

* fix: auth error handling (#144)

* refactor(api): migrate Swagger UI to external documentation and enhance health endpoint

Signed-off-by: Robert Goniszewski <[email protected]>

* chore: release v0.4.3

---------

Signed-off-by: Robert Goniszewski <[email protected]>
Co-authored-by: Prabhanjan <[email protected]>

* Fix creation/update of root categories

---------

Signed-off-by: Robert Goniszewski <[email protected]>
Co-authored-by: Robert Goniszewski <[email protected]>
Co-authored-by: Prabhanjan <[email protected]>

* Fix issue #145: bookmarks without images (#156)

* chore: release v0.4.3 (#149)

* chore: release v0.4.1-hotfix.3

* fix(data-migration): early return if no categories have parents (#128)

Signed-off-by: Robert Goniszewski <[email protected]>

* Closes #130 (#131)

Signed-off-by: Robert Goniszewski <[email protected]>

* fix(database): use dynamic path for SQLite database file

Signed-off-by: Robert Goniszewski <[email protected]>

* docs(readme): use single README file for latest/preview version

Signed-off-by: Robert Goniszewski <[email protected]>

* feat(ci): add manual deployment workflow and adjust tag conditions

Signed-off-by: Robert Goniszewski <[email protected]>

* refactor(workflow): simplify manual-deploy GitHub Action

Signed-off-by: Robert Goniszewski <[email protected]>

* fix(metadata): handle multiple image URLs in mainImageUrl field

Signed-off-by: Robert Goniszewski <[email protected]>

* fix: auth error handling (#144)

* refactor(api): migrate Swagger UI to external documentation and enhance health endpoint

Signed-off-by: Robert Goniszewski <[email protected]>

* chore: release v0.4.3

---------

Signed-off-by: Robert Goniszewski <[email protected]>
Co-authored-by: Prabhanjan <[email protected]>

* Fix bookmark creation/update without image

---------

Signed-off-by: Robert Goniszewski <[email protected]>
Co-authored-by: Robert Goniszewski <[email protected]>
Co-authored-by: Prabhanjan <[email protected]>

* chore: release v0.4.4

---------

Signed-off-by: Robert Goniszewski <[email protected]>
Co-authored-by: Prabhanjan <[email protected]>
Co-authored-by: Guillaume Poussel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants