sissbruecker / linkding

Self-hosted bookmark manager that is designed be to be minimal, fast, and easy to set up using Docker.
MIT License
5.33k stars 261 forks source link

Failed to create snapshot #678

Closed rem7 closed 3 months ago

rem7 commented 3 months ago

Using the new latest-plus Docker image and the I'm getting the following exception:

==> background_tasks.log <==
2024-04-03 02:42:04,213 INFO Create HTML snapshot for bookmark. url=https://github.com/sissbruecker/linkding
fetch failed URL: https://github.com/sissbruecker/linkding
Stack: TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:16289:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///usr/local/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:214:24
    at async retryConnection (file:///usr/local/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:233:16)
    at async Module.getPageData (file:///usr/local/lib/node_modules/single-file-cli/lib/cdp-client.js:46:22)
    at async capturePage (file:///usr/local/lib/node_modules/single-file-cli/single-file-cli-api.js:244:20)
    at async runNextTask (file:///usr/local/lib/node_modules/single-file-cli/single-file-cli-api.js:164:20)
    at async Promise.all (index 0)
    at async capture (file:///usr/local/lib/node_modules/single-file-cli/single-file-cli-api.js:115:2)
    at async run (file:///usr/local/lib/node_modules/single-file-cli/single-file-launcher.js:82:3)

2024-04-03 02:42:14,421 ERROR Failed to create HTML snapshot for bookmark. url=https://github.com/sissbruecker/linkding
Traceback (most recent call last):
  File "/etc/linkding/bookmarks/services/tasks.py", line 245, in _create_html_snapshot_task
    singlefile.create_snapshot(asset.bookmark.url, filepath)
  File "/etc/linkding/bookmarks/services/singlefile.py", line 24, in create_snapshot
    raise SingeFileError("Failed to create snapshot")
bookmarks.services.singlefile.SingeFileError: 
sissbruecker commented 3 months ago

Does it work with other websites?

Also, can you please provide the output of docker inspect sissbruecker/linkding:latest-plus. Would be good to know which architecture your host system uses (amd64 or arm64).

rem7 commented 3 months ago

Container is running on amd64. Looks like after trying several sites a few of them have succeeded.

[
    {
        "Id": "sha256:11ca71492743283e48db7b66f1fbf4468b2c3764d97c2e1feebfc73ccc3f19ab",
        "RepoTags": [
            "sissbruecker/linkding:latest-plus"
        ],
        "RepoDigests": [
            "sissbruecker/linkding@sha256:ca83bec626d813c7f2a49125f493a395f0e10e6a6e5da29664fccd5c8a8ecaec"
        ],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2024-04-01T13:24:14.667139792Z",
        "ContainerConfig": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": null,
            "Cmd": null,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "DockerVersion": "",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "9090/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/opt/venv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D",
                "PYTHON_VERSION=3.11.8",
                "PYTHON_PIP_VERSION=24.0",
                "PYTHON_SETUPTOOLS_VERSION=65.5.1",
                "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/dbf0c85f76fb6e1ab42aa672ffca6f0a675d9ee4/public/get-pip.py",
                "PYTHON_GET_PIP_SHA256=dfe9fd5c28dc98b5ac17979a953ea550cec37ae1b47a5116007395bfacff2ab9",
                "VIRTUAL_ENV=/opt/venv",
                "LD_ENABLE_SNAPSHOTS=True"
            ],
            "Cmd": [
                "./bootstrap.sh"
            ],
            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "curl -f http://localhost:${LD_SERVER_PORT:-9090}/${LD_CONTEXT_PATH}health || exit 1"
                ],
                "Interval": 30000000000,
                "Timeout": 1000000000,
                "Retries": 3
            },
            "ArgsEscaped": true,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "/etc/linkding",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 1519915069,
        "VirtualSize": 1519915069,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/46869a5fe6f6e51b46fc220422d9dfc71b7ef7a9701b94ebf90c2d650b4ab6c7/diff:/var/lib/docker/overlay2/a8fee55cb98afb145a3ebb4a559bffd79c25bd144a7f5cc888eb22f03ed550e2/diff:/var/lib/docker/overlay2/16eb8c40267da43ea1b302299a385f40e5d5cd5a15b58e4e8382e8c612fd75fc/diff:/var/lib/docker/overlay2/044feb0d7dcfd909c49c2f3d068d158769a2b6533d7b4c03cb994b04f9eb023b/diff:/var/lib/docker/overlay2/54ef2fce5c02c9191293d731743dbc0c2b8c239c0b9c3f1abf745cf41388c3e8/diff:/var/lib/docker/overlay2/1ed774250ea514a94ae75ec321c1f92692342bb55bd317ef3d1273679c2544c0/diff:/var/lib/docker/overlay2/bf7ffc6873e1a01a057df9c607a54dc807c48434829fccb4ab8d5e8c7b300f62/diff:/var/lib/docker/overlay2/c1c546107185bb04e2bd29b4bcd3272ac713e0e9837278245178e6a9b7bd90a9/diff:/var/lib/docker/overlay2/0ddcf9ae4f3017c81c515130403f747da5e28d842256e4cd0dc8378d74db40fc/diff:/var/lib/docker/overlay2/de1f7661fca98731ff150b37c039e86fac082be48a881cd8c1711ea7c395e8a8/diff:/var/lib/docker/overlay2/77316f497159fde7f5519b02be9427bb95ab16833e21b041a997997ad55eeb28/diff:/var/lib/docker/overlay2/a2181d851a8578d8b5dc623d1d8792468270aad6f62acf8ff30fb4dad5e8d57f/diff:/var/lib/docker/overlay2/1a9b2a468c1e371a14c991021d5595f6d851483f8d353b57d5517abd938dcf86/diff",
                "MergedDir": "/var/lib/docker/overlay2/3185db2da985d9989d60d881ce0655e3fe8180d57ff6d0a711220bb742c99174/merged",
                "UpperDir": "/var/lib/docker/overlay2/3185db2da985d9989d60d881ce0655e3fe8180d57ff6d0a711220bb742c99174/diff",
                "WorkDir": "/var/lib/docker/overlay2/3185db2da985d9989d60d881ce0655e3fe8180d57ff6d0a711220bb742c99174/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:a483da8ab3e941547542718cacd3258c6c705a63e94183c837c9bc44eb608999",
                "sha256:c8f253aef5606f6716778771171c3fdf6aa135b76a5fa8bf66ba45c12c15b540",
                "sha256:9559125c0303b960274ed767b40a1a1950c500dd9e3f5ffea9418d156b787299",
                "sha256:010a290fc3d5487d6431681165ae41aca6278b077be77a285db6888154903022",
                "sha256:067693c93cf96e1757b12c3b57a46f0ef79e2499b4729c35a608bb2e915e64ee",
                "sha256:e3ddc43e6b95f7eefaca0a3e726072d3e5036a1bb9aa3711685ed7b03d0e2b7b",
                "sha256:ab71238fd0bf8925c0ecf12938240e53283dfa09ea0b56aa8190b36fe4208094",
                "sha256:4a3979efd454737bd3f1f105bc360c14eefa1830ed4efa42770d8abb1a7e6674",
                "sha256:07f63554b26d1e83f49b7bfa1a9ca02e2597a2c2a5d73e6199e06a7ac040b371",
                "sha256:f8982a2e85cf2d2209beab94d34ec206886662c6af1e12b40e666d19f5f70428",
                "sha256:be7df9f7aa1a95975b9bf152e8e4c95f72232059dd98365c1b910d75fbf5b5d5",
                "sha256:f80e64559c4120bf15d385cec80e1c450756d6981490392f01c1918cb4d10f40",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:c6beca3189b8211291a9bde237044861299f3d5b2f05abacbacabcc5e3252607"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]
pettijohn commented 3 months ago

I'm getting the exact same stack dump in background_tasks.log but on ARM64. Here's the inspect output:

[
    {
        "Id": "sha256:d22d71ff0ef791e03d3a639c5477ff8dcd7e04f9633d6062db6b56a5b7b6713b",
        "RepoTags": [
            "sissbruecker/linkding:latest-plus"
        ],
        "RepoDigests": [
            "sissbruecker/linkding@sha256:ca83bec626d813c7f2a49125f493a395f0e10e6a6e5da29664fccd5c8a8ecaec"
        ],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2024-04-01T13:28:30.27570946Z",
        "DockerVersion": "",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "9090/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/opt/venv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D",
                "PYTHON_VERSION=3.11.8",
                "PYTHON_PIP_VERSION=24.0",
                "PYTHON_SETUPTOOLS_VERSION=65.5.1",
                "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/dbf0c85f76fb6e1ab42aa672ffca6f0a675d9ee4/public/get-pip.py",
                "PYTHON_GET_PIP_SHA256=dfe9fd5c28dc98b5ac17979a953ea550cec37ae1b47a5116007395bfacff2ab9",
                "VIRTUAL_ENV=/opt/venv",
                "LD_ENABLE_SNAPSHOTS=True"
            ],
            "Cmd": [
                "./bootstrap.sh"
            ],
            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "curl -f http://localhost:${LD_SERVER_PORT:-9090}/${LD_CONTEXT_PATH}health || exit 1"
                ],
                "Interval": 30000000000,
                "Timeout": 1000000000,
                "Retries": 3
            },
            "ArgsEscaped": true,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "/etc/linkding",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "Architecture": "arm64",
        "Os": "linux",
        "Size": 1514817851,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/bc07bdebeb33cf732494008122e9ebd88118ca67cf834887249703135244e352/diff:/var/lib/docker/overlay2/6fefe28b4598904607ca96474ab52af89872654f161f922ea792c4127c1ec6c4/diff:/var/lib/docker/overlay2/6863b889ab73cc461c9a8f5a181dcdaaffaf33d069fe896984f4ae0a33780d24/diff:/var/lib/docker/overlay2/e852ad0eb5f9f1c4e57688abaa6018db02308fbe3f8e5a2084bd17b1ee7626dc/diff:/var/lib/docker/overlay2/a32c448818e655895190c92c3f5cb3f1ae33006db7c997683da34808c2a3a745/diff:/var/lib/docker/overlay2/7cbf7dc69582a7778002601cbdc21e97e096b7bb5bb55b1fd61a92a232d99281/diff:/var/lib/docker/overlay2/be5cc7da1988fa3f0ce1105fabcfd55c3d9b8e6287cd841929e60b6b7415d18f/diff:/var/lib/docker/overlay2/929abc118c1fe6e84ad2c264bfda27e754c99ebdef0de5dfd5af05af46758b8f/diff:/var/lib/docker/overlay2/a5e532408062be5938abbe7765f86f156e344bae546a5e13d7da4663e5a20fe6/diff:/var/lib/docker/overlay2/06180a847930996d9a14b7d36d6461b4c71af5b501fb6551bb71e537a628990c/diff:/var/lib/docker/overlay2/a51c3533c3860643b37d5f3b3d674097501f72e8e32b4306cdc2a975ab1d4516/diff:/var/lib/docker/overlay2/34b2c15a5ee47f7038284f72cf185af2372a9940dc7d93aeafbfad1d61e78c66/diff:/var/lib/docker/overlay2/936fe42c636d50fdf9661fb42189735b470387c8da2ecbfd7774931b58c1e6bc/diff",
                "MergedDir": "/var/lib/docker/overlay2/68052e3d93fa05d07da239bb5fea8ae209fbeb4dbc794aa339ecbdedd48cdc19/merged",
                "UpperDir": "/var/lib/docker/overlay2/68052e3d93fa05d07da239bb5fea8ae209fbeb4dbc794aa339ecbdedd48cdc19/diff",
                "WorkDir": "/var/lib/docker/overlay2/68052e3d93fa05d07da239bb5fea8ae209fbeb4dbc794aa339ecbdedd48cdc19/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:d64c46ff900ce5a646435f2232e9bdd0c551cc61e727d4d9502d48ce9dcefd25",
                "sha256:9e10a39513a09a9e0510b9caa835c99f31f075fb3b4836cee2a209200aabfe90",
                "sha256:3220a9966d583c8fe3b76b4b1bd0d4bbd2752af30a7b00b41df4b5d3be2af377",
                "sha256:4c22e8ed992a41ea415e2ced037a853335bd3db3b8d05aa5096f498141167bc6",
                "sha256:646fbb289ed9c787acc8f58ee3962f4741ade31fe7de4551c3337d19309c9099",
                "sha256:cafa34570a19e3970d6cef35ff0d895015adf8c5ebb58a9017253773b3dcf43f",
                "sha256:47682483a0f3d72d8d7272d15bba2e1c6fe69878f24b618adc2eecb9f88c2a28",
                "sha256:0c9230ab0ea96b061e22aa71c247e02538428530cc8310355b76c10458db3d4e",
                "sha256:8c1f148ff514b0080de76f5b8a3df5508d7d4b9acca34b29b606194766af39a6",
                "sha256:61487eb508db50117c0bc58e43396d3f6699c16bf963390d09a5ca4e83c8ae46",
                "sha256:4653452b6ba88517236faff7828819f709390331fafb1524dbdb8323506b9e4e",
                "sha256:9f9b83b33d24c56fde647388aa3a94c0c3686250c2a2c40fb7a845411e4b8bf3",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:5ae0ba810a472ff3a32d3c429fd5825efacf9f3cb61b655776cf9cefe6128e52"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]
sissbruecker commented 3 months ago

Hmm, so I can not reproduce it with the Docker image on either platform. But I can reproduce the same error when developing locally and using Node 18, which is also used in the latest-plus image. It works fine with Node 20. So I built a temporary image that uses Node 20 as well: sissbruecker/linkding:test-plus. Care to give it a try?

farktronix commented 3 months ago

I was getting this same error on x86_64, and the test-plus docker image fixes the problem for me. Hopefully it fixes things for @rem7 too.

Thank you for the quick fix, and I'm really excited to have a snapshotting feature built into Linkding- great work!

pettijohn commented 3 months ago

Seeing the same on test-plus

2024-04-03 18:53:56,282 INFO Create HTML snapshot for bookmark. url=https://www.hightidestoredtla.shop/products/bullet-ballpoint-pen-light?variant=38087018184895
Cannot read properties of undefined (reading 'content') URL: https://www.hightidestoredtla.shop/products/bullet-ballpoint-pen-light?variant=38087018184895
Stack: TypeError: Cannot read properties of undefined (reading 'content')
    at capturePage (file:///usr/lib/node_modules/single-file-cli/single-file-cli-api.js:261:17)
    at async runNextTask (file:///usr/lib/node_modules/single-file-cli/single-file-cli-api.js:164:20)
    at async Promise.all (index 0)
    at async capture (file:///usr/lib/node_modules/single-file-cli/single-file-cli-api.js:115:2)
    at async run (file:///usr/lib/node_modules/single-file-cli/single-file-launcher.js:82:3)
    at async file:///usr/lib/node_modules/single-file-cli/single-file-node.js:5:1

2024-04-03 18:54:16,188 ERROR Failed to create HTML snapshot for bookmark. url=https://www.hightidestoredtla.shop/products/bullet-ballpoint-pen-light?variant=38087018184895
Traceback (most recent call last):
  File "/etc/linkding/bookmarks/services/tasks.py", line 245, in _create_html_snapshot_task
    singlefile.create_snapshot(asset.bookmark.url, filepath)
  File "/etc/linkding/bookmarks/services/singlefile.py", line 24, in create_snapshot
    raise SingeFileError("Failed to create snapshot")
bookmarks.services.singlefile.SingeFileError: Failed to create snapshot

Confirming node version

root@f045d70446e7:/etc/linkding# node --version
v20.12.1
sissbruecker commented 3 months ago

Thanks for checking. That seems to be an actual issue in the single-file-cli library that linkding uses for creating snapshots, with that specific website. I've created an issue here: https://github.com/gildas-lormeau/single-file-cli/issues/77

pettijohn commented 3 months ago

That seems to be an actual issue in the single-file-cli library

Oh! That happened to be my most recent bookmark. Tried a few others and they succeeded with test-plus (node 20.12.1). Thanks! Love this functionality! I started writing something similar with puppeteer but life got in the way and I didn't get far. I really appreciate linkding, even more now!

rem7 commented 3 months ago

So I built a temporary image that uses Node 20 as well: sissbruecker/linkding:test-plus. Care to give it a try?

Looks like this worked for the ones that were failing before. Thanks!

pettijohn commented 3 months ago

Seeing an issue where queued snapshot requests seem to hang, possibly when there is more than one in the queue.

2024-04-04 14:48:44,455 INFO Create HTML snapshot for bookmark. url=https://www.zemismart.com/products/mt25b
2024-04-04 14:48:54,673 INFO Create HTML snapshot for bookmark. url=https://github.com/Y2Z/monolith
2024-04-04 14:49:21,291 INFO Successfully created HTML snapshot for bookmark. url=https://www.zemismart.com/products/mt25b
2024-04-04 14:49:24,988 INFO Create HTML snapshot for bookmark. url=https://chriscillizza.substack.com/p/inside-congress-top-secret-nuclear

Waited an hour, no change, so restarted docker compose restart

2024-04-04 16:00:07,893 INFO Create HTML snapshot for bookmark. url=https://github.com/Y2Z/monolith
2024-04-04 16:00:07,991 INFO Create HTML snapshot for bookmark. url=https://chriscillizza.substack.com/p/inside-congress-top-secret-nuclear
Error
    at WebSocket.<anonymous> (file:///usr/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:172:72)
    at callListener (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onError (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:230:9)
    at WebSocket.emit (node:events:518:28)
    at emitErrorAndClose (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/websocket.js:1033:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) URL: https://chriscillizza.substack.com/p/inside-congress-top-secret-nuclear
Stack: Error
    at WebSocket.<anonymous> (file:///usr/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:172:72)
    at callListener (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onError (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:230:9)
    at WebSocket.emit (node:events:518:28)
    at emitErrorAndClose (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/websocket.js:1033:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Error
    at WebSocket.<anonymous> (file:///usr/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:172:72)
    at callListener (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onError (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:230:9)
    at WebSocket.emit (node:events:518:28)
    at emitErrorAndClose (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/websocket.js:1033:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) URL: https://github.com/Y2Z/monolith
Stack: Error
    at WebSocket.<anonymous> (file:///usr/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:172:72)
    at callListener (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onError (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:230:9)
    at WebSocket.emit (node:events:518:28)
    at emitErrorAndClose (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/websocket.js:1033:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

2024-04-04 16:00:10,504 ERROR Failed to create HTML snapshot for bookmark. url=https://github.com/Y2Z/monolith
Traceback (most recent call last):
  File "/etc/linkding/bookmarks/services/tasks.py", line 245, in _create_html_snapshot_task
    singlefile.create_snapshot(asset.bookmark.url, filepath)
  File "/etc/linkding/bookmarks/services/singlefile.py", line 24, in create_snapshot
    raise SingeFileError("Failed to create snapshot")
bookmarks.services.singlefile.SingeFileError: Failed to create snapshot
2024-04-04 16:00:10,504 INFO Successfully created HTML snapshot for bookmark. url=https://chriscillizza.substack.com/p/inside-congress-top-secret-nuclear
2024-04-04 16:00:13,097 INFO Create HTML snapshot for bookmark. url=https://rckeith.co.uk/pdf-plans-to-g-code/
2024-04-04 16:00:13,197 INFO Create HTML snapshot for bookmark. url=https://blog.thermoworks.com/beef/how-to-make-smoked-pastrami/
Error
    at WebSocket.<anonymous> (file:///usr/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:172:72)
    at callListener (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onError (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:230:9)
    at WebSocket.emit (node:events:518:28)
    at emitErrorAndClose (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/websocket.js:1033:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) URL: https://rckeith.co.uk/pdf-plans-to-g-code/
Stack: Error
    at WebSocket.<anonymous> (file:///usr/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:172:72)
    at callListener (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:290:14)
    at WebSocket.onError (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/event-target.js:230:9)
    at WebSocket.emit (node:events:518:28)
    at emitErrorAndClose (/usr/lib/node_modules/single-file-cli/node_modules/ws/lib/websocket.js:1033:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

2024-04-04 16:00:15,370 ERROR Failed to create HTML snapshot for bookmark. url=https://rckeith.co.uk/pdf-plans-to-g-code/
Traceback (most recent call last):
  File "/etc/linkding/bookmarks/services/tasks.py", line 245, in _create_html_snapshot_task
    singlefile.create_snapshot(asset.bookmark.url, filepath)
  File "/etc/linkding/bookmarks/services/singlefile.py", line 24, in create_snapshot
    raise SingeFileError("Failed to create snapshot")
bookmarks.services.singlefile.SingeFileError: Failed to create snapshot
2024-04-04 16:00:39,320 INFO Successfully created HTML snapshot for bookmark. url=https://blog.thermoworks.com/beef/how-to-make-smoked-pastrami/

(As an aside, that link to Monolith is one I bookmarked as an idea instead of puppeteer for making my own archiver.)

sissbruecker commented 3 months ago

Thanks, that definitely needs some attention. Seems to be a separate issue in single-file-cli, reported it here: https://github.com/gildas-lormeau/single-file-cli/issues/78. Maybe I'll have to change the task queue somehow so that it only takes one snapshot at a time.

I started prototyping with monolith as well, and it produced pretty good results considering it doesn't run in a browser. However the resulting HTML was often multiple times larger than what single-file produces.