eliza icon indicating copy to clipboard operation
eliza copied to clipboard

Unable to load sqlite-vec extensions in docker environment

Open iankm opened this issue 11 months ago • 5 comments

Describe the bug

Upon building the docker container and running locally, I am unable to start my agent. The agent works when I build in my local terminal.

When I run the docker container, I receive the issue in the provided screenshot.

I mainly interact with my agent via the Discord client. When I run locally, it responds to my messages and I can see the logs in terminal. When I run via docker, this does not occur.

To Reproduce

  1. Run docker build -t latest .
  2. Run docker run latest

Expected behavior

I should be able to interact with my agent via Discord and see the appropriate logs in my terminal.

Screenshots

CleanShot 2024-12-28 at 14 38 51@2x

Additional context

iankm avatar Dec 28 '24 19:12 iankm

Hello @iankm! Welcome to the ai16z community. Thank you for opening your first issue; we appreciate your contribution. You are now a ai16z contributor!

github-actions[bot] avatar Dec 28 '24 19:12 github-actions[bot]

Can reproduce the issue, seems this is because the package doesn't have a linux-arm64 target: https://github.com/asg017/sqlite-vec/issues/148

IntrinsiCrypto avatar Dec 28 '24 20:12 IntrinsiCrypto

Can you try running: docker buildx build --platform=linux/amd64 -t eliza:latest . Then try to run the container?

HashWarlock avatar Dec 30 '24 05:12 HashWarlock

Will do

iankm avatar Dec 30 '24 17:12 iankm

This worked! Thank you

iankm avatar Dec 31 '24 02:12 iankm

This issue should be closed.

AIFlowML avatar Jan 02 '25 16:01 AIFlowML

Greetings, stumbled upon the same issue. Tried to run docker buildx build --platform=linux/amd64 -t eliza:latest . as @HashWarlock suggested but now it returns different errors during the build stage. I'm running it on Macbook Pro M2 if it may help.

Stacktrace 1 (during first try):

199.4 node_modules/@discordjs/opus install: gyp ERR! build error 
199.4 node_modules/@discordjs/opus install: gyp ERR! stack Error: `make` failed with exit code: 2
199.4 node_modules/@discordjs/opus install: gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/build.js:209:23)
199.4 node_modules/@discordjs/opus install: gyp ERR! System Linux 6.10.14-linuxkit
199.4 node_modules/@discordjs/opus install: gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/app/node_modules/@discordjs/opus/prebuild/node-v131-napi-v3-linux-x64-glibc-2.36/opus.node" "--module_name=opus" "--module_path=/app/node_modules/@discordjs/opus/prebuild/node-v131-napi-v3-linux-x64-glibc-2.36" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
199.4 node_modules/@discordjs/opus install: gyp ERR! cwd /app/node_modules/@discordjs/opus
199.4 node_modules/@discordjs/opus install: gyp ERR! node -v v23.3.0
199.4 node_modules/@discordjs/opus install: gyp ERR! node-gyp -v v10.1.0
199.4 node_modules/@discordjs/opus install: gyp ERR! not ok 
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! build error 
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/app/node_modules/@discordjs/opus/prebuild/node-v131-napi-v3-linux-x64-glibc-2.36/opus.node --module_name=opus --module_path=/app/node_modules/@discordjs/opus/prebuild/node-v131-napi-v3-linux-x64-glibc-2.36 --napi_version=9 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/app/node_modules/@discordjs/node-pre-gyp/lib/util/compile.js:85:20)
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1101:16)
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! System Linux 6.10.14-linuxkit
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/@discordjs/opus/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! cwd /app/node_modules/@discordjs/opus
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! node -v v23.3.0
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! node-pre-gyp -v v0.4.5
199.4 node_modules/@discordjs/opus install: node-pre-gyp ERR! not ok 
199.4 node_modules/@discordjs/opus install: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/app/node_modules/@discordjs/opus/prebuild/node-v131-napi-v3-linux-x64-glibc-2.36/opus.node --module_name=opus --module_path=/app/node_modules/@discordjs/opus/prebuild/node-v131-napi-v3-linux-x64-glibc-2.36 --napi_version=9 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
199.5 node_modules/@discordjs/opus install: Failed
199.5  ELIFECYCLE  Command failed with exit code 1.
--------------------
  26 |     # Install dependencies and build the project
  27 | >>> RUN pnpm install \
  28 | >>>     && pnpm build-docker \
  29 | >>>     && pnpm prune --prod
  30 |     
--------------------

Stacktrace 2 (second try):

67.45 node_modules/canvas install: /bin/sh: 1: pkg-config: not found
67.45 node_modules/canvas install: gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
67.49 node_modules/canvas install: gyp ERR! configure error 
67.49 node_modules/canvas install: gyp ERR! stack Error: `gyp` failed with exit code: 1
67.49 node_modules/canvas install: gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/configure.js:297:18)
67.49 node_modules/canvas install: gyp ERR! stack at ChildProcess.emit (node:events:513:28)
67.49 node_modules/canvas install: gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
67.49 node_modules/canvas install: gyp ERR! System Linux 6.10.14-linuxkit
67.49 node_modules/canvas install: gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/app/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/app/node_modules/canvas/build/Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v131"
67.49 node_modules/canvas install: gyp ERR! cwd /app/node_modules/canvas
67.49 node_modules/canvas install: gyp ERR! node -v v23.3.0
67.49 node_modules/canvas install: gyp ERR! node-gyp -v v10.1.0
67.49 node_modules/canvas install: gyp ERR! not ok 
67.50 node_modules/bigint-buffer install: gyp info it worked if it ends with ok
67.50 node_modules/bigint-buffer install: gyp info using [email protected]
67.50 node_modules/bigint-buffer install: gyp info using [email protected] | linux | x64
67.51 node_modules/canvas install: node-pre-gyp ERR! build error 
67.52 node_modules/canvas install: node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/app/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/app/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v131' (1)
67.52 node_modules/canvas install: node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/app/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
67.52 node_modules/canvas install: node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
67.52 node_modules/canvas install: node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1101:16)
67.52 node_modules/canvas install: node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
67.52 node_modules/canvas install: node-pre-gyp ERR! System Linux 6.10.14-linuxkit
67.52 node_modules/canvas install: node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
67.52 node_modules/canvas install: node-pre-gyp ERR! cwd /app/node_modules/canvas
67.52 node_modules/canvas install: node-pre-gyp ERR! node -v v23.3.0
67.52 node_modules/canvas install: node-pre-gyp ERR! node-pre-gyp -v v1.0.11
67.52 node_modules/canvas install: node-pre-gyp ERR! not ok 
67.52 node_modules/canvas install: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/app/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/app/node_modules/canvas/build/Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v131' (1)
67.54 node_modules/canvas install: Failed
...
336.3 @elizaos/plugin-cronoszkevm:build: CLI Building entry: src/index.ts
336.3 @elizaos/plugin-cronoszkevm:build: CLI Using tsconfig: tsconfig.json
336.3 @elizaos/plugin-conflux:build: cache miss, executing 994335a9c33b2e45
336.3 @elizaos/plugin-coinbase:build: cache miss, executing a4f49a1272311c50
336.3 @elizaos/adapter-supabase:build: cache miss, executing 82b519d103d31e74
336.3 @elizaos/plugin-intiface:build: cache miss, executing c1e654c1d0d13290
336.3 @elizaos/plugin-video-generation:build: cache miss, executing 3a72be7e63e31365
336.3 @elizaos/plugin-evm:build: cache miss, executing 8ddfd5c17988009c
336.3 @elizaos/plugin-whatsapp:build: cache miss, executing 714bfad8c3425054
336.3 @elizaos/client-auto:build: cache miss, executing f5f3357bbfc42125
336.3 @elizaos/plugin-trustdb:build: cache miss, executing 9a83a4b03b258284
336.3 @elizaos/plugin-starknet:build: cache miss, executing 0884e521ff219b46
336.3 @elizaos/plugin-web-search:build: cache miss, executing d9ac8aaea81b4291
336.3 @elizaos/plugin-twitter:build: cache miss, executing 35e1e03f8812093b
336.4 @elizaos/client-twitter:build: cache miss, executing 36bb11404d132189
336.4 @elizaos/plugin-abstract:build: cache miss, executing 3cd03e7053a13611
336.4 @elizaos/plugin-image-generation:build: cache miss, executing 34d58de704feb4b1
336.4 @elizaos/plugin-ton:build: cache miss, executing e306bae00b54ce9e
336.4 @elizaos/plugin-bootstrap:build: cache miss, executing 2422158cea8cdf65
336.4 @elizaos/plugin-goat:build: cache miss, executing 75d039a8b66a477c
336.4 @elizaos/plugin-sui:build: cache miss, executing 998f51ed17acf2e3
336.4 @elizaos/plugin-flow:build: cache miss, executing 6c8b6d67e3ea6a3e
336.4 @elizaos/plugin-gitbook:build: cache miss, executing 4ad2da20049a00f9
336.4 @elizaos/client-farcaster:build: cache miss, executing 7ea224138dcc22f0
336.4 @elizaos/plugin-multiversx:build: cache miss, executing 5d0f7fbe1d923242
336.4 @elizaos/plugin-story:build: cache miss, executing 2d43b0a26a569490
336.4 @elizaos/plugin-3d-generation:build: cache miss, executing 7f4509c6a3c7d410
336.4 @elizaos/plugin-icp:build: cache miss, executing 4141af82c380ccc2
336.4 @elizaos/plugin-avalanche:build: cache miss, executing 0df1b628a62b2ce0
336.4 @elizaos/adapter-postgres:build: cache miss, executing 9c2cc60f58a45713
336.6   x internal errors encountered: external process killed a task
336.6 
336.6  ELIFECYCLE  Command failed with exit code 1
--------------------
  26 |     # Install dependencies and build the project
  27 | >>> RUN pnpm install \
  28 | >>>     && pnpm build-docker \
  29 | >>>     && pnpm prune --prod
  30 |     
