[GH-ISSUE #1391] Bug: AttributeError: 'PosixPath' object has no attribute 'split' / ImportError: attempted relative import beyond top-level package #3868

Closed
opened 2026-03-15 00:46:13 +03:00 by kerem · 7 comments
Owner

Originally created by @gerroon on GitHub (Mar 27, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1391

Hi

The Docker dev build is throwing an error which prevents it from starting the container. That is why I can't run the archivebox info command.

The version image: archivebox/archivebox runs fine.

aarchivebox_1  |     > /data
archivebox_1  |
archivebox_1  | [X] Could not find profile "Default" in CHROME_USER_DATA_DIR.
archivebox_1  |     /data/personas/Default/chromium
archivebox_1  |     Make sure you set it to a Chrome user data directory containing a Default profile folder.
archivebox_1  |     For more info see:
archivebox_1  |         https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration#CHROME_USER_DATA_DIR
archivebox_1  |
archivebox_1  |     Try removing /Default from the end e.g.:
archivebox_1  | Traceback (most recent call last):
archivebox_1  |   File "/usr/local/bin/archivebox", line 8, in <module>
archivebox_1  |     sys.exit(main())
archivebox_1  |              ^^^^^^
archivebox_1  |   File "/app/archivebox/cli/__init__.py", line 140, in main
archivebox_1  |     run_subcommand(
archivebox_1  |   File "/app/archivebox/cli/__init__.py", line 74, in run_subcommand
archivebox_1  |     setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending)
archivebox_1  |   File "/app/archivebox/config.py", line 1390, in setup_django
archivebox_1  |     check_system_config()
archivebox_1  |   File "/app/archivebox/config.py", line 1298, in check_system_config
archivebox_1  |     stderr('        CHROME_USER_DATA_DIR="{}"'.format(config['CHROME_USER_DATA_DIR'].split('/Default')[0]))
archivebox_1  |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
archivebox_1  | AttributeError: 'PosixPath' object has no attribute 'split'
archivebox_docker_archivebox_1 exited with code 1

Then I go ahead and define Chrome user dir however now it throws another type of error.

- CHROME_USER_DATA_DIR=/data/chrome

Attaching to archivebox_docker_archivebox_1, archivebox_docker_sonic_1
archivebox_1  | [i] [2024-03-27 19:01:23] ArchiveBox v0.7.3: archivebox server --quick-init 0.0.0.0:8000
archivebox_1  |     > /data
archivebox_1  |
archivebox_1  | Traceback (most recent call last):
archivebox_1  |   File "/usr/local/bin/archivebox", line 8, in <module>
archivebox_1  |     sys.exit(main())
archivebox_1  |              ^^^^^^
archivebox_1  |   File "/app/archivebox/cli/__init__.py", line 140, in main
archivebox_1  |     run_subcommand(
archivebox_1  |   File "/app/archivebox/cli/__init__.py", line 74, in run_subcommand
archivebox_1  |     setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending)
archivebox_1  |   File "/app/archivebox/config.py", line 1425, in setup_django
archivebox_1  |     django.setup()
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
archivebox_1  |     apps.populate(settings.INSTALLED_APPS)
archivebox_1  |   File "/usr/local/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate
archivebox_1  |     app_config.ready()
archivebox_1  |   File "/app/archivebox/core/apps.py", line 8, in ready
archivebox_1  |     from .auth import register_signals
archivebox_1  |   File "/app/archivebox/core/auth.py", line 3, in <module>
archivebox_1  |     from ..config import (
archivebox_1  | ImportError: attempted relative import beyond top-level package
archivebox_docker_archivebox_1 exited with code 1
archivebox_1  | [i] [2024-03-27 19:01:23] ArchiveBox v0.7.3: archivebox server --quick-init 0.0.0.0:8000
archivebox_1  |     > /data
archivebox_1  |
archivebox_1  | Traceback (most recent call last):
Originally created by @gerroon on GitHub (Mar 27, 2024). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1391 Hi The Docker dev build is throwing an error which prevents it from starting the container. That is why I can't run the archivebox info command. The version `image: archivebox/archivebox` runs fine. ``` aarchivebox_1 | > /data archivebox_1 | archivebox_1 | [X] Could not find profile "Default" in CHROME_USER_DATA_DIR. archivebox_1 | /data/personas/Default/chromium archivebox_1 | Make sure you set it to a Chrome user data directory containing a Default profile folder. archivebox_1 | For more info see: archivebox_1 | https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration#CHROME_USER_DATA_DIR archivebox_1 | archivebox_1 | Try removing /Default from the end e.g.: archivebox_1 | Traceback (most recent call last): archivebox_1 | File "/usr/local/bin/archivebox", line 8, in <module> archivebox_1 | sys.exit(main()) archivebox_1 | ^^^^^^ archivebox_1 | File "/app/archivebox/cli/__init__.py", line 140, in main archivebox_1 | run_subcommand( archivebox_1 | File "/app/archivebox/cli/__init__.py", line 74, in run_subcommand archivebox_1 | setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending) archivebox_1 | File "/app/archivebox/config.py", line 1390, in setup_django archivebox_1 | check_system_config() archivebox_1 | File "/app/archivebox/config.py", line 1298, in check_system_config archivebox_1 | stderr(' CHROME_USER_DATA_DIR="{}"'.format(config['CHROME_USER_DATA_DIR'].split('/Default')[0])) archivebox_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ archivebox_1 | AttributeError: 'PosixPath' object has no attribute 'split' archivebox_docker_archivebox_1 exited with code 1 ``` Then I go ahead and define Chrome user dir however now it throws another type of error. ` - CHROME_USER_DATA_DIR=/data/chrome` ``` Attaching to archivebox_docker_archivebox_1, archivebox_docker_sonic_1 archivebox_1 | [i] [2024-03-27 19:01:23] ArchiveBox v0.7.3: archivebox server --quick-init 0.0.0.0:8000 archivebox_1 | > /data archivebox_1 | archivebox_1 | Traceback (most recent call last): archivebox_1 | File "/usr/local/bin/archivebox", line 8, in <module> archivebox_1 | sys.exit(main()) archivebox_1 | ^^^^^^ archivebox_1 | File "/app/archivebox/cli/__init__.py", line 140, in main archivebox_1 | run_subcommand( archivebox_1 | File "/app/archivebox/cli/__init__.py", line 74, in run_subcommand archivebox_1 | setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending) archivebox_1 | File "/app/archivebox/config.py", line 1425, in setup_django archivebox_1 | django.setup() archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/__init__.py", line 24, in setup archivebox_1 | apps.populate(settings.INSTALLED_APPS) archivebox_1 | File "/usr/local/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate archivebox_1 | app_config.ready() archivebox_1 | File "/app/archivebox/core/apps.py", line 8, in ready archivebox_1 | from .auth import register_signals archivebox_1 | File "/app/archivebox/core/auth.py", line 3, in <module> archivebox_1 | from ..config import ( archivebox_1 | ImportError: attempted relative import beyond top-level package archivebox_docker_archivebox_1 exited with code 1 archivebox_1 | [i] [2024-03-27 19:01:23] ArchiveBox v0.7.3: archivebox server --quick-init 0.0.0.0:8000 archivebox_1 | > /data archivebox_1 | archivebox_1 | Traceback (most recent call last): ```
kerem closed this issue 2026-03-15 00:46:18 +03:00
Author
Owner

@Cinj216 commented on GitHub (Mar 27, 2024):

Same. Watchtower pulled latest last night and suddenly this container keeps dying with that error when it has been running for months with no issues with prior builds. I'm guessing now I'll have to go in and adjust some configuration to accommodate some change that was made for the sake of change. Many such cases!

<!-- gh-comment-id:2024039016 --> @Cinj216 commented on GitHub (Mar 27, 2024): Same. Watchtower pulled latest last night and suddenly this container keeps dying with that error when it has been running for months with no issues with prior builds. I'm guessing now I'll have to go in and adjust some configuration to accommodate some change that was made for the sake of change. Many such cases!
Author
Owner

@pirate commented on GitHub (Mar 28, 2024):

I assume ya'll were running on :dev? Beware :dev is unstable, if you need stability @Cinj216 you should use archivebox/archivebox:main or archivebox/archivebox:0.7.2 instead!

We just pushed a big pre-release last night, and not just for the sake of change, it's a big new security update with the latest Django 4.2 version that we've been working towards upgrading to for years. It'll make a lot of longstanding issues go away, and we'll be able to finally use some of the newer Django Admin UI features that people have been requesting for a long time.

This latest :dev push is exceptionally large, and is likely more unstable than any of our previous early alpha releases. I called this out in the pre-release notes as well: https://github.com/ArchiveBox/ArchiveBox/releases/tag/v0.8.0-rc

The fix for this particular issue should be up within the next few hours, but beware there will likely be other issues in this alpha, so switch back to stable unless you're actually intending to use the unstable branch.

<!-- gh-comment-id:2024326584 --> @pirate commented on GitHub (Mar 28, 2024): I assume ya'll were running on `:dev`? Beware `:dev` is unstable, if you need stability @Cinj216 you should use `archivebox/archivebox:main` or `archivebox/archivebox:0.7.2` instead! We just pushed a big pre-release last night, and not just for the sake of change, it's a big new security update with the latest Django 4.2 version that we've been working towards upgrading to for years. It'll make a lot of longstanding issues go away, and we'll be able to finally use some of the newer Django Admin UI features that people have been requesting for a long time. This latest `:dev` push is exceptionally large, and is likely more unstable than any of our previous early alpha releases. I called this out in the pre-release notes as well: https://github.com/ArchiveBox/ArchiveBox/releases/tag/v0.8.0-rc The fix for this particular issue should be up within the next few hours, but beware there will likely be other issues in this `alpha`, so switch back to stable unless you're actually intending to use the unstable branch.
Author
Owner

@gerroon commented on GitHub (Mar 28, 2024):

@pirate Thanks for the update. I am willingly using the dev build to test it while in use. I take daily backups so that is fine. I was just reporting the issue.

<!-- gh-comment-id:2024349726 --> @gerroon commented on GitHub (Mar 28, 2024): @pirate Thanks for the update. I am willingly using the dev build to test it while in use. I take daily backups so that is fine. I was just reporting the issue.
Author
Owner

@readtedium commented on GitHub (Mar 28, 2024):

I tried downgrading to stable as suggested and am still running into the issue. (I should note that some self-hosted application repositories are shipping with the dev version, which might be why this is coming up.)

EDIT: I ultimately fixed it by removing the CHROME_USER_DATA_DIR from my Docker-compose file, which forced a rebuild.

<!-- gh-comment-id:2025550503 --> @readtedium commented on GitHub (Mar 28, 2024): I tried downgrading to stable as suggested and am still running into the issue. (I should note that some self-hosted application repositories are shipping with the dev version, which might be why this is coming up.) EDIT: I ultimately fixed it by removing the `CHROME_USER_DATA_DIR` from my Docker-compose file, which forced a rebuild.
Author
Owner

@blastrock commented on GitHub (Mar 31, 2024):

Hello,

Facing the same issue here, maybe the docker-compose example should be updated to use main insead: github.com/ArchiveBox/ArchiveBox@1d49bee90b/docker-compose.yml (L16)

I didn't even know I was using an unstable version (though I should have checked ^^)

<!-- gh-comment-id:2028801903 --> @blastrock commented on GitHub (Mar 31, 2024): Hello, Facing the same issue here, maybe the docker-compose example should be updated to use main insead: https://github.com/ArchiveBox/ArchiveBox/blob/1d49bee90bcf6a0b04905266f3e7e73306ed6f9c/docker-compose.yml#L16 I didn't even know I was using an unstable version (though I should have checked ^^)
Author
Owner

@jimwins commented on GitHub (Apr 6, 2024):

I mentioned this elsewhere, but it's this commit that needs to be brought into the dev branch to fix the relative import problem.

<!-- gh-comment-id:2041182408 --> @jimwins commented on GitHub (Apr 6, 2024): I mentioned this elsewhere, but it's [this commit](https://github.com/ArchiveBox/ArchiveBox/pull/1327/commits/eaa4a9c5ea14d1fc11740af460e9e9a1135babd0) that needs to be brought into the dev branch to fix the relative import problem.
Author
Owner

@pirate commented on GitHub (Apr 10, 2024):

Ah whoops that was caused by a bad merge into main by accident. I just fixed the broken Docker tags: :stable, :main, :0.7, and :0.7.2 should now point to the working previous release again. Sorry for breaking those!

I will also have this fix and a fix for the CHROME_USER_DATA_DIR error merged into dev before v0.8.0 is released.

<!-- gh-comment-id:2046477621 --> @pirate commented on GitHub (Apr 10, 2024): Ah whoops that was caused by a bad merge into `main` by accident. I just fixed the broken [Docker tags](https://hub.docker.com/r/archivebox/archivebox/tags): `:stable`, `:main`, `:0.7`, and `:0.7.2` should now point to the working previous release again. Sorry for breaking those! I will also have [this fix](https://github.com/ArchiveBox/ArchiveBox/pull/1327/commits/eaa4a9c5ea14d1fc11740af460e9e9a1135babd0) and a fix for the [`CHROME_USER_DATA_DIR`](https://github.com/ArchiveBox/ArchiveBox/issues/1425) error merged into `dev` before v0.8.0 is released.
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#3868
No description provided.