plandex-ai / plandex

AI driven development in your terminal. Designed for large, real-world tasks.
https://plandex.ai
GNU Affero General Public License v3.0
9.8k stars 700 forks source link

[ubuntu] docker-compose up (for the very first time) throws errors #104

Open michabbb opened 2 months ago

michabbb commented 2 months ago

here´s the output don´t know if i missed something in the docs 🤔

a 2nd try shows:

$ docker-compose up
[+] Building 0.0s (0/0)                                                                                                                                                                                          docker:default
[+] Running 2/0
 ✔ Container app-plandex-postgres-1  Running                                                                                                                                                                               0.0s
 ✔ Container app-plandex-server-1    Created                                                                                                                                                                               0.0s
Attaching to app-plandex-postgres-1, app-plandex-server-1
app-plandex-server-1    | /usr/bin/env: 'bash\r': No such file or directory
app-plandex-server-1    | /usr/bin/env: use -[v]S to pass options in shebang lines
app-plandex-server-1 exited with code 127

my .env file:

POSTGRES_PASSWORD=test
PLANDEX_DB=plandex
PLANDEX_USER=plandex
PLANDEX_PASSWORD=test
PGDATA_DIR=/home/micha/apps/plandex/data/pg/
PLANDEX_DATA_DIR=/home/micha/apps/plandex/data/plandex/
GOENV=development
PIN2LOG=true

running in Ubuntu 23.10

thanks for any help!

danenania commented 1 month ago

@michabbb sorry, I missed this! Is it still an issue for you?

michabbb commented 1 month ago

Yes

appreciated commented 1 week ago

@michabbb Are you using Ubuntu inside WSL for any chance?

michabbb commented 1 week ago

@appreciated yes I do

appreciated commented 1 week ago

@michabbb In this case the issue occurs probably because you checked out the repository on windows and not inside the wsl. This causes the .sh files to be checked out with windows style line feeds.

To resolve this issue on your machine you can do the following:

dos2unix .../01-init.sh
dos2unix .../wait-for-it.sh
dos2unix .../start_local.sh

@danenania This issue can be fixed for the future by adding a .gitattributes file:

*.sh        text eol=lf
michabbb commented 6 days ago

I am currently on vacation, but will try as soon as I am back at my pc, thanks

qualeo commented 5 days ago

Noticed this error (ERROR: syntax error at or near "WITH") when running docker-compose up for the first time. Similar/same issue as above? :thinking:

[~/Code/plandex/app]$ docker compose up
[+] Running 15/15
 ✔ plandex-postgres Pulled                                                              16.1s 
   ✔ 2cc3ae149d28 Pull complete                                                          4.1s 
   ✔ d1a63825d58e Pull complete                                                          4.1s 
   ✔ ed6f372fe58d Pull complete                                                          4.2s 
   ✔ 35f975e69306 Pull complete                                                          4.2s 
   ✔ 40c4fe86e99d Pull complete                                                          5.3s 
   ✔ 4795e1a32ff6 Pull complete                                                          5.3s 
   ✔ bcb5a54ae87d Pull complete                                                          5.4s 
   ✔ d3983228bec6 Pull complete                                                          5.4s 
   ✔ 5378bf7229e9 Pull complete                                                         14.4s 
   ✔ bba3241011a6 Pull complete                                                         14.4s 
   ✔ 5e1d0413d05a Pull complete                                                         14.4s 
   ✔ 6a489170d05e Pull complete                                                         14.4s 
   ✔ 440b39aff272 Pull complete                                                         14.4s 
   ✔ 582c79113570 Pull complete                                                         14.4s 
[+] Running 3/2
 ✔ Network app_plandex-network       Created                                             0.1s 
 ✔ Container app-plandex-postgres-1  Created                                             0.2s 
 ✔ Container app-plandex-server-1    Created                                             0.0s 
Attaching to plandex-postgres-1, plandex-server-1
plandex-postgres-1  | The files belonging to this database system will be owned by user "postgres".
plandex-postgres-1  | This user must also own the server process.

[...]

