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

Error when using Docker Compose on Ubuntu 24.04 #1559

Open
6 of 10 tasks
ndisalvio3 opened this issue Jun 9, 2024 · 3 comments
Open
6 of 10 tasks

Error when using Docker Compose on Ubuntu 24.04 #1559

ndisalvio3 opened this issue Jun 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ndisalvio3
Copy link

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

It would install

Current behaviour

It fails with the following error `root@agentgpt:~/AgentGPT# ./setup.sh

up to date, audited 159 packages in 2s

37 packages are looking for funding
run npm fund for details

1 low severity vulnerability

To address all issues, run:
npm audit fix

Run npm audit for details.

[email protected] start
node src/index.js

█████╗ ██████╗ ███████╗███╗ ██╗████████╗ ██████╗ ██████╗ ████████╗
██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔════╝ ██╔══██╗╚══██╔══╝
███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ██║ ███╗██████╔╝ ██║
██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ██║ ██║██╔═══╝ ██║
██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ╚██████╔╝██║ ██║
╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝

Welcome to the AgentGPT CLI! This CLI will generate the required .env files.
Copies of the generated envs will be created in ./next/.env and ./platform/.env.

Existing ./next/env file found. Validating...
? How will you be running AgentGPT? 🐋 Docker-compose (Recommended)
node:events:495
throw er; // Unhandled 'error' event
^

Error: spawn docker-compose ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:284:19)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:290:12)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn docker-compose',
path: 'docker-compose',
spawnargs: [ 'up', '--build' ]
}

Node.js v18.20.3
root@agentgpt:~/AgentGPT# docker -v
Docker version 26.1.4, build 5650f9b`

Steps to reproduce

  1. Run setup.sh
  2. Choose the docker-compose option

Possible solution

Change docker-compose up --build to docker compose up --build

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Acknowledgements

  • My issue title is concise, descriptive, and in title casing.
  • I have searched the existing issues to make sure this bug has not been reported yet.
  • I am using the latest version of AgentGPT.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.
@ndisalvio3 ndisalvio3 added the bug Something isn't working label Jun 9, 2024
@Curricula93
Copy link

same here, tried to install on coolify

@qwertyaya
Copy link

I've had the same issue but i've found a fix for me,
I have Kali linux

I didn't have the docker compose plugin, and for some reason when i was trying to install it i couldn't locate the package, so i've installed it manually from the documentation which installs it as "docker compose"

Once i had docker composed plugin, i've changed in all of the files that include "docker-compose" with "docker compose" and it solved the issue, and i've added the shell, basically:

In the index file /cli/src/index.js

from:
if (runOption === "docker-compose") { const dockerComposeUp = spawn("docker-compose", ["up", "--build"], { stdio: "inherit", }); }

To this:
`
if (runOption === "docker compose") {
const dockerComposeUp = spawn("docker", ["compose", "up", "--build"], {
stdio: "inherit",
shell: true,
});

dockerComposeUp.on("error", (error) => {
console.error(Error executing docker compose: ${error.message});
process.exit(1);
});

dockerComposeUp.on("close", (code) => {
if (code !== 0) {
console.error(docker compose exited with code ${code});
process.exit(code);
}
});
}
`
I did it in the other files as-well:

./cli/src/questions/sharedQuestions.js
Hope that helps, sorry for the format

@lucas-azambuja
Copy link

ty @qwertyaya!
in my case, the fix runs correctly with small changes:

  if (runOption === "docker-compose") {
    const dockerComposeUp = spawn("docker", ["compose", "up", "--build"], {
      stdio: "inherit",
      shell: true,
    });

    dockerComposeUp.on("error", (error) => {
      console.error(`Error executing docker compose: ${error.message}`);
      process.exit(1);
    });

    dockerComposeUp.on("close", (code) => {
      if (code !== 0) {
        console.error(`docker compose exited with code ${code}`);
        process.exit(code);
      }
    });
  }

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

4 participants