Project

Profile

Help

Issue #7366

closed

Getting 404 for static assets

Added by fao89 over 3 years ago. Updated over 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
Installer - Moved to GitHub issues
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 80
Quarter:

Description

https://pulp3-source-fedora32.localhost.example.com/assets/rest_framework/js/jquery-3.3.1.min.js

or

http://pulp3-source-fedora32.localhost.example.com/assets/rest_framework/js/jquery-3.3.1.min.js

Aug 21 14:45:44 pulp3-source-fedora32.localhost.example.com gunicorn[42557]: 127.0.0.1 - - [21/Aug/2020:14:45:44 +0000] "GET /assets/rest_framework/js/default.js HTTP/1.0" 404 

(pulp) [vagrant@pulp3-source-fedora32 ~]$ http :24817/assets/rest_framework/js/default.js
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Fri, 21 Aug 2020 14:47:33 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

(pulp) [vagrant@pulp3-source-fedora32 ~]$ http :/assets/rest_framework/js/default.js
HTTP/1.1 404 Not Found
Connection: keep-alive
Content-Length: 77
Content-Type: text/html
Date: Fri, 21 Aug 2020 14:47:45 GMT
Server: nginx/1.18.0
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>


Actions #1

Updated by fao89 over 3 years ago

  • Subject changed from Getting 404 for static assets when using https to Getting 404 for static assets
  • Description updated (diff)
Actions #2

Updated by fao89 over 3 years ago

  • Description updated (diff)
Actions #3

Updated by mdepaulo@redhat.com over 3 years ago

On a CentOS 7 molecule container (what I currently have running), this is working:

root@centos-7 /]# http --verify=no https://localhost:443/assets/rest_framework/js/default.js
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: max-age=60, public
Connection: keep-alive
Content-Length: 1268
Content-Type: text/javascript; charset="utf-8"
Date: Fri, 21 Aug 2020 15:40:24 GMT
ETag: "5f3eccc8-4f4"
Last-Modified: Thu, 20 Aug 2020 19:19:36 GMT
Server: nginx/1.16.1

