Erudika / scoold

A Stack Overflow clone for teams (self-hosted or hosted)
https://scoold.com
Apache License 2.0
861 stars 235 forks source link

default docker compose up : unable to connect to para after 10 tries #325

Closed alkuma closed 2 years ago

alkuma commented 2 years ago

I am trying out scoold on my redhat 8 laptop.

Here's what I did:

https://github.com/Erudika/scoold/blob/master/README.md#docker is the source of the instructions

  1. docker pull erudikaltd/scoold:latest_stable fetches me the image
  2. create a new directory called ~/scoold and copied https://github.com/Erudika/scoold/blob/master/docker-compose.yml into it with the same name
  3. touch para-application.conf scoold-application.conf so I have these two blank files in the ~/scoold/ directory
  4. finally ran docker compose up

I get

[+] Running 2/0
 ⠿ Container scoold-para-1    Created                                                                                                                                                                         0.0s
 ⠿ Container scoold-scoold-1  Recreated                                                                                                                                                                       0.1s
Attaching to scoold-para-1, scoold-scoold-1
scoold-para-1    | 
scoold-para-1    |       ____  ___ _ ____ ___ _ 
scoold-para-1    |      / __ \/ __` / ___/ __` /
scoold-para-1    |     / /_/ / /_/ / /  / /_/ / 
scoold-para-1    |    / .___/\__,_/_/   \__,_/  v1.46.2-SNAPSHOT
scoold-para-1    |   /_/                        
scoold-para-1    | 
scoold-para-1    | 2022-07-06 07:30:22 [INFO ] --- Para.initialize() [production] ---
scoold-para-1    | 2022-07-06 07:30:22 [INFO ] Loaded new DAO, Search and Cache implementations - H2DAO, LuceneSearch and CaffeineCache.
scoold-para-1    | 2022-07-06 07:30:23 [INFO ] Server is healthy.
scoold-para-1    | 2022-07-06 07:30:23 [INFO ] Found root app 'para' and 0 existing child app(s).
scoold-para-1    | 2022-07-06 07:30:23 [INFO ] Starting ParaServer using Java 11.0.15 on ad58873d2456 with PID 1 (/para/para.jar started by root in /para)
scoold-para-1    | 2022-07-06 07:30:23 [INFO ] The following 1 profile is active: "production"
scoold-para-1    | 2022-07-06 07:30:24 [INFO ] Instance #1 initialized and listening on http://localhost:8080
scoold-para-1    | 2022-07-06 07:30:26 [INFO ] Started ParaServer in 3.234 seconds (JVM running for 5.382)
scoold-scoold-1  |                           __    __
scoold-scoold-1  |    ______________  ____  / /___/ /
scoold-scoold-1  |   / ___/ ___/ __ \/ __ \/ / __  /
scoold-scoold-1  |  (__  ) /__/ /_/ / /_/ / / /_/ /
scoold-scoold-1  | /____/\___/\____/\____/_/\__,_/     (v1.50.0)
scoold-scoold-1  | 
scoold-scoold-1  | 2022-07-06 07:30:29 [INFO ] Starting ScooldServer v1.50.0 using Java 11.0.15 on a995671a6c5c with PID 1 (/scoold/scoold.jar started by root in /scoold)
scoold-scoold-1  | 2022-07-06 07:30:29 [INFO ] The following 1 profile is active: "development"
scoold-scoold-1  | 2022-07-06 07:30:32 [INFO ] Scoold server is listening on http://localhost:8000
scoold-scoold-1  | 2022-07-06 07:30:32 [WARN ] Secret key appears to be invalid. Make sure you call 'signIn()' first.
scoold-scoold-1  | 2022-07-06 07:30:33 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 1 of 10)...
scoold-scoold-1  | 2022-07-06 07:30:35 [INFO ] Started ScooldServer in 6.235 seconds (JVM running for 8.347)
scoold-scoold-1  | 2022-07-06 07:30:43 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 2 of 10)...
scoold-scoold-1  | 2022-07-06 07:30:53 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 3 of 10)...
scoold-scoold-1  | 2022-07-06 07:31:03 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 4 of 10)...
scoold-scoold-1  | 2022-07-06 07:31:13 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 5 of 10)...
scoold-scoold-1  | 2022-07-06 07:31:23 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 6 of 10)...
scoold-scoold-1  | 2022-07-06 07:31:33 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 7 of 10)...
scoold-scoold-1  | 2022-07-06 07:31:43 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 8 of 10)...
scoold-scoold-1  | 2022-07-06 07:31:53 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 9 of 10)...
scoold-scoold-1  | 2022-07-06 07:32:03 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 10 of 10)...

Which tells me that scoold is not able to connect to para.

Is para up?

  1. loading http://localhost:8080/v1 on the browser gives me
{
  "info" : "Para - the backend for busy developers.",
  "version" : "1.46.2"
}
  1. ssh to the container and running a wget via http://para:8080/v1 also gives me the same

So para is up and is accessible within the container via http://para:8080

scoold is up as well, on http://localhost:8000/ and accessible via the browser.

So, I don't know why scoold can't connect to para when I can connect to it via both the browser as well as within the container via wget

I followed the README to the letter, so what's wrong with the instructions or my interpretation of the instructions?

There is a similar issue that got resolved by updating the README, but it's the updated documentation that's being followed - https://github.com/Erudika/scoold/issues/180 from two years ago

Thanks in advance

albogdano commented 2 years ago

You are not following the guide closely. You don't have to pull the images manually. Just do this:

  1. First, create a new directory and copy docker-compose.yml.
  2. Create the two configuration files in the same directory (both files can be left blank for now):
    $ touch para-application.conf scoold-application.conf
  3. $ docker compose up
ShenQingchuan commented 1 year ago

I did exactly what the instruction described, except I commented out the expose 8080:8080 of Para, because the 8080 port is already taken by another application. But I didn't resolve the same issue above.

Attaching to scoold_para_1, scoold_scoold_1
para_1    | 
para_1    |       ____  ___ _ ____ ___ _ 
para_1    |      / __ \/ __` / ___/ __` /
para_1    |     / /_/ / /_/ / /  / /_/ / 
para_1    |    / .___/\__,_/_/   \__,_/  v1.49.1-SNAPSHOT
para_1    |   /_/                        
para_1    | 
para_1    | 2023-07-31 13:09:02 [INFO ] --- Para.initialize() [production] ---
para_1    | 2023-07-31 13:09:02 [INFO ] Loaded new DAO, Search and Cache implementations - H2DAO, LuceneSearch and CaffeineCache.
para_1    | 2023-07-31 13:09:06 [INFO ] Server is healthy.
para_1    | 2023-07-31 13:09:06 [INFO ] Found root app 'para' and 0 existing child app(s).
para_1    | 2023-07-31 13:09:08 [INFO ] Starting ParaServer using Java 11.0.20 on f2d47c37a0d9 with PID 1 (/para/para.jar started by root in /para)
para_1    | 2023-07-31 13:09:08 [INFO ] The following 1 profile is active: "production"
scoold_1  |                           __    __
scoold_1  |    ______________  ____  / /___/ /
scoold_1  |   / ___/ ___/ __ \/ __ \/ / __  /
scoold_1  |  (__  ) /__/ /_/ / /_/ / / /_/ /
scoold_1  | /____/\___/\____/\____/_/\__,_/     (v1.55.0)
scoold_1  | 
scoold_1  | 2023-07-31 13:09:11 [INFO ] Starting ScooldServer v1.55.0 using Java 11.0.20 on 56afc790cdc5 with PID 1 (/scoold/scoold.jar started by root in /scoold)
scoold_1  | 2023-07-31 13:09:11 [INFO ] The following 1 profile is active: "development"
para_1    | 2023-07-31 13:09:12 [INFO ] Instance #1 initialized and listening on http://localhost:8080
scoold_1  | 2023-07-31 13:09:16 [INFO ] Scoold server is listening on http://localhost:8000
scoold_1  | 2023-07-31 13:09:17 [WARN ] Secret key appears to be invalid. Make sure you call 'signIn()' first.
scoold_1  | 2023-07-31 13:09:18 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 1 of 10)...
para_1    | 2023-07-31 13:09:19 [INFO ] Started ParaServer in 12.465 seconds (JVM running for 19.956)
scoold_1  | 2023-07-31 13:09:20 [INFO ] Started ScooldServer in 11.213 seconds (JVM running for 15.146)
scoold_1  | 2023-07-31 13:09:28 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 2 of 10)...
scoold_1  | 2023-07-31 13:09:38 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 3 of 10)...
scoold_1  | 2023-07-31 13:09:48 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 4 of 10)...
scoold_1  | 2023-07-31 13:09:58 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 5 of 10)...
scoold_1  | 2023-07-31 13:10:08 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 6 of 10)...

