ankane / pghero

A performance dashboard for Postgres
MIT License
8.15k stars 452 forks source link

Static assets stopped working suddenly #141

Closed peterbe closed 7 years ago

peterbe commented 7 years ago

I haven't used pghero for a couple of weeks and checked in today. It loads fine but the .js and .css are 404'ing. I can curl it just fine, on the server, like this:

curl http://localhost:6000/ | less

And it gives a regular pghero HTML thing and at the top it mentions:

...
    <title>PgHero / Overview</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" media="screen" href="/assets/pghero/application-c2618b70600dfedb0f3ba1f916d97a2f93a3f265aba10356abb763bd663d0cbd.css" />
    <script src="/assets/pghero/application-3807e140de3bf52364d575c9c1cba1ed730999b53e2781da4bf8bb15b01791bf.js"></script>
...

But those assets don't work. E.g.

# curl -v http://localhost:6000/assets/pghero/application-3807e140de3bf52364d575c9c1cba1ed730999b53e2781da4bf8bb15b01791bf.js
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 6000 (#0)
> GET /assets/pghero/application-3807e140de3bf52364d575c9c1cba1ed730999b53e2781da4bf8bb15b01791bf.js HTTP/1.1
> Host: localhost:6000
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: text/html; charset=UTF-8
< X-Request-Id: f04877e1-ccfb-42ad-98ad-6cac83e0eecf
< X-Runtime: 0.002098
< Content-Length: 0
<
* Connection #0 to host localhost left intact

It's been a while since I installed this on Ubuntu 16.04 DigitialOcean server. I think I followed these instructions: https://github.com/ankane/pghero/blob/master/guides/Linux.md#ubuntu-1604-xenial

I don't know what version I have installed but the package has a version:

# apt show pghero
Package: pghero
Version: 2.0.4-1503936983.426e4cdb.xenial
Priority: extra
Section: default
Maintainer: support@packager.io
Installed-Size: 148 MB
Provides: pghero
Depends: libpq5, libxml2, libxslt1.1
Homepage: http://example.com/no-uri-given
License: unknown
Vendor: Packager.io <https://packager.io>
Download-Size: 40.2 MB
APT-Manual-Installed: yes
APT-Sources: https://deb.packager.io/gh/pghero/pghero xenial/master amd64 Packages
Description: A performance dashboard for Postgres

N: There are 65 additional records. Please use the '-a' switch to see them.

Also, I'm not entirely sure how else to find information about my installed version:

root@songsearch-1473901544357-2-2gb-nyc1-01:~# pghero --help
Usage:
  pghero run COMMAND [options]
  pghero scale TYPE=NUM
  pghero logs [--tail|-n NUMBER]
  pghero config:get VAR
  pghero config:set VAR=VALUE
  pghero configure
  pghero reconfigure
root@songsearch-1473901544357-2-2gb-nyc1-01:~# pghero logs
==> /var/log/pghero/*.log <==
cat: '/var/log/pghero/*.log': No such file or directory
root@songsearch-1473901544357-2-2gb-nyc1-01:~# pghero run help
sh: 1: exec: help: Permission denied
root@songsearch-1473901544357-2-2gb-nyc1-01:~# pghero run --help
sh: 1: exec: --help: Permission denied
ankane commented 7 years ago

Hey @peterbe, it looks like you're on the latest version (2.0.4). My hunch is PgHero was updated without being restarted. Try running:

sudo service pghero restart
peterbe commented 7 years ago

That certainly did the trick. Now it works. I'll leave it to you to decide whether to keep this as an issue or if you want to ping the debian packagers. :)

ankane commented 7 years ago

The upgrade instructions in the readme include the need to restart, so think that's fine for now.