mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #243] Windows Docker-compose exec fails with OCI runtime exec format error #3186
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#3186
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @djs-0415 on GitHub (May 18, 2019).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/243
I'm setting up ArchiveBox using the Docker image and instructions found here. Though it appears to have been successfully setup on my computer, I cannot use the main command to add an individual link
echo "https://example.com" | docker-compose exec -T archivebox /bin/archiveI expected the outputted archive data to be stored in my data/ volume but it does not appear to be, and I get the following error
OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec format error": unknown@pirate commented on GitHub (Jul 9, 2019):
Strange, seems like it might be a docker issue specific to your system. Can you post your OS, docker, and docker-compose version info here?
@0xazure commented on GitHub (Nov 17, 2019):
Confirming I'm also seeing this error.
OS: Windows 10 1903
docker: Docker version 19.03.4, build 9012bf5docker-compose: docker-compose version 1.24.1, build 4667896bThis is what I'm seeing:
I'm not really familiar with Docker, but here's some debugging I was able to do:
I can
stat /bin/archive:Since
/bin/archiveis just a convenience symlink, I tried to run./archivebox/archive.pydirectly:even though:
and
The work-around I found successful was to run
archivebox/archive.pydirectly frompython3:This change isn't onerous, it just doesn't match the instructions in the Docker setup article on the wiki.
Not entirely sure what the fix here would be, but hopefully this info is useful.
@eSoares commented on GitHub (Jan 21, 2020):
Hello,
From the error and from this [1] blog post, my guess is the error is the lack of shebang in the script run in CMD.
[1] - https://www.lewuathe.com/exec-format-error-in-docker-container.html
@pirate commented on GitHub (Feb 4, 2020):
As @0xazure mentions above, the
bin/archiveis just a symlink toarchivebox/archive.py. Symlinks are special files with only one line (the path they point to), so we cant add a shebang to the symlink. I believe the problem is actually a rogue carriage return on the shebang line ofarchive.py(caused by merging someone's PR who edited it on windows).I just removed any
\rand added a\nto be safe, try the latest version and let me know if it's still happening.@0xazure commented on GitHub (Feb 4, 2020):
I gave
90d8093bae30e600bdf2cc0958b232d80d268e33(approximately latestmasteras of writing this) a go, and it still didn't work.However, @pirate your comment about removing
\rgot me on track to identifying what I believe to be the issue.When trying ~latest
master, I was still seeing the sameerror, specifically with that
‘python3\r’problem. I have access to a macOS machine, so I went back to some earlier commits before the potential fix was introduced and tried to run ArchiveBox; every run was successful and did not display errors, so I had a suspicion that it was a Windows-host-only problem.I don't really use Windows as a development environment, so I hadn't configured
gitat all; turns outcore.autocrlfwas set totrue, which means on Windowsgitwill check out files with\r\nendings even if the source repo only has\n. I set this tofalse, re-checked out ArchiveBox, and rebuilt the Docker container from scratch; this fixed running ArchiveBox asdocker-compose exec archivebox archivebox/archive.py.As for
docker-compose exec archivebox /bin/archivenot working, I think it's an issue related to the fact that Windows doesn't understand unix symlinks, so when they get copied over into the Docker container they're broken in some strange way.TLDR; this looks like it's a Windows line ending (
\r\n) on the host vs unix line ending (\n) on the guest issue surfaced by Docker. It might be worth adding a.gitattributesfile to the repo to better control how line endings are handled across platforms. I also think (re?)generating the convenience symlinks as part of the Dockerfile setup might be worth it to ensure the symlinks work correctly if the host is non-unix (e.g. Windows).Hopefully the above write-up helps, and let me know if I can assist with further testing!
@pirate commented on GitHub (Feb 4, 2020):
Ah, in that case I'm tempted to just say I don't support Windows hosts. The repo should be cloned and run entirely in the WSL to avoid this problem. There are a number of other things that break on Windows hosts, so rather than patch over the problem I think I'd rather explicitly drop support.
@pirate commented on GitHub (Jul 24, 2020):
You're welcome to try this on the latest version, it may change things but we still don't officially support windows.
@0xazure commented on GitHub (Jul 30, 2020):
Hey @pirate, that's totally fair about Windows support, no worries. I'm glad we were able to get to the bottom of the issue and hopefully the posts here will help others if they run into similar problems.