plandex-postgres-1  | 2024-06-27 22:54:50.472 UTC [52] LOG:  database system was shut down at 2024-06-27 22:54:50 UTC
plandex-postgres-1  | 2024-06-27 22:54:50.476 UTC [49] LOG:  database system is ready to accept connections
plandex-postgres-1  |  done
plandex-postgres-1  | server started
plandex-postgres-1  | CREATE DATABASE
plandex-postgres-1  | 
plandex-postgres-1  | 
plandex-postgres-1  | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/01-init.sh
plandex-postgres-1  | ERROR:  syntax error at or near "WITH"
plandex-postgres-1  | LINE 1: CREATE USER  WITH PASSWORD '';
plandex-postgres-1  |                      ^
plandex-postgres-1  | 2024-06-27 22:54:50.687 UTC [63] ERROR:  syntax error at or near "WITH" at character 14
plandex-postgres-1  | 2024-06-27 22:54:50.687 UTC [63] STATEMENT:  CREATE USER  WITH PASSWORD '';
plandex-postgres-1 exited with code 0
plandex-postgres-1  | 
plandex-postgres-1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
plandex-postgres-1  | 
plandex-postgres-1  | 2024-06-27 22:54:51.277 UTC [1] LOG:  starting PostgreSQL 16.3 (Debian 16.3-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
plandex-postgres-1  | 2024-06-27 22:54:51.277 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
plandex-postgres-1  | 2024-06-27 22:54:51.277 UTC [1] LOG:  listening on IPv6 address "::", port 5432
plandex-postgres-1  | 2024-06-27 22:54:51.278 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
plandex-postgres-1  | 2024-06-27 22:54:51.281 UTC [29] LOG:  database system was interrupted; last known up at 2024-06-27 22:54:50 UTC
plandex-postgres-1  | 2024-06-27 22:54:51.382 UTC [29] LOG:  database system was not properly shut down; automatic recovery in progress
plandex-postgres-1  | 2024-06-27 22:54:51.384 UTC [29] LOG:  redo starts at 0/14EA200
plandex-postgres-1  | 2024-06-27 22:54:51.398 UTC [29] LOG:  invalid record length at 0/1912038: expected at least 24, got 0
plandex-postgres-1  | 2024-06-27 22:54:51.398 UTC [29] LOG:  redo done at 0/1911FD8 system usage: CPU: user: 0.00 s, system: 0.01 s, elapsed: 0.01 s
plandex-postgres-1  | 2024-06-27 22:54:51.401 UTC [27] LOG:  checkpoint starting: end-of-recovery immediate wait
plandex-postgres-1  | 2024-06-27 22:54:51.441 UTC [27] LOG:  checkpoint complete: wrote 922 buffers (5.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.015 s, sync=0.024 s, total=0.042 s; sync files=301, longest=0.002 s, average=0.001 s; distance=4255 kB, estimate=4255 kB; lsn=0/1912038, redo lsn=0/1912038
plandex-postgres-1  | 2024-06-27 22:54:51.445 UTC [1] LOG:  database system is ready to accept connections
plandex-server-1    | wait-for-it.sh: plandex-postgres:5432 is available after 2 seconds
plandex-server-1    | 2024/06/27 22:54:53 connected to database
plandex-server-1    | 2024/06/27 22:54:53 ran migrations successfully
plandex-server-1    | 2024/06/27 22:54:53 In development mode.
plandex-server-1    | 2024/06/27 22:54:53 Started server on port 8080
plandex-postgres-1  | 2024-06-27 22:59:51.481 UTC [27] LOG:  checkpoint starting: time
plandex-postgres-1  | 2024-06-27 23:00:06.796 UTC [27] LOG:  checkpoint complete: wrote 153 buffers (0.9%); 0 WAL file(s) added, 0 removed, 0 recycled; write=15.282 s, sync=0.016 s, total=15.315 s; sync files=197, longest=0.001 s, average=0.001 s; distance=1054 kB, estimate=3935 kB; lsn=0/1A19C48, redo lsn=0/1A19C10
appreciated commented 5 days ago

@qualeo did you execute the ./start_local.sh before the docker compose up? From the logs provided it seems that no .env exists in your machine which is created by the mentioned script.

qualeo commented 5 days ago

Did not run the script. Did rename _env to .env tho.

On Fri, Jun 28, 2024, 3:56 AM appreciated @.***> wrote:

@qualeo https://github.com/qualeo did you execute the ./start_local.sh before the docker compose up? From the logs provided it seems that no .env exists in your machine which is created by the mentioned script.

— Reply to this email directly, view it on GitHub https://github.com/plandex-ai/plandex/issues/104#issuecomment-2196351253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYTINLR6NKJR4CFMPBDENY3ZJUJKTAVCNFSM6AAAAABG77T3B2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJWGM2TCMRVGM . You are receiving this because you were mentioned.Message ID: @.***>

michabbb commented 2 days ago

@appreciated thanks, dos2unix seems to be the trick.

appreciated commented 1 day ago

Did not run the script. Did rename _env to .env tho. On Fri, Jun 28, 2024, 3:56 AM appreciated @.> wrote: @qualeo https://github.com/qualeo did you execute the ./start_local.sh before the docker compose up? From the logs provided it seems that no .env exists in your machine which is created by the mentioned script. — Reply to this email directly, view it on GitHub <#104 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYTINLR6NKJR4CFMPBDENY3ZJUJKTAVCNFSM6AAAAABG77T3B2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJWGM2TCMRVGM . You are receiving this because you were mentioned.Message ID: @.>

@qualeo I think your issue is unrelated to this issue. Can you give more details?