[GH-ISSUE #719] Bug: Server Error (500) #1966

Closed
opened 2026-03-01 17:55:23 +03:00 by kerem · 6 comments
Owner

Originally created by @Ruthalas on GitHub (Apr 21, 2021).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/719

Describe the bug

(After update) navigating to the webUI shows "Server Error (500)"

Steps to reproduce

  • Use docker version (nikisweeting/archivebox:latest)
  • Update to v0.6.2
  • Navigate to webUI

Screenshots or log output

image

Some selected portions of the log that might be relevant:

12 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): core.
'python manage.py migrate' to apply them.
, 2021 - 19:58:06
ersion 3.1.8, using settings 'core.settings'
development server at http://0.0.0.0:8000/
server with CONTROL-C.
min/login/ HTTP/1.1" 200 11144
min/login/ HTTP/1.1" 200 11144
TTP/1.1" 302 0
blic HTTP/1.1" 301 0
Server Error: /public/
k (most recent call last):
sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
elf.cursor.execute(sql, params)
sr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 413, in execute
atabase.Cursor.execute(self, query, params)
OperationalError: no such column: core_archiveresult.uuid

e exception was the direct cause of the following exception:

k (most recent call last):
sr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
= get_response(request)
sr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 204, in _get_response
= response.render()
sr/local/lib/python3.9/site-packages/django/template/response.py", line 105, in render
tent = self.rendered_content
sr/local/lib/python3.9/site-packages/django/template/response.py", line 83, in rendered_content
emplate.render(context, self._request)
sr/local/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
elf.template.render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 170, in render
elf._render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render
elf.nodelist.render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
de.render_annotated(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
elf.render(context)
sr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 150, in render
ompiled_parent._render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render
elf.nodelist.render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
de.render_annotated(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
elf.render(context)
sr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 62, in render
block.nodelist.render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
de.render_annotated(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
elf.render(context)
sr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 211, in render
.append(node.render_annotated(context))
sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
elf.render(context)
sr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 192, in render
emplate.render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 172, in render
elf._render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render
elf.nodelist.render(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
de.render_annotated(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
elf.render(context)
sr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 305, in render
condition.eval(context)
sr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 889, in eval
elf.value.resolve(context, ignore_failures=True)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 671, in resolve
lf.var.resolve(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 796, in resolve
self._resolve_lookup(context)
sr/local/lib/python3.9/site-packages/django/template/base.py", line 858, in _resolve_lookup
= current()
pp/archivebox/core/models.py", line 139, in icons
napshot_icons(self)
pp/archivebox/index/html.py", line 190, in snapshot_icons
ache.get_or_set(cache_key, calc_snapshot_icons)
sr/local/lib/python3.9/site-packages/django/core/cache/backends/base.py", line 171, in get_or_set
= default()
pp/archivebox/index/html.py", line 149, in calc_snapshot_icons
lt in archive_results:
sr/local/lib/python3.9/site-packages/django/db/models/query.py", line 287, in __iter__
tch_all()
sr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1308, in _fetch_all
sult_cache = list(self._iterable_class(self))
sr/local/lib/python3.9/site-packages/django/db/models/query.py", line 53, in __iter__
= compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
sr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1156, in execute_sql
xecute(sql, params)
sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
elf._execute_with_wrappers(sql, params, many=False, executor=self._execute)
sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
xecutor(sql, params, many, context)
sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
elf.cursor.execute(sql, params)
sr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
_exc_value.with_traceback(traceback) from exc_value
sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
elf.cursor.execute(sql, params)
sr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 413, in execute
atabase.Cursor.execute(self, query, params)
b.utils.OperationalError: no such column: core_archiveresult.uuid

ArchiveBox version

ArchiveBox v0.6.2
Cpython Linux Linux-5.10.28-Unraid-x86_64-with-glibc2.28 x86_64
IN_DOCKER=True DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND_ENGINE=ripgrep

[i] Dependency versions:
 √  ARCHIVEBOX_BINARY     v0.6.2          valid     /usr/local/bin/archivebox                                                   
 √  PYTHON_BINARY         v3.9.4          valid     /usr/local/bin/python3.9                                                    
 √  DJANGO_BINARY         v3.1.8          valid     /usr/local/lib/python3.9/site-packages/django/bin/django-admin.py           
 √  CURL_BINARY           v7.64.0         valid     /usr/bin/curl                                                               
 √  WGET_BINARY           v1.20.1         valid     /usr/bin/wget                                                               
 √  NODE_BINARY           v15.14.0        valid     /usr/bin/node                                                               
 √  SINGLEFILE_BINARY     v0.3.16         valid     /node/node_modules/single-file/cli/single-file                              
 √  READABILITY_BINARY    v0.0.2          valid     /node/node_modules/readability-extractor/readability-extractor              
 √  MERCURY_BINARY        v1.0.0          valid     /node/node_modules/@postlight/mercury-parser/cli.js                         
 √  GIT_BINARY            v2.20.1         valid     /usr/bin/git                                                                
 √  YOUTUBEDL_BINARY      v2021.04.07     valid     /usr/local/bin/youtube-dl                                                   
 √  CHROME_BINARY         v89.0.4389.114  valid     /usr/bin/chromium                                                           
 √  RIPGREP_BINARY        v0.10.0         valid     /usr/bin/rg                                                                 

[i] Source-code locations:
 √  PACKAGE_DIR           23 files        valid     /app/archivebox                                                             
 √  TEMPLATES_DIR         3 files         valid     /app/archivebox/templates                                                   
 -  CUSTOM_TEMPLATES_DIR  -               disabled                                                                              

[i] Secrets locations:
 -  CHROME_USER_DATA_DIR  -               disabled                                                                              
 -  COOKIES_FILE          -               disabled                                                                              

[i] Data locations:
 √  OUTPUT_DIR            7 files         valid     /data                                                                       
 √  SOURCES_DIR           61 files        valid     ./sources                                                                   
 √  LOGS_DIR              1 files         valid     ./logs                                                                      
 √  ARCHIVE_DIR           98 files        valid     ./archive                                                                   
 √  CONFIG_FILE           81.0 Bytes      valid     ./ArchiveBox.conf                                                           
 √  SQL_INDEX             936.0 KB        valid     ./index.sqlite3   

Here is the errors.log.

(I did try to run the python manage.py migrate, but just got this: python: can't open file '/data/manage.py': [Errno 2] No such file or directory.)

Please let me know if there is more information I can provide. Thank you for your help!

Originally created by @Ruthalas on GitHub (Apr 21, 2021). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/719 #### Describe the bug (After update) navigating to the webUI shows "Server Error (500)" #### Steps to reproduce - Use docker version (nikisweeting/archivebox:latest) - Update to v0.6.2 - Navigate to webUI #### Screenshots or log output ![image](https://user-images.githubusercontent.com/27835519/115614387-31171300-a2dd-11eb-99b9-17c7503f034a.png) Some selected portions of the log that might be relevant: ```logs 12 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): core. 'python manage.py migrate' to apply them. , 2021 - 19:58:06 ersion 3.1.8, using settings 'core.settings' development server at http://0.0.0.0:8000/ server with CONTROL-C. min/login/ HTTP/1.1" 200 11144 min/login/ HTTP/1.1" 200 11144 TTP/1.1" 302 0 blic HTTP/1.1" 301 0 Server Error: /public/ k (most recent call last): sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute elf.cursor.execute(sql, params) sr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 413, in execute atabase.Cursor.execute(self, query, params) OperationalError: no such column: core_archiveresult.uuid e exception was the direct cause of the following exception: k (most recent call last): sr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner = get_response(request) sr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 204, in _get_response = response.render() sr/local/lib/python3.9/site-packages/django/template/response.py", line 105, in render tent = self.rendered_content sr/local/lib/python3.9/site-packages/django/template/response.py", line 83, in rendered_content emplate.render(context, self._request) sr/local/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render elf.template.render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 170, in render elf._render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render elf.nodelist.render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render de.render_annotated(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated elf.render(context) sr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 150, in render ompiled_parent._render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render elf.nodelist.render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render de.render_annotated(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated elf.render(context) sr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 62, in render block.nodelist.render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render de.render_annotated(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated elf.render(context) sr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 211, in render .append(node.render_annotated(context)) sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated elf.render(context) sr/local/lib/python3.9/site-packages/django/template/loader_tags.py", line 192, in render emplate.render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 172, in render elf._render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render elf.nodelist.render(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 938, in render de.render_annotated(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated elf.render(context) sr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 305, in render condition.eval(context) sr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 889, in eval elf.value.resolve(context, ignore_failures=True) sr/local/lib/python3.9/site-packages/django/template/base.py", line 671, in resolve lf.var.resolve(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 796, in resolve self._resolve_lookup(context) sr/local/lib/python3.9/site-packages/django/template/base.py", line 858, in _resolve_lookup = current() pp/archivebox/core/models.py", line 139, in icons napshot_icons(self) pp/archivebox/index/html.py", line 190, in snapshot_icons ache.get_or_set(cache_key, calc_snapshot_icons) sr/local/lib/python3.9/site-packages/django/core/cache/backends/base.py", line 171, in get_or_set = default() pp/archivebox/index/html.py", line 149, in calc_snapshot_icons lt in archive_results: sr/local/lib/python3.9/site-packages/django/db/models/query.py", line 287, in __iter__ tch_all() sr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1308, in _fetch_all sult_cache = list(self._iterable_class(self)) sr/local/lib/python3.9/site-packages/django/db/models/query.py", line 53, in __iter__ = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) sr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1156, in execute_sql xecute(sql, params) sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute elf._execute_with_wrappers(sql, params, many=False, executor=self._execute) sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers xecutor(sql, params, many, context) sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute elf.cursor.execute(sql, params) sr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__ _exc_value.with_traceback(traceback) from exc_value sr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute elf.cursor.execute(sql, params) sr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 413, in execute atabase.Cursor.execute(self, query, params) b.utils.OperationalError: no such column: core_archiveresult.uuid ``` #### ArchiveBox version ```logs ArchiveBox v0.6.2 Cpython Linux Linux-5.10.28-Unraid-x86_64-with-glibc2.28 x86_64 IN_DOCKER=True DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND_ENGINE=ripgrep [i] Dependency versions: √ ARCHIVEBOX_BINARY v0.6.2 valid /usr/local/bin/archivebox √ PYTHON_BINARY v3.9.4 valid /usr/local/bin/python3.9 √ DJANGO_BINARY v3.1.8 valid /usr/local/lib/python3.9/site-packages/django/bin/django-admin.py √ CURL_BINARY v7.64.0 valid /usr/bin/curl √ WGET_BINARY v1.20.1 valid /usr/bin/wget √ NODE_BINARY v15.14.0 valid /usr/bin/node √ SINGLEFILE_BINARY v0.3.16 valid /node/node_modules/single-file/cli/single-file √ READABILITY_BINARY v0.0.2 valid /node/node_modules/readability-extractor/readability-extractor √ MERCURY_BINARY v1.0.0 valid /node/node_modules/@postlight/mercury-parser/cli.js √ GIT_BINARY v2.20.1 valid /usr/bin/git √ YOUTUBEDL_BINARY v2021.04.07 valid /usr/local/bin/youtube-dl √ CHROME_BINARY v89.0.4389.114 valid /usr/bin/chromium √ RIPGREP_BINARY v0.10.0 valid /usr/bin/rg [i] Source-code locations: √ PACKAGE_DIR 23 files valid /app/archivebox √ TEMPLATES_DIR 3 files valid /app/archivebox/templates - CUSTOM_TEMPLATES_DIR - disabled [i] Secrets locations: - CHROME_USER_DATA_DIR - disabled - COOKIES_FILE - disabled [i] Data locations: √ OUTPUT_DIR 7 files valid /data √ SOURCES_DIR 61 files valid ./sources √ LOGS_DIR 1 files valid ./logs √ ARCHIVE_DIR 98 files valid ./archive √ CONFIG_FILE 81.0 Bytes valid ./ArchiveBox.conf √ SQL_INDEX 936.0 KB valid ./index.sqlite3 ``` Here is the [errors.log](https://github.com/ArchiveBox/ArchiveBox/files/6354009/errors.log). (I did try to run the `python manage.py migrate`, but just got this: `python: can't open file '/data/manage.py': [Errno 2] No such file or directory`.) Please let me know if there is more information I can provide. Thank you for your help!
kerem closed this issue 2026-03-01 17:55:23 +03:00
Author
Owner

@pirate commented on GitHub (Apr 21, 2021):

Run archivebox init.

<!-- gh-comment-id:824368505 --> @pirate commented on GitHub (Apr 21, 2021): Run `archivebox init`.
Author
Owner

@Ruthalas commented on GitHub (Apr 21, 2021):

root@dockerID:/data# archivebox init
[i] [2021-04-21 21:47:51] ArchiveBox v0.6.2: archivebox init
    > /data

[!] ArchiveBox should never be run as root!
    For more information, see the security overview documentation:
        https://github.com/ArchiveBox/ArchiveBox/wiki/Security-Overview#do-not-run-as-root
root@dockerID:/data# 

I do not know how to 'de-elevate' my terminal to run the command as another user.
Initial research shows ways to add users to the container- should I pursue that?
(I am running the docker container in unRAID, for context.)

Edit: I am reading the documentation linked in the error.
I will try the steps shown there to make the user.
I am not sure why this would be needed after updating the docker container, but it seems like the correct solution.

Edit: The archivebox user already exists, which is good, but I have not yet determined how to run the init as that user.

root@dockerID:/# sudo -u archivebox init
bash: sudo: command not found
<!-- gh-comment-id:824382252 --> @Ruthalas commented on GitHub (Apr 21, 2021): ``` root@dockerID:/data# archivebox init [i] [2021-04-21 21:47:51] ArchiveBox v0.6.2: archivebox init > /data [!] ArchiveBox should never be run as root! For more information, see the security overview documentation: https://github.com/ArchiveBox/ArchiveBox/wiki/Security-Overview#do-not-run-as-root root@dockerID:/data# ```` I do not know how to 'de-elevate' my terminal to run the command as another user. Initial research shows ways to add users to the container- should I pursue that? (I am running the docker container in unRAID, for context.) Edit: I am reading the documentation linked in the error. I will try the steps shown there to make the user. I am not sure why this would be needed after updating the docker container, but it seems like the correct solution. Edit: The archivebox user already exists, which is good, but I have not yet determined how to run the init as that user. ``` root@dockerID:/# sudo -u archivebox init bash: sudo: command not found ```
Author
Owner

@pirate commented on GitHub (Apr 21, 2021):

Run it however you would run other archivebox commands like archivebox add, or however you ran the very first archivebox init when you initially started using it.

docker run -v $PWD:/data -it archivebox/archivebox init
docker-compose run --rm archivebox init

If you're trying to exec inside an existing container you need to login as the archivebox user. You can try su archivebox inside the container, but ideally use whatever mechanism you are using to gain a shell in the first place to do it as the archivebox user instead of root.

<!-- gh-comment-id:824387759 --> @pirate commented on GitHub (Apr 21, 2021): Run it however you would run other archivebox commands like `archivebox add`, or however you ran the very first `archivebox init` when you initially started using it. `docker run -v $PWD:/data -it archivebox/archivebox init` `docker-compose run --rm archivebox init` If you're trying to exec inside an existing container you need to login as the `archivebox` user. You can try `su archivebox` inside the container, but ideally use whatever mechanism you are using to gain a shell in the first place to do it as the `archivebox` user instead of root.
Author
Owner

@Ruthalas commented on GitHub (Apr 22, 2021):

I was able to achieve that via the following steps:

  1. Navigate to data folder: cd /data
  2. Change to archivebox user: su - archivebox
  3. Run init: archivebox init

Thank you for your prompt and detailed assistance!

<!-- gh-comment-id:824575935 --> @Ruthalas commented on GitHub (Apr 22, 2021): I was able to achieve that via the following steps: 1. Navigate to data folder: `cd /data` 2. Change to archivebox user: `su - archivebox` 3. Run init: `archivebox init` Thank you for your prompt and detailed assistance!
Author
Owner

@rsnitsch commented on GitHub (Aug 24, 2021):

I had the same problem. The main cause was "no such column: core_archiveresult.uuid" along with the warning "You have X unapplied migrations." In other words: The database scheme was changed and my pre-existing database from an earlier archivebox version needed an update.

I don't understand why archivebox init was recommended in this thread. It's supposed to initiate a new archivebox setup, not update a preexisting one. If it can do updates, too, then maybe the description for the init command should be updated.

Instead of running archivebox init, I used

docker-compose run archivebox manage migrate

This executes the database migrations only.

Addendum:
I just saw in the 0.6.2 changelog that the init command was enhanced recently: "add init --quick and server --quick-init options to quickly update the db version without doing a full re-init (for users with large archive collections this will make version upgrades a lot faster / less painful)"

I guess init --quick does the same as manage migrate.

<!-- gh-comment-id:904679047 --> @rsnitsch commented on GitHub (Aug 24, 2021): I had the same problem. The main cause was `"no such column: core_archiveresult.uuid"` along with the warning `"You have X unapplied migrations."` In other words: The database scheme was changed and my pre-existing database from an earlier archivebox version needed an update. I don't understand why `archivebox init` was recommended in this thread. It's supposed to initiate a new archivebox setup, not update a preexisting one. If it can do updates, too, then maybe the description for the `init` command should be updated. Instead of running `archivebox init`, I used docker-compose run archivebox manage migrate This executes the database migrations only. **Addendum:** I just saw in the 0.6.2 changelog that the init command was enhanced recently: _"add init --quick and server --quick-init options to quickly update the db version without doing a full re-init (for users with large archive collections this will make version upgrades a lot faster / less painful)"_ I guess `init --quick` does the same as `manage migrate`.
Author
Owner

@pirate commented on GitHub (Aug 25, 2021):

Do not run manage migrate, that is not for end users. init is indempotent and is used for both upgrading and initializing, you can run it as many times as you want safely within an archive. I don't recommend --quick-init as that won't do a full upgrade, it will only update the schéma without moving any files into new locations.

<!-- gh-comment-id:905113822 --> @pirate commented on GitHub (Aug 25, 2021): Do not run `manage migrate`, that is not for end users. `init` is indempotent and is used for both upgrading and initializing, you can run it as many times as you want safely within an archive. I don't recommend `--quick-init` as that won't do a full upgrade, it will only update the schéma without moving any files into new locations.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#1966
No description provided.