@alkuma Did you resolve this after that? I'd be so appreciated about for your provided information.

albogdano commented 1 year ago

@ShenQingchuan If you want to run Para on a different port, you will have to modify the docker-compose.yml file and change 8080:8080 to 8081:8081, for example. Then add this to your Para configuration file:

para.port = 8081

Then also update the Scoold configuration to connect to Para on 8081 with scoold.para_endpoint = "http://localhost:8081" and restart the two containers.

ShenQingchuan commented 1 year ago

@ShenQingchuan If you want to run Para on a different port, you will have to modify the docker-compose.yml file and change 8080:8080 to 8081:8081, for example. Then add this to your Para configuration file:

para.port = 8081

Then also update the Scoold configuration to connect to Para on 8081 with scoold.para_endpoint = "http://localhost:8081" and restart the two containers.

So I see, I think we may update the docker-compose.yml too.

There's a config argument passing to JAVA_OPTS: -Dscoold.para_endpoint=http://para:8080

is this argument still useful for my situation?

My docker-compose.yml

bat docker-compose.yml      
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: docker-compose.yml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ version: '3.4'
   2   │ 
   3   │ services:
   4   │    para:
   5   │      image: erudikaltd/para:latest_stable
   6   │      ports:
   7   │        - "7676:7676"
   8   │      volumes:
   9   │        - type: volume
  10   │          source: paraData
  11   │          target: /para/data
  12   │        - type: volume
  13   │          source: paraLib
  14   │          target: /para/lib
  15   │        - type: bind
  16   │          source: ./para-application.conf
  17   │          target: /para/application.conf
  18   │      restart: always
  19   │      environment:
  20   │        - JAVA_OPTS=-Dconfig.file=/para/application.conf -Dloader.path=/para/lib
  21   │ 
  22   │    scoold:
  23   │      depends_on:
  24   │        - para
  25   │      image: erudikaltd/scoold:latest_stable
  26   │      ports:
  27   │        - "7575:8000"
  28   │      volumes:
  29   │        - type: bind
  30   │          source: ./scoold-application.conf
  31   │          target: /scoold/application.conf
  32   │        - type: bind
  33   │          source: ./para-application.conf
  34   │          target: /scoold/para-application.conf
  35   │      restart: always
  36   │      environment:
  37   │        - JAVA_OPTS=-Dconfig.file=/scoold/application.conf -Dscoold.autoinit.para_config_file=/scoold/para-application.conf
  38   │        - BOOT_SLEEP=30
  39   │ volumes:
  40   │   paraData:
  41   │   paraLib:
───────┴───────────────────────────────────────────────────��────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

My para config

ubuntu at VM-4-7-ubuntu in [~/docker-apps-setup/scoold]   
22:43:40 › bat para-application.conf 
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: para-application.conf
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ para.port = 7676
   2   │ 
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

My scoold config

ubuntu at VM-4-7-ubuntu in [~/docker-apps-setup/scoold]   
22:44:25 › bat scoold-application.conf 
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: scoold-application.conf
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ scood.para_endpoint = "http://localhost:7676"
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

My directories

ubuntu at VM-4-7-ubuntu in [~/docker-apps-setup/scoold]   
22:45:49 › l
total 20K
drwxrwxr-x  2 ubuntu ubuntu 4.0K Jul 31 22:42 .
drwxrwxr-x 14 ubuntu ubuntu 4.0K Jul 31 20:58 ..
-rw-rw-r--  1 ubuntu ubuntu 1.1K Jul 31 22:40 docker-compose.yml
-rw-rw-r--  1 ubuntu ubuntu   18 Jul 31 22:35 para-application.conf
-rw-rw-r--  1 ubuntu ubuntu   46 Jul 31 22:41 scoold-application.conf
ShenQingchuan commented 1 year ago

I found myself not be able to create that secret key, even not be able to re-run the process, because no matter how many times I docker-compose down and docker-compose up, it always shows that [WARN ] Secret key appears to be invalid. Make sure you call 'signIn()' first.

albogdano commented 1 year ago

@ShenQingchuan You may have to delete all volumes for both Para and Scoold containers and start over. I see that Para is still running on 8080 even though you changed the port in para-application.conf.

Also change -Dscoold.para_endpoint=http://para:7676