$(document).ready(function() {
  // JSON highlighting.
  prettyPrint();
...
Actions #4

Updated by mdepaulo@redhat.com over 3 years ago

Perhaps this is a Fedora 32 issue?

Based on the draft RAM test results, we are only using 3 out of 7 GB of RAM in CI when testing 4 containers/distros at a time. We should add Fedora 32: https://github.com/pulp/pulp_installer/pull/401/checks?check_run_id=1009476973#step:9:5607

Actions #5

Updated by fao89 over 3 years ago

  • Category deleted (Installer - Moved to GitHub issues)

This was not on installer side, it is whitenoise

[vagrant@pulp3-source-fedora31 ~]$ workon pulp
(pulp) [vagrant@pulp3-source-fedora31 ~]$ http :24817/assets/rest_framework/js/default.js
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Fri, 21 Aug 2020 21:49:07 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

(pulp) [vagrant@pulp3-source-fedora31 ~]$ pip list | grep whitenoise
whitenoise                      5.2.0
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the '/usr/local/lib/pulp/bin/python3 -m pip install --upgrade pip' command.
(pulp) [vagrant@pulp3-source-fedora31 ~]$ pip install whitenoise==5.1.0
Collecting whitenoise==5.1.0
  Downloading whitenoise-5.1.0-py2.py3-none-any.whl (19 kB)
Installing collected packages: whitenoise
  Attempting uninstall: whitenoise
    Found existing installation: whitenoise 5.2.0
    Uninstalling whitenoise-5.2.0:
      Successfully uninstalled whitenoise-5.2.0
Successfully installed whitenoise-5.1.0
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the '/usr/local/lib/pulp/bin/python3 -m pip install --upgrade pip' command.
(pulp) [vagrant@pulp3-source-fedora31 ~]$ prestart
systemctl restart pulpcore-content pulpcore-worker@1 pulpcore-worker@2 pulpcore-resource-manager pulpcore-api
(pulp) [vagrant@pulp3-source-fedora31 ~]$ http :24817/assets/rest_framework/js/default.js
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: max-age=60, public
Connection: close
Content-Length: 1268
Content-Type: application/javascript; charset="utf-8"
Date: Fri, 21 Aug 2020 21:49:53 GMT
ETag: "5f403dca-4f4"
Last-Modified: Fri, 21 Aug 2020 21:34:02 GMT
Server: gunicorn/20.0.4

$(document).ready(function() {
  // JSON highlighting.
  prettyPrint();

  // Bootstrap tooltips.
  $('.js-tooltip').tooltip({
    delay: 1000,
    container: 'body'
  });

  // Deal with rounded tab styling after tab clicks.
  $('a[data-toggle="tab"]:first').on('shown', function(e) {
    $(e.target).parents('.tabbable').addClass('first-tab-active');
  });

  $('a[data-toggle="tab"]:not(:first)').on('shown', function(e) {
    $(e.target).parents('.tabbable').removeClass('first-tab-active');
  });

  $('a[data-toggle="tab"]').click(function() {
    document.cookie = "tabstyle=" + this.name + "; path=/";
  });

  // Store tab preference in cookies & display appropriate tab on load.
  var selectedTab = null;
  var selectedTabName = getCookie('tabstyle');

  if (selectedTabName) {
    selectedTabName = selectedTabName.replace(/[^a-z-]/g, '');
  }

  if (selectedTabName) {
    selectedTab = $('.form-switcher a[name=' + selectedTabName + ']');
  }

  if (selectedTab && selectedTab.length > 0) {
    // Display whichever tab is selected.
    selectedTab.tab('show');
  } else {
    // If no tab selected, display rightmost tab.
    $('.form-switcher a:first').tab('show');
  }

  $(window).on('load', function() {
    $('#errorModal').modal('show');
  });
});

Actions #6

Updated by fao89 over 3 years ago

  • Category set to Installer - Moved to GitHub issues

I changed whitenoise version, restarted my box and got the same error, so it is not the whitenoise version, somehow the installer has some conflict with whitenoise. I can only see the statics if I re-install whitenoise and do a prestart:

(pulp) [vagrant@pulp3-source-fedora31 ~]$ pip list | grep whitenoise
whitenoise                      5.1.0
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the '/usr/local/lib/pulp/bin/python3 -m pip install --upgrade pip' command.
(pulp) [vagrant@pulp3-source-fedora31 ~]$ http :24817/assets/rest_framework/js/default.js
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Mon, 24 Aug 2020 16:52:55 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

(pulp) [vagrant@pulp3-source-fedora31 ~]$ pip install -U whitenoise
Collecting whitenoise
  Downloading whitenoise-5.2.0-py2.py3-none-any.whl (19 kB)
ERROR: pulpcore 3.7.0.dev0 has requirement whitenoise<5.2.0,>=5.0.0, but you'll have whitenoise 5.2.0 which is incompatible.
Installing collected packages: whitenoise
  Attempting uninstall: whitenoise
    Found existing installation: whitenoise 5.1.0
    Uninstalling whitenoise-5.1.0:
      Successfully uninstalled whitenoise-5.1.0
Successfully installed whitenoise-5.2.0
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the '/usr/local/lib/pulp/bin/python3 -m pip install --upgrade pip' command.
(pulp) [vagrant@pulp3-source-fedora31 ~]$ pip list | grep whitenoise
whitenoise                      5.2.0
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the '/usr/local/lib/pulp/bin/python3 -m pip install --upgrade pip' command.
(pulp) [vagrant@pulp3-source-fedora31 pulpcore]$ prestart
systemctl restart pulpcore-content pulpcore-worker@1 pulpcore-worker@2 pulpcore-worker@3 pulpcore-worker@4 pulpcore-resource-manager pulpcore-api
(pulp) [vagrant@pulp3-source-fedora31 pulpcore]$ http :24817/assets/rest_framework/js/default.js
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: max-age=60, public
Connection: close
Content-Length: 1268
Content-Type: text/javascript; charset="utf-8"
Date: Mon, 24 Aug 2020 16:55:34 GMT
ETag: "5f43ddcd-4f4"
Last-Modified: Mon, 24 Aug 2020 15:33:33 GMT
Server: gunicorn/20.0.4

$(document).ready(function() {
  // JSON highlighting.
  prettyPrint();

  // Bootstrap tooltips.
  $('.js-tooltip').tooltip({
    delay: 1000,
    container: 'body'
  });

  // Deal with rounded tab styling after tab clicks.
  $('a[data-toggle="tab"]:first').on('shown', function(e) {
    $(e.target).parents('.tabbable').addClass('first-tab-active');
  });

  $('a[data-toggle="tab"]:not(:first)').on('shown', function(e) {
    $(e.target).parents('.tabbable').removeClass('first-tab-active');
  });

  $('a[data-toggle="tab"]').click(function() {
    document.cookie = "tabstyle=" + this.name + "; path=/";
  });

  // Store tab preference in cookies & display appropriate tab on load.
  var selectedTab = null;
  var selectedTabName = getCookie('tabstyle');

  if (selectedTabName) {
    selectedTabName = selectedTabName.replace(/[^a-z-]/g, '');
  }

  if (selectedTabName) {
    selectedTab = $('.form-switcher a[name=' + selectedTabName + ']');
  }

  if (selectedTab && selectedTab.length > 0) {
    // Display whichever tab is selected.
    selectedTab.tab('show');
  } else {
    // If no tab selected, display rightmost tab.
    $('.form-switcher a:first').tab('show');
  }

  $(window).on('load', function() {
    $('#errorModal').modal('show');
  });
});

Actions #7

Updated by fao89 over 3 years ago

Actually just prestart solves the problem, it is probably a handler issue

Actions #8

Updated by fao89 over 3 years ago

(pulp) [vagrant@pulp3-source-fedora31 ~]$ http :24817/assets/rest_framework/js/default.js
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Mon, 24 Aug 2020 16:52:55 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

(pulp) [vagrant@pulp3-source-fedora31 pulpcore]$ sudo systemctl restart pulpcore-api
(pulp) [vagrant@pulp3-source-fedora31 pulpcore]$ http :24817/assets/rest_framework/js/default.js
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: max-age=60, public
Connection: close
Content-Length: 1268
Content-Type: text/javascript; charset="utf-8"
Date: Mon, 24 Aug 2020 16:55:34 GMT
ETag: "5f43ddcd-4f4"
Last-Modified: Mon, 24 Aug 2020 15:33:33 GMT
Server: gunicorn/20.0.4

$(document).ready(function() {
  // JSON highlighting.
  prettyPrint();

  // Bootstrap tooltips.
  $('.js-tooltip').tooltip({
    delay: 1000,
    container: 'body'
  });

  // Deal with rounded tab styling after tab clicks.
  $('a[data-toggle="tab"]:first').on('shown', function(e) {
    $(e.target).parents('.tabbable').addClass('first-tab-active');
  });

  $('a[data-toggle="tab"]:not(:first)').on('shown', function(e) {
    $(e.target).parents('.tabbable').removeClass('first-tab-active');
  });

  $('a[data-toggle="tab"]').click(function() {
    document.cookie = "tabstyle=" + this.name + "; path=/";
  });

  // Store tab preference in cookies & display appropriate tab on load.
  var selectedTab = null;
  var selectedTabName = getCookie('tabstyle');

  if (selectedTabName) {
    selectedTabName = selectedTabName.replace(/[^a-z-]/g, '');
  }

  if (selectedTabName) {
    selectedTab = $('.form-switcher a[name=' + selectedTabName + ']');
  }

  if (selectedTab && selectedTab.length > 0) {
    // Display whichever tab is selected.
    selectedTab.tab('show');
  } else {
    // If no tab selected, display rightmost tab.
    $('.form-switcher a:first').tab('show');
  }

  $(window).on('load', function() {
    $('#errorModal').modal('show');
  });
});

Actions #9

Updated by fao89 over 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89
  • Sprint set to Sprint 81
Actions #10

Updated by pulpbot over 3 years ago

  • Status changed from ASSIGNED to POST

Added by Fabricio Aguiar over 3 years ago

Revision 9b02af20 | View on GitHub

Restart services after collect static

https://pulp.plan.io/issues/7366 closes #7366

Added by Fabricio Aguiar over 3 years ago

Revision 9b02af20 | View on GitHub

Restart services after collect static

https://pulp.plan.io/issues/7366 closes #7366

Actions #11

Updated by Anonymous over 3 years ago

  • Status changed from POST to MODIFIED
Actions #12

Updated by rchan over 3 years ago

  • Sprint changed from Sprint 81 to Sprint 80

fixing Sprint - 80 is current. 81 is reserved for next sprint.

Actions #13

Updated by ttereshc over 3 years ago

  • Sprint/Milestone set to 3.8.0
Actions #14

Updated by ttereshc over 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF