Erudika / scoold

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

Can't connect to Para backend. #172

Closed PumpkinSeed closed 4 years ago

PumpkinSeed commented 4 years ago

I wanted to setup a helm chart to easily deploy scoold. But, I didn't found any documentation about how can I connect to the para backend. So I start para with the following config:

para.app_name = "Para"
para.port = 8080
para.env = "production"
para.security.allow_unverified_emails = true
para.clients_can_access_root_app = true
para.cache_enabled = true
para.access_key = "app:para"
para.app_secret_key = "SV7ANd2z0sUUgos7V/3vTp49AL7FMSpEdjcOR4LqGAcWx8J8cfVcLg=="
para.cors_enabled = false
para.security.api_security = false
para.security.csrf_protection = false
para.cors_enabled = false
para.worker_id = 1

Get the logs:


      ____  ___ _ ____ ___ _ 
     / __ \/ __` / ___/ __` /
    / /_/ / /_/ / /  / /_/ / 
   / .___/\__,_/_/   \__,_/  v1.37.0
  /_/                        

2020-05-28 07:26:50 [INFO ] --- Para.initialize() [production] ---
2020-05-28 07:26:50 [INFO ] Loaded new DAO, Search and Cache implementations - H2DAO, LuceneSearch and CaffeineCache.
2020-05-28 07:26:52 [INFO ] Created H2 table 'para'.
2020-05-28 07:26:52 [WARN ] Server is unhealthy - root app not found. Open http://localhost:8080/v1/_setup in the browser to initialize Para.
2020-05-28 07:26:52 [INFO ] Instance #1 initialized.
2020-05-28 07:26:54 [INFO ] Starting ParaServer on para-deployment-6db75db545-xjvlp with PID 8 (/para/para-jar-1.37.0.jar started by para in /para)
2020-05-28 07:26:54 [INFO ] The following profiles are active: production
2020-05-28 07:26:56 [INFO ] Listening on port 8080...
2020-05-28 07:27:03 [INFO ] Started ParaServer in 11.066 seconds (JVM running for 23.931)

Then I start the scoold with the config:

para.app_name = "Scoold"
para.port = 8000
para.env = "production"
para.host_url = "http://localhost:8000"
para.endpoint = "http://scoold.qa.svc.cluster.local"
para.access_key = "app:para"
para.secret_key = "SV7ANd2z0sUUgos7V/3vTp49AL7FMSpEdjcOR4LqGAcWx8J8cfVcLg=="
para.password_auth_enabled = true
para.new_users_can_comment = true
para.code_highlighting_enabled = true
para.is_default_space_public = true
para.admins = "..."
para.support_email = "support@scoold.com"
para.mail.host = "smtp.example.com"
para.mail.port = 587
para.mail.username = "user@example.com"
para.mail.password = "password"
para.mail.tls = true
para.mail.ssl = false
# style
para.show_branding = true
para.logo_url = "/image.png"
para.logo_width = 140
para.stylesheet_url = "/style.css"

With the logs:

                          __    __
   ______________  ____  / /___/ /
  / ___/ ___/ __ \/ __ \/ / __  /
 (__  ) /__/ /_/ / /_/ / / /_/ /
/____/\___/\____/\____/_/\__,_/     (v1.39.3)

2020-05-28 07:42:56 [INFO ] Starting ScooldServer v1.39.3 on scoold-deployment-6c46857d8b-j6xwq with PID 8 (/scoold/scoold-1.39.3.jar started by scoold in /scoold)
2020-05-28 07:42:56 [INFO ] The following profiles are active: production
2020-05-28 07:43:01 [INFO ] Listening on port 8000...
2020-05-28 07:43:02 [INFO ] Initialized ParaClient with endpoint http://scoold.qa.svc.cluster.local and access key 'app:para'.
2020-05-28 07:43:35 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 1 of 10)...
2020-05-28 07:43:35 [INFO ] SpringResourceLoader for Velocity: using resource loader [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@51565ec2, started on Thu May 28 07:42:56 GMT 2020] and resource loader paths [classpath:templates/]
2020-05-28 07:43:38 [INFO ] Started ScooldServer in 42.629 seconds (JVM running for 45.276)
2020-05-28 07:44:17 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 2 of 10)...
2020-05-28 07:44:59 [ERROR] No connection to Para backend. Retrying connection in 10s (attempt 3 of 10)...

But the wierd thing, when I ssh into the scoold's container I can wget the para:8080, so it's totally visible from the scoold container. What mistake am I doing that the scoold can't connect properly? Also is there a config to initialize the para at startup? Because I think there isn't proper backend for that: Server is unhealthy - root app not found. Open http://localhost:8080/v1/_setup in the browser to initialize Para. But if I want to deploy it as a helm chart I can't open a browser to initialize it.

PumpkinSeed commented 4 years ago

I found out that the para.endpoint = "http://scoold.qa.svc.cluster.local" should be the endpoint of the para app and the para.host_url should be what I added there. So probably it's fixed. It was really hard to figure out it as a new-comer.

Thanks for the product anyway. :)