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

Importer fails on second bookmark #166

Closed
SkaryMonk opened this issue Mar 1, 2020 · 7 comments
Closed

Importer fails on second bookmark #166

SkaryMonk opened this issue Mar 1, 2020 · 7 comments
Assignees
Labels
bookmark Issues relating to bookmarks bug Something isn't working critical Critical issue
Milestone

Comments

@SkaryMonk
Copy link

When importing my ComicDB.xml from ComicRack, the import fails when trying to create the second bookmark because of a key violation.
Error Message:

Unique index or primary key violation: "CONSTRAINT_DE_INDEX_9 ON PUBLIC.USER_BOOKMARKS(BOOK) VALUES (102, 102)"; SQL statement: insert into user_bookmarks (id, book, mark, user_id) values (null, ?, ?, ?) [23505-197]

To Reproduce
Steps to reproduce the behavior:

  1. Try importing a ComicDB.xml with --user specified.
  2. Wait for it to fail
  3. See error

Expected behavior
The import should correctly do the bookmark IDs and finish the import.

Desktop (please complete the following information):

  • ComiXed version: 0.6.0-0
  • OS: Windows 10
  • Browser name: Firefox
  • Browser version: 73.0

** ComiXed Build Detail **
Source Branch | develop
Build Hostname | Pickled-Punk
Built On | Feb 27, 2020, 3:57:13 PM
Version | 0.6.0-0
Commit Hash | bf39671
Committer Name | Darryl L. Pierce (mcpierce@users.noreply.github.com)
Time Of Last Commit | Feb 24, 2020, 12:35:52 AM
Commit Message | [Issue #108] Add an option to override the image cache directory. (#146)
Built From Uncommitted Code? | false
Remote Origin | https://github.com/comixed/comixed.git

@mcpierce
Copy link
Contributor

mcpierce commented Mar 1, 2020

I think I see what the issue is there: the user_bookmarks table has a uniqueness constraint on the book column. I think that's a mistake in intent: there should be a uniqueness constraint for a user and a book and not for just a book.

@mcpierce mcpierce added this to the 0.6 milestone Mar 1, 2020
@mcpierce mcpierce added bookmark Issues relating to bookmarks bug Something isn't working critical Critical issue labels Mar 1, 2020
@mcpierce mcpierce modified the milestones: 0.6, 0.5.1 Mar 1, 2020
@mcpierce mcpierce self-assigned this Mar 1, 2020
@mcpierce
Copy link
Contributor

mcpierce commented Mar 1, 2020

@SkaryMonk I'm pushing a change for this. Would you mind testing it and seeing if it solves the problem for you? If so, please respond here and close the ticket.

I'm going to backport this change to a 0.5.1 release so that users of the current release can also benefit from the fix if it works.

mcpierce added a commit to mcpierce/comixed that referenced this issue Mar 1, 2020
mcpierce added a commit to mcpierce/comixed that referenced this issue Mar 1, 2020
mcpierce added a commit to mcpierce/comixed that referenced this issue Mar 1, 2020
mcpierce added a commit to mcpierce/comixed that referenced this issue Mar 1, 2020
mcpierce added a commit to mcpierce/comixed that referenced this issue Mar 1, 2020
@SkaryMonk
Copy link
Author

That was exactly it! Or if it wasn't, your commits still fixed it. :)

@SkaryMonk SkaryMonk reopened this Mar 2, 2020
@SkaryMonk
Copy link
Author

Wait, it might be worth noting that I am now getting a lot of
WARN 13532 --- [ Jarvis-ComiXed] o.h.h.internal.ast.QueryTranslatorImpl : HHH000104: firstResult/maxResults specified with collection fetch; applying in memory!
after building with these updates.

@SkaryMonk
Copy link
Author

I accidentally specified a non-existing user for the successful import. It seems the issue persists when I use an existing user. :(

@mcpierce
Copy link
Contributor

mcpierce commented Mar 2, 2020

@SkaryMonk That output in the logs i normal and isn't related to the issue you reported. Also, I just realized that you never actually got the code: since it's in a PR it doesn't get automatically included in a build. I'm going to go ahead and promote the PR and the next build will have the fix in it. Then please test it and, if it works, close this ticket.

mcpierce added a commit that referenced this issue Mar 2, 2020
#167)

* [Issue #166] Remove uniqueness constraint from book column.

* [Issue #166] Refactor the Bookmark model.
mcpierce added a commit that referenced this issue Mar 6, 2020
#167)

* [Issue #166] Remove uniqueness constraint from book column.

* [Issue #166] Refactor the Bookmark model.
@mcpierce
Copy link
Contributor

mcpierce commented Mar 7, 2020

Closing this as fixed.

@SkaryMonk if you see the error pop up again please feel free to respond on this issue.

@mcpierce mcpierce closed this as completed Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookmark Issues relating to bookmarks bug Something isn't working critical Critical issue
Projects
None yet
Development

No branches or pull requests

2 participants