Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Docker image on fresh build #1460

Open
timolegros opened this issue Dec 26, 2024 · 12 comments
Open

Broken Docker image on fresh build #1460

timolegros opened this issue Dec 26, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@timolegros
Copy link
Contributor

timolegros commented Dec 26, 2024

Describe the bug

Built Docker image (pnpm docker:run) fails to start - exits with the following error:

2024-12-26 07:24:12 /app/agent:
2024-12-26 07:24:12  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @elizaos/[email protected] start: `node --loader ts-node/esm src/index.ts "--isRoot"`
2024-12-26 07:24:12 Exit status 1
2024-12-26 07:24:12  WARN   Local package.json exists, but node_modules missing, did you mean to install?
2024-12-26 07:24:12 (node:31) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
2024-12-26 07:24:12 --import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("ts-node/esm", pathToFileURL("./"));'
2024-12-26 07:24:12 (Use `node --trace-warnings ...` to show where the warning was created)
2024-12-26 07:24:12 (node:31) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
2024-12-26 07:24:12 (Use `node --trace-deprecation ...` to show where the warning was created)
2024-12-26 07:24:12 
2024-12-26 07:24:12 node:internal/modules/run_main:122
2024-12-26 07:24:12     triggerUncaughtException(
2024-12-26 07:24:12     ^
2024-12-26 07:24:12 Error: Cannot find package '@elizaos/adapter-postgres' imported from /app/agent/src/index.ts
2024-12-26 07:24:12     at packageResolve (/app/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:757:9)
2024-12-26 07:24:12     at moduleResolve (/app/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:798:18)
2024-12-26 07:24:12     at Object.defaultResolve (/app/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:912:11)
2024-12-26 07:24:12     at /app/node_modules/ts-node/src/esm.ts:218:35
2024-12-26 07:24:12     at entrypointFallback (/app/node_modules/ts-node/src/esm.ts:168:34)
2024-12-26 07:24:12     at /app/node_modules/ts-node/src/esm.ts:217:14
2024-12-26 07:24:12     at addShortCircuitFlag (/app/node_modules/ts-node/src/esm.ts:409:21)
2024-12-26 07:24:12     at resolve (/app/node_modules/ts-node/src/esm.ts:197:12)
2024-12-26 07:24:12     at nextResolve (node:internal/modules/esm/hooks:748:28)
2024-12-26 07:24:12     at Hooks.resolve (node:internal/modules/esm/hooks:240:30)
2024-12-26 07:24:12 
2024-12-26 07:24:12 Node.js v23.3.0
2024-12-26 07:24:12  ELIFECYCLE  Command failed with exit code 1.

You can fix this issue by running pnpm install --no-frozen-lockfile before executing pnpm docker:build but the installed dependencies should not affect the image build process.

To Reproduce
Prerequisites:

  • Ubuntu/Debian
  • Docker installed
  • PNPM installed
  • Repo cloned
  • main branch checked out
  1. pnpm clean
  2. pnpm docker:build
  3. pnpm docker:run
  4. docker logs eliza

Expected behavior

The container should not exit with a dependency error and should start as normal regardless of whether pnpm install was executed before pnpm docker:build.

Screenshots

Additional context

Possibly related to: #1120 and #1352

@timolegros timolegros added the bug Something isn't working label Dec 26, 2024
@HashWarlock
Copy link
Collaborator

I assume this is an amd64 cpu? I will try to reproduce and see what is wrong here.

@timolegros
Copy link
Contributor Author

I assume this is an amd64 cpu? I will try to reproduce and see what is wrong here.

Yes. i7-12700H - Ubuntu 22.04.5
Also tried on Intel Xeon Platinum 8000 series - Ubuntu 24

@aijustinmoon
Copy link

I tried pnpm install --no-frozen-lockfile without docker and it doesn't work

@HashWarlock
Copy link
Collaborator

This says the adapter-postgres cannot be found. Which version of the codebase are you using so I can try to reproduce.

@michaeljoser
Copy link

getting same issue with 0.1.7-alpha.2 on x86_64 ubuntu server 24.04.1

@timolegros
Copy link
Contributor Author

This says the adapter-postgres cannot be found. Which version of the codebase are you using so I can try to reproduce.

Tried on release v0.1.6, v0.1.7-alpha.1 as well as latest main.

@vladhalla
Copy link

I have the same issue. I tried the troubleshooting from other issues like using node 18, etc but could not solve the issue yet.

@HashWarlock
Copy link
Collaborator

HashWarlock commented Jan 1, 2025

There must be something introduced that broke the build. Ill investigate further.

@AIFlowML
Copy link
Contributor

AIFlowML commented Jan 3, 2025

Interesting

@michaeljoser
Copy link

ok got it working by cleaning and rebuilding following fix from #982

##982 (comment)

@timolegros
Copy link
Contributor Author

ok got it working by cleaning and rebuilding following fix from #982

##982 (comment)

This does not seem to be a fix for the same issue. This ticket relates to the Docker image i.e. pnpm docker:build and pnpm docker:run. The ticket you're referencing is unrelated to Docker. Installing dependencies and building should not be required prior to building the image.

@michaeljoser
Copy link

yes you are right, I am not using Docker and i was having the same postgres error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants