Archivebox: Bugfix: docker oneshot doesn't appear to be working

Created on 24 Sep 2020  路  5Comments  路  Source: ArchiveBox/ArchiveBox

Describe the bug

When using docker, oneshot seems broken.

Steps to reproduce

Open the container CLI, run archivebox oneshot "http://website", or run it using docker-compose run archivebox oneshot ... and it outputs:

    ! Failed to archive link: TypeError: __init__() missing 4 required positional arguments: 'timestamp', 'url', 'title', and 'tags'
Traceback (most recent call last):
  File "/usr/local/bin/archivebox", line 33, in <module>
    sys.exit(load_entry_point('archivebox', 'console_scripts', 'archivebox')())
  File "/app/archivebox/cli/__init__.py", line 122, in main
    run_subcommand(
  File "/app/archivebox/cli/__init__.py", line 62, in run_subcommand
    module.main(args=subcommand_args, stdin=stdin, pwd=pwd)    # type: ignore
  File "/app/archivebox/cli/archivebox_oneshot.py", line 55, in main
    oneshot(
  File "/app/archivebox/util.py", line 112, in typechecked_function
    return func(*args, **kwargs)
  File "/app/archivebox/main.py", line 506, in oneshot
    archive_link(oneshot_link[0], out_dir=out_dir, methods=methods, skip_index=True)
  File "/app/archivebox/util.py", line 112, in typechecked_function
    return func(*args, **kwargs)
  File "/app/archivebox/extractors/__init__.py", line 82, in archive_link
    link = load_link_details(link, out_dir=out_dir)
  File "/app/archivebox/util.py", line 112, in typechecked_function
    return func(*args, **kwargs)
  File "/app/archivebox/index/__init__.py", line 363, in load_link_details
    existing_link = parse_json_link_details(out_dir)
  File "/app/archivebox/util.py", line 112, in typechecked_function
    return func(*args, **kwargs)
  File "/app/archivebox/index/json.py", line 111, in parse_json_link_details
    return Link.from_json(link_json, guess)
  File "/app/archivebox/index/schema.py", line 234, in from_json
    return cls(**info)
TypeError: __init__() missing 4 required positional arguments: 'timestamp', 'url', 'title', and 'tags'

Software versions

ArchiveBox v0.4.21 using the latest docker-compose.yml

bug

All 5 comments

Yes. It seems like it is not working as expected. I will fix it asap.

@poblabs I created a PR that should help with the command. Things to note:

  • The oneshot command should be ran in an empty folder, or it will try to download the archive in the current folder
  • You can use the --out-dir option to better manage where to send the output of the command

Thanks! I downloaded your branch with the fix to test it, but docker isn't building. I'll keep trying it

Oh, master is not working at the moment. https://github.com/pirate/ArchiveBox/pull/482 after this PR is merged, I will rebase and it should start working again.

@poblabs please check again with master. The fix has been merged and should work properly now. Let me know if it still fails to reopen this.

Was this page helpful?
0 / 5 - 0 ratings