Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static assets not being created #470

Closed
Just-Insane opened this issue Jul 17, 2021 · 4 comments
Closed

static assets not being created #470

Just-Insane opened this issue Jul 17, 2021 · 4 comments

Comments

@Just-Insane
Copy link

ISSUE TYPE
  • Bug Report
SUMMARY

When trying to launch AWX in any configuration of persistent or non-persistent storage, the directories and files within /var/lib/awx are not created.

ENVIRONMENT
  • AWX version: 2.10.9
  • Operator version: 0.12.0
  • Kubernetes version: 1.20.6
  • AWX install method: Rancher RKE
STEPS TO REPRODUCE

Create a new AWX instance with the following config:

apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  service_type: LoadBalancer
  ingress_type: none
  hostname: awx.domain.com
  task_privileged: true
  image_pull_policy: Always
  projects_persistence: true
  projects_storage_class: longhorn
  projects_storage_size: 8Gi

or:

apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  service_type: LoadBalancer
  ingress_type: none
  hostname: awx.domain.com
EXPECTED RESULTS

Once the pod is up and running, should be able to hit the loadbalancer/ClusterIP/NodePort to access the AWX WebUI.

ACTUAL RESULTS

A 404 is returned, with the following logs:

2021/07/17 00:32:27 [error] 23#0: *7 open() "/var/lib/awx/public/static/css/2.687a9035.chunk.css" failed (2: No such file or directory), client: 127.0.0.1, server: _, request: "GET /static/css/2.687a9035.chunk.css HTTP/1.1", host: "10.0.40.62", referrer: "http://10.0.40.62/"
127.0.0.1 - - [17/Jul/2021:00:32:27 +0000] "GET /static/css/2.687a9035.chunk.css HTTP/1.1" 404 162 "http://10.0.40.62/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15" "-"
127.0.0.1 - - [17/Jul/2021:00:32:27 +0000] "GET /static/css/main.e189280d.chunk.css HTTP/1.1" 404 162 "http://10.0.40.62/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15" "-"
2021/07/17 00:32:27 [error] 23#0: *7 open() "/var/lib/awx/public/static/css/main.e189280d.chunk.css" failed (2: No such file or directory), client: 127.0.0.1, server: _, request: "GET /static/css/main.e189280d.chunk.css HTTP/1.1", host: "10.0.40.62", referrer: "http://10.0.40.62/"
127.0.0.1 - - [17/Jul/2021:00:32:27 +0000] "GET /static/js/2.53c634ac.chunk.js HTTP/1.1" 404 162 "http://10.0.40.62/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15" "-"
127.0.0.1 - - [17/Jul/2021:00:32:27 +0000] "GET /static/js/runtime-main.7202f99a.js HTTP/1.1" 404 162 "http://10.0.40.62/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15" "-"
127.0.0.1 - - [17/Jul/2021:00:32:27 +0000] "GET /static/js/main.6ab990a9.chunk.js HTTP/1.1" 404 162 "http://10.0.40.62/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15" "-"
2021/07/17 00:32:27 [error] 23#0: *9 open() "/var/lib/awx/public/static/js/2.53c634ac.chunk.js" failed (2: No such file or directory), client: 127.0.0.1, server: _, request: "GET /static/js/2.53c634ac.chunk.js HTTP/1.1", host: "10.0.40.62", referrer: "http://10.0.40.62/"
2021/07/17 00:32:27 [error] 23#0: *7 open() "/var/lib/awx/public/static/js/runtime-main.7202f99a.js" failed (2: No such file or directory), client: 127.0.0.1, server: _, request: "GET /static/js/runtime-main.7202f99a.js HTTP/1.1", host: "10.0.40.62", referrer: "http://10.0.40.62/"
2021/07/17 00:32:27 [error] 23#0: *10 open() "/var/lib/awx/public/static/js/main.6ab990a9.chunk.js" failed (2: No such file or directory), client: 127.0.0.1, server: _, request: "GET /static/js/main.6ab990a9.chunk.js HTTP/1.1", host: "10.0.40.62", referrer: "http://10.0.40.62/"
ADDITIONAL INFORMATION

Upon investigation, by default with the 0.12.0 release, /var/lib/awx does not exist. Using the workaround specified in #357 (comment) by forking the AWX-Operator repo and modifying the specified file, the /var/lib/awx folder exists, but the /var/lib/awx/public folder still does not exist, though other folders are created as expected:

image

The same error about files in /var/lib/awx/public can still be seen in the awx-web container logs.

AWX-OPERATOR LOGS

Will be provided upon request due to length.

@phospi
Copy link

phospi commented Jul 20, 2021

same issue here. I fixed it. I stumbled across the following issue: awx-container

Going to the container bash and adding the symlink, fixed it (temporarily, of course):

ln -s /var/lib/awx/venv/awx/lib/python3.8/site-packages/awx/ui_next/build/static /var/lib/awx/public/static

@koshrf
Copy link

koshrf commented Jul 21, 2021

I can confirm this, having the same issue, making it impossible to use at this poing.

2021/07/21 13:59:41 [error] 24#0: *14 open() "/var/lib/awx/public/static/js/runtime-main.7202f99a.js" failed (2: No such file or directory), client: 10.42.0.36, server: _, request: "GET /static/ js/runtime-main.7202f99a.js HTTP/1.1", host: "xyz.myserverurl.com"

Adding a ln to the container doesnt help much, if the container goes down it will lose the change.

@coolbry95
Copy link

This could be fixed by this PR. ansible/awx#10583

Sometimes the database isn't ready right away and then the awx-manage collectstatic command fails because it depends on the database.

@shanemcd
Copy link
Member

This should be resolved by the PR linked above, and will go out in the next release of AWX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants