mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #597] Bugfix: sqlite3.IntegrityError: NOT NULL constraint failed: core_archiveresult.cmd_version and .output #3387
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#3387
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @coisnepe on GitHub (Jan 3, 2021).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/597
Describe the bug
Cannot start archivebox after moving from
nikisweeting/archiveboxtoarchivebox/archivebox. Django/Sqlite error ensues.Steps to reproduce
Might be related to #596 ? I killed my docker container running
nikisweeting/archivebox:latestand tried recreating a container witharchivebox/archivebox:latest, linking to the same old volume. I did prepend the server command witharchivebox initin order to run 3 new migrations. The container fails to start, issuing the following error.Looks like this is the migration that not going through, which might point at a corrupted/faulty json index file?
Screenshots or log output
Software versions
@pirate commented on GitHub (Jan 4, 2021):
@cdvv7788 can you make that field nullable, I suspected we might have some old archive users with no cmd versions in their detail json files.
@cdvv7788 commented on GitHub (Jan 4, 2021):
@pirate https://github.com/ArchiveBox/ArchiveBox/pull/599 I gave it a default. It should work unless there are
cmd_versionfields with explicit nulls.@hwangeug commented on GitHub (Jan 10, 2021):
I'm getting the same error, migrating from 0.4.21 to 0.5.3, using a PyPi install rather than Docker:
@coisnepe commented on GitHub (Jan 11, 2021):
I ended up stopping the container, downloaded the database off of my NAS, ran the migration manually in raw SQL, inserted the migration log, uploaded the DB and restarted the container.
@pirate commented on GitHub (Jan 11, 2021):
This is fixed in the next minor patch version v0.5.4 (not yet out). If you want it early you can build it by doing
git checkout dev; git pull; docker build . -t archivebox.@coisnepe while impressive, in the future I advise against running manual migrations like that, because it may be hard to install v0.5.4 without conflicting with your manual migration ;)
You may be able to figure out how to apply v0.5.4 without breaking anything, but if not just lemme know and I can probably help you apply v0.5.4 on top of your manual fix.
@coisnepe commented on GitHub (Jan 11, 2021):
@pirate yeah I figured it probably wasn't going to be the smartest way but I couldn't resist. Thank you so much for not holding it against me though! I'll give it a try and see how it goes.
@pirate commented on GitHub (Jan 12, 2021):
Fixed in this commit:
a3008c8189,it will be released in v0.5.4 shortlyit's now released in v0.5.4.@drpfenderson commented on GitHub (Feb 1, 2021):
I am experiencing what seems to be this same issue when running the newly-released v0.5.4 using
docker-compose. The archive I'm trying to upgrade is from v0.4.21.Output of
--version:I thought it might be old config or something possibly interfering, so I went through and removed any user directory cruft I could find, as well as
Did not fix it, same error. Anywhere else something might be hiding to interfere? Or possibly a different, unrelated problem?
@pirate commented on GitHub (Feb 1, 2021):
Different issue, but related, I can fix it. Can you post one of your
archive/<timestamp>/index.jsonfiles from the old version so I can check for any other null/missing fields.@drpfenderson commented on GitHub (Feb 1, 2021):
Here is one with user/drive snipped out:
Here is another:
Let me know if you need any more, and much appreciated!
@pirate commented on GitHub (Feb 1, 2021):
That's perfect thanks, this is what I was looking for (invalid/empty/badly-parsed fields):
It's fixed now in
dev0aea5ed:Let me know if that fix works ^
@drpfenderson commented on GitHub (Feb 1, 2021):
Built and ran using provided commands, different error:
As an aside, I did find a few files that had more null fields using the search term you provided briefly in an edit to your last comment, though I don't know if that's needed now. Just a snippet:
@pirate commented on GitHub (Feb 1, 2021):
Added another fix for that error, mind pulling/rebuilding from dev and trying again? @drpfenderson
The new change just skips invalid links and prints why they failed instead of breaking the entire migration:
If you see any failed links
! Skipping import due to missing/invalid index.jsonin the output just post a couple of thoseindex.jsonfiles only as a response here.@drpfenderson commented on GitHub (Feb 1, 2021):
Pulled dev, built, and ran init. No errors thrown, and successful! I tested with
docker-compose up -dand checking in browser. There are some weird things here and there, like main index showing 0 sources for a link, but navigating to a single link's index shows that it has all sources intact. But I'll file a separate bug report for that, as this issue is resolved! Thanks again @pirate and @cdvv7788 for the outstanding work and support.@pirate commented on GitHub (Apr 12, 2022):
Note I've added a new DB/filesystem troubleshooting area to the wiki that may help people arriving here from Google: https://github.com/ArchiveBox/ArchiveBox/wiki/Upgrading-or-Merging-Archives#database-troubleshooting
Contributions/suggestions welcome there.