--------------------

Does anyone faced the same? I would appreciate any help on that.

Lomank123 avatar Jan 04 '25 06:01 Lomank123

Are you running DockerHub or Orbstack? Orbstack is better for building docker for platform= linux/amd64

HashWarlock avatar Jan 04 '25 07:01 HashWarlock

DockerHub. I've resolved the issue by following zxflows' answer in "ElizaOS Development" Discord channel. To fix it, in Docker Desktop general settings I've changed Virtual Machine option to "Docker VMM" instead of "Apple Virtualization Framework" and built the image. Many thanks

Discord message link: https://discord.com/channels/1051457140637827122/1323727516745334785/1325014844075937792

Lomank123 avatar Jan 04 '25 08:01 Lomank123

Closing this issue because not related to the general avaiable code. Anyway @HashWarlock It will be good practice to add this information to the docs. https://discord.com/channels/1051457140637827122/1323727516745334785/1325014844075937792

AIFlowML avatar Jan 06 '25 05:01 AIFlowML

hi! i am getting the same error, running on Mac M1. Rebuilt by using command by @HashWarlock , docker buildx build --platform=linux/amd64 -t eliza:latest . , but am still getting the same error message and behavior, as seen in the attached image.

edit: also tried rebuilding with slightly different command, docker buildx build --platform=linux/arm64 -t eliza:latest . , which also yields the same error.

any insight would be much appreciated!

Image

tweedyant avatar Jan 24 '25 08:01 tweedyant

hi! i am getting the same error, running on Mac M1. Rebuilt by using command by @HashWarlock , docker buildx build --platform=linux/amd64 -t eliza:latest . , but am still getting the same error message and behavior, as seen in the attached image.

edit: also tried rebuilding with slightly different command, docker buildx build --platform=linux/arm64 -t eliza:latest . , which also yields the same error.

any insight would be much appreciated!

Image

Did you change your settings in docker? I also saw something the other day in the case you recently upgraded Mac OS https://em.docker.com/NzkwLVNTQi0zNzUAAAGYME8SNiHnwuJ2PfWQAUBtirDPLaWQYpkcovl0Jy0chWco1eR6PbxB8tS0K8OpldHnD2IZymw= Screenshot_20250124_095252_Proton Mail.png

HashWarlock avatar Jan 24 '25 15:01 HashWarlock

@HashWarlock thanks for the insight, from what I can tell, I'm using the newest version of docker. not quite sure the reason for the behavior i'm experiencing.

Image

tweedyant avatar Jan 26 '25 14:01 tweedyant