Archivebox: TypeError on archive

Created on 21 Mar 2019  Â·  7Comments  Â·  Source: ArchiveBox/ArchiveBox

Describe the bug

I tried to save this relatively simple blog post, and got a TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'float' error

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to http://www.offconvex.org/2019/03/19/CURL/
  2. Attempt to archive it with echo "http://www.offconvex.org/2019/03/19/CURL/" | ./archive

Screenshots or log output

➜  ArchiveBox git:(master) echo "http://www.offconvex.org/2019/03/19/CURL/" | ./archive
[*] [2019-03-21 09:08:42] Parsing new links from output/sources/stdin-1553177320.txt...
    > Adding 1 new links to index (parsed import as Plain Text)
[*] [2019-03-21 09:08:42] Saving main index files...
    √ output/index.json
    √ output/index.html
[â–¶] [2019-03-21 09:08:42] Updating content for 3 pages in archive...
[+] [2019-03-21 09:08:42] "http://www.offconvex.org/2019/03/19/CURL/"
    http://www.offconvex.org/2019/03/19/CURL/
    > output/archive/1553177322 (new)
      > title
      > favicon
      > wget
      > pdf
      > screenshot
      > dom
      > media
      > archive_org
[*] [2019-03-21 09:09:08] "Activation Atlas"
    https://distill.pub/2019/activation-atlas/
    > output/archive/1552175337
[*] [2019-03-21 09:09:08] "Example Domain"
    https://example.com
    > output/archive/1552175279
Traceback (most recent call last):
  File "./archive", line 132, in <module>
    main(*sys.argv)
  File "./archive", line 93, in main
    update_archive_data(import_path=import_path, resume=resume)
  File "./archive", line 124, in update_archive_data
    log_archiving_finished(len(links))
  File "/Users/diegomesa/src/ArchiveBox/archivebox/logs.py", line 158, in log_archiving_finished
    seconds = end_ts - _LAST_RUN_STATS['start_ts'].timestamp()
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'float'

Software versions

(please complete the following information)

  • OS: macOS 10.14.,3
  • ArchiveBox version: git rev-parse HEAD | head -c7 : d798117
  • Python version: Python 3.6.8 :: Anaconda custom (64-bit)
  • Chrome version: Version 73.0.3683.75 (Official Build) (64-bit)

Most helpful comment

Yeah sorry about this, pushed a refactor too fast last night without testing thoroughly. I'll have this fixed today.

All 7 comments

Yeah sorry about this, pushed a refactor too fast last night without testing thoroughly. I'll have this fixed today.

I also encountered this one just now.

@simon987 beat me to the fix. Try it now.

It seems to work now. Although the application exits with a non-zero code. This is the last output:

[√] [2019-03-22 08:41:31] Update of 2 pages complete (10.46 sec)
    - 0 entries skipped
Traceback (most recent call last):
  File "./archive", line 132, in <module>
    main(*sys.argv)
  File "./archive", line 93, in main
    update_archive_data(import_path=import_path, resume=resume)
  File "./archive", line 124, in update_archive_data
    log_archiving_finished(len(links))
  File "/home/dominique/Documents/projects/ArchiveBox/archivebox/logs.py", line 172, in log_archiving_finished
    print('    - {} entries updated'.format(_LAST_RUN_STATS['succeded']))
KeyError: 'succeded'
$ echo $?
1

Is this intentional?

@NullEnt1ty This is a typo, I made a different PR for that: #187

I recently experienced this but I'm guessing the PR will fix it.

Just merged @simon987's PR, thanks for reporting @n0ncetonic and @NullEnt1ty! Comment back if you're still having problems and I'll reopen it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danmed picture danmed  Â·  6Comments

ikuraj picture ikuraj  Â·  5Comments

MartinThoma picture MartinThoma  Â·  4Comments

oksjd picture oksjd  Â·  3Comments

onlyjob picture onlyjob  Â·  4Comments