opf / openproject-docker-compose

Recipes to deploy OpenProject with Docker, Docker Compose, Kubernetes, etc.
181 stars 164 forks source link

K8S - pending migration stuck + INGRESS problem #47

Closed sevenGroupFrance closed 2 months ago

sevenGroupFrance commented 2 years ago

Worker and web deployment are restarting.

Checkings pod logs, i can see from the web pod :

Migrations are pending. To resolve this issue, run:

        bin/rails db:migrate RAILS_ENV=production

in the worker logs, having this error :

-----> Setting PGVERSION=13 PGBIN=/usr/lib/postgresql/13/bin PGCONF_FILE=/etc/postgresql/13/main/postgresql.conf
/app/config/constants/settings/definition.rb:303:in `find_env_var_override': Using unprefixed environment variables is deprecated. Please use OPENPROJECT_ATTACHMENTS_STORAGE_PATH instead of ATTACHMENTS_STORAGE_PATH (StructuredWarnings::StandardWarning)
/app/config/constants/settings/definition.rb:303:in `find_env_var_override': Using unprefixed environment variables is deprecated. Please use OPENPROJECT_RAILS_CACHE_STORE instead of RAILS_CACHE_STORE (StructuredWarnings::StandardWarning)
/app/lib/tasks/environment.rake:32:in `block (2 levels) in <top (required)>': Forcefully loading the application. Use :environment to avoid eager loading. (StructuredWarnings::StandardWarning)
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "users" does not exist
LINE 9:  WHERE a.attrelid = '"users"'::regclass
                            ^

It's like the worker can't migrate the database ! Any idea what is wrong ?

Thank you for your help.

sevenGroupFrance commented 2 years ago

Ok, from the cron pod, wich was the only running well, i've launch bin/rails db:migrate RAILS_ENV=production and this work.

Now having trouble with the ingress, I have a 504 from the browser. Will dig in !

sevenGroupFrance commented 2 years ago

About the Ingress, the problem may be in the proxy deployment, wich has

 env:
            - name: APP_HOST
              value: $(WEB_SERVICE_HOST)

$(WEB_SERVICE_HOST) does not exist, and is not used in ingress... Replacing by subdomain.mydomain.com does not help

Found in ingress pod logs :

2022/11/23 14:01:06 [error] 4650#4650: *129230745 upstream timed out (110: Operation timed out) while connecting to upstream, client: x.x.x.x, server: sub.mysubdomain.com, request: "GET /favicon.ico HTTP/2.0", upstream: "http://10.2.0.53:80/favicon.ico", host: "sub.mysubdomain.com", referrer: "https://sub.mysubdomain.com/"
x.x.x.x - - [23/Nov/2022:14:01:06 +0000] "GET /favicon.ico HTTP/2.0" 504 562 "https://sub.mysubdomain.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" 130 15.002 [openproject-proxy-80] [] 10.2.0.53:80, 10.2.0.53:80, 10.2.0.53:80 0, 0, 0 5.000, 5.004, 5.000 504, 504, 504 905d2c74a2f63e5b66b6b2bfd75b8f22

Edit :

Trying to debug : from the proxy pod :

image

To try directly connect to the pod, i've done a port forward directly on the pod (proxy). Always redrected to httpS with error ERR_SSL_PROTOCOL_ERROR !

Is their any bad configuration IN the proxy pod or web pod ?

Any help is welcom :)

sevenGroupFrance commented 1 year ago

Problem is resolved.

See #41 for solutions :)

oliverguenther commented 2 months ago

K8s deployment has moved to helm chart. I'm closing all remaining issues. In case you need help, please: