-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bugfix: sqlite3.IntegrityError: NOT NULL constraint failed: core_archiveresult.cmd_version and .output #597
Comments
@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. |
I'm getting the same error, migrating from 0.4.21 to 0.5.3, using a PyPi install rather than Docker:
|
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. |
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 @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. |
@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. |
Fixed in this commit: a3008c8, |
I am experiencing what seems to be this same issue when running the newly-released v0.5.4 using
Output of
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? |
Different issue, but related, I can fix it. Can you post one of your |
Here is one with user/drive snipped out:
Here is another:
Let me know if you need any more, and much appreciated! |
That's perfect thanks, this is what I was looking for (invalid/empty/badly-parsed fields): {
"cmd": [],
"cmd_version": "Undefined",
"end_ts": "2019-03-21T16:38:45",
"output": null,
"pwd": "/SNIP/.archivebox-output/archive-working/archive/1553186325",
"schema": "ArchiveResult",
"start_ts": "2019-03-21T16:38:45",
"status": "skipped"
} It's fixed now in docker build -t archivebox:dev https://github.com/ArchiveBox/ArchiveBox.git#dev
docker run -v $PWD:/data archivebox:dev ... Let me know if that fix works ^ |
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:
|
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: try:
ArchiveResult.objects.create(
extractor=extractor,
snapshot=snapshot,
pwd=result["pwd"],
cmd=result.get("cmd") or [],
cmd_version=result.get("cmd_version") or 'unknown',
start_ts=result["start_ts"],
end_ts=result["end_ts"],
status=result["status"],
output=result.get("output") or 'null',
)
except Exception as e:
print(
' ! Skipping import due to missing/invalid index.json:',
out_dir,
e,
'(open an issue with this index.json for help)', If you see any failed links |
Pulled dev, built, and ran init. No errors thrown, and successful! I tested with |
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. |
Describe the bug
Cannot start archivebox after moving from
nikisweeting/archivebox
toarchivebox/archivebox
. Django/Sqlite error ensues.Steps to reproduce
Might be related to #596 ? I killed my docker container running
nikisweeting/archivebox:latest
and tried recreating a container witharchivebox/archivebox:latest
, linking to the same old volume. I did prepend the server command witharchivebox init
in 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
The text was updated successfully, but these errors were encountered: