ansible / awx-operator

An Ansible AWX operator for Kubernetes built with Operator SDK and Ansible. 🤖
https://www.github.com/ansible/awx
Apache License 2.0
1.24k stars 626 forks source link

AWX - Setup with external Postgress - Fresh installation. #359

Open psreddy22 opened 3 years ago

psreddy22 commented 3 years ago

Hi Experts,

I'm able to use old postgress DB with new setup, but not able to to fresh setup. Getting below error, while connecting to awx web. Can anyone look into issue please !!

Error! Failed to fetch custom login configuration settings. System defaults will be shown instead. GET /api/ 404 404 page not found

tchellomello commented 3 years ago

@psreddy22 we will need more information to assist you. Could you share your awx spec?

mkayontour commented 3 years ago

Hi, I got the same issue. I'm behind a traefik ingress and I get this message.

Failed to fetch custom login configuration settings. System defaults will be shown instead.

Details
GET /api/v2/auth/ 404
404 page not found

I use a fresh database, my specs are the following:

apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  service_type: nodeport
  ingress_type: none
  hostname: awx-test.****
  postgres_storage_class: manual

In Addition if I click close on the message and try to log in with the generated secret, the login fails.

mkayontour commented 3 years ago

I found an error in the postgres log which states something about conf settings.

2021-07-23 11:09:25.469 UTC [68] ERROR:  relation "conf_setting" does not exist at character 158
2021-07-23 11:09:25.469 UTC [68] STATEMENT:  SELECT "conf_setting"."id", "conf_setting"."created", "conf_setting"."modified", "conf_setting"."key", "conf_setting"."value", "conf_setting"."user_id" FROM "conf_setting" WHERE ("conf_setting"."key" = 'OAUTH2_PROVIDER' AND "conf_setting"."user_id" IS NULL) ORDER BY "conf_setting"."id" ASC  LIMIT 1
mkayontour commented 3 years ago

Startup Log from the postgres pod looks like this, after the first Error many others of the same kind appear and never stop.

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data/pgdata -l logfile start

waiting for server to start....2021-07-28 07:24:42.608 UTC [49] LOG:  starting PostgreSQL 12.7 (Debian 12.7-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6)
8.3.0, 64-bit
2021-07-28 07:24:42.610 UTC [49] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-07-28 07:24:42.641 UTC [50] LOG:  database system was shut down at 2021-07-28 07:24:41 UTC
2021-07-28 07:24:42.647 UTC [49] LOG:  database system is ready to accept connections
 done
server started
CREATE DATABASE

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

waiting for server to shut down....2021-07-28 07:24:43.170 UTC [49] LOG:  received fast shutdown request
2021-07-28 07:24:43.172 UTC [49] LOG:  aborting any active transactions
2021-07-28 07:24:43.174 UTC [49] LOG:  background worker "logical replication launcher" (PID 56) exited with exit code 1
2021-07-28 07:24:43.177 UTC [51] LOG:  shutting down
2021-07-28 07:24:43.203 UTC [49] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2021-07-28 07:24:43.288 UTC [1] LOG:  starting PostgreSQL 12.7 (Debian 12.7-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-07-28 07:24:43.289 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-07-28 07:24:43.289 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2021-07-28 07:24:43.292 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-07-28 07:24:43.319 UTC [77] LOG:  database system was shut down at 2021-07-28 07:24:43 UTC
2021-07-28 07:24:43.324 UTC [1] LOG:  database system is ready to accept connections
2021-07-28 07:24:57.886 UTC [84] ERROR:  relation "conf_setting" does not exist at character 158
2021-07-28 07:24:57.886 UTC [84] STATEMENT:  SELECT "conf_setting"."id", "conf_setting"."created", "conf_setting"."modified", "conf_setting"."key", "conf_setting"."value", "conf_
setting"."user_id" FROM "conf_setting" WHERE ("conf_setting"."key" IN ('ACTIVITY_STREAM_ENABLED', 'ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC', 'ORG_ADMINS_CAN_SEE_ALL_USERS', 'M
ANAGE_ORGANIZATION_AUTH', 'TOWER_URL_BASE', 'REMOTE_HOST_HEADERS', 'PROXY_IP_ALLOWED_LIST', 'LICENSE', 'REDHAT_USERNAME', 'REDHAT_PASSWORD', 'SUBSCRIPTIONS_USERNAME', 'SUBSCRIPTI
ONS_PASSWORD', 'AUTOMATION_ANALYTICS_URL', 'INSTALL_UUID', 'DEFAULT_EXECUTION_ENVIRONMENT', 'CUSTOM_VENV_PATHS', 'AD_HOC_COMMANDS', 'ALLOW_JINJA_IN_EXTRA_VARS', 'AWX_PROOT_BASE_P
ATH', 'AWX_PROOT_HIDE_PATHS', 'AWX_PROOT_SHOW_PATHS', 'AWX_ISOLATED_CHECK_INTERVAL', 'AWX_ISOLATED_LAUNCH_TIMEOUT', 'AWX_ISOLATED_CONNECTION_TIMEOUT', 'AWX_ISOLATED_HOST_KEY_CHEC
KING', 'AWX_ISOLATED_KEY_GENERATION', 'AWX_ISOLATED_PRIVATE_KEY', 'AWX_ISOLATED_PUBLIC_KEY', 'AWX_RESOURCE_PROFILING_ENABLED'
cnu80 commented 2 years ago

I have the same error, but when I open the web interface with a "private tab", it is working as expected. Maybe some cookies lying around ?!