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

Web UI not working in v5 after installing through pip/pipx #233

Closed
krynju opened this issue Nov 21, 2024 · 14 comments
Closed

Web UI not working in v5 after installing through pip/pipx #233

krynju opened this issue Nov 21, 2024 · 14 comments

Comments

@krynju
Copy link

krynju commented Nov 21, 2024

I had to fall back to pipx install, because v5 isn't available through apt and everything else there is already on v5 and can't get it to work.

Logs when trying to open the page:

[I 241121 12:45:50 web:2348] 302 GET / (172.18.0.1) 0.50ms
[W 241121 12:45:50 web:1873] 500 GET /login/?next=%2F (172.18.0.1): manifest.json doesn't exist, did you run `npm run build`?
[E 241121 12:45:50 web:2348] 500 GET /login/?next=%2F (172.18.0.1) 3.83ms

I get 500s/404s all the time

@rjuju
Copy link
Member

rjuju commented Nov 21, 2024

Hi,

Yes unfortunately there are still a few issues that needs to be fixed, this one included, before we can release version 5.0.1.

If you have npm available on that machine, you could run

npm ci
npm run build

to build all the assets locally. If that's not an option and if you can instead rely on git / zip image I could push the missing assets right now.

@krynju
Copy link
Author

krynju commented Nov 21, 2024

I'm adding this to a dockerfile. Will switch to git clone and manual build then, thanks!

@rjuju
Copy link
Member

rjuju commented Nov 21, 2024

Ok, let us know if you face any other problem!

@rjuju
Copy link
Member

rjuju commented Nov 21, 2024

Oh I forgot to mention, we do provide a powa-web-git container image (https://hub.docker.com/r/powateam/powa-web-git) that is rebuilt at each commit and automatically build all the assets, so you could also use this one in the meantime.

@krynju
Copy link
Author

krynju commented Nov 21, 2024

manual install and the docker image you linked both hit another issue immediatelly after login

[I 241121 13:43:47 web:2348] 302 POST /login/?next=%2F (172.18.0.1) 8.87ms
[I 241121 13:43:47 web:2348] 302 GET / (172.18.0.1) 6.31ms
[I 241121 13:43:47 web:2348] 200 GET /server/ (172.18.0.1) 13.44ms
[E 241121 13:43:47 web:1875] Uncaught exception GET /server/ (172.18.0.1)
    HTTPServerRequest(protocol='http', host='localhost:5556', method='GET', uri='/server/', version='HTTP/1.1', remote_ip='172.18.0.1')
    Traceback (most recent call last):
      File "/usr/local/src/powa-web.git/powa/framework.py", line 82, in execute
        return super(CustomCursor, self).execute(query, params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    psycopg2.errors.AmbiguousFunction: function unnest(unknown) is not unique
    LINE 2:                     SELECT unnest('{}')
                                       ^
    HINT:  Could not choose a best candidate function. You might need to add explicit type casts.


    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/tornado/web.py", line 1788, in _execute
        result = method(*self.path_args, **self.path_kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/src/powa-web.git/powa/dashboards.py", line 116, in get
        handler=self.to_json(),
                ^^^^^^^^^^^^^^
      File "/usr/local/src/powa-web.git/powa/framework.py", line 765, in to_json
        **super(AuthHandler, self).to_json(),
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/src/powa-web.git/powa/framework.py", line 744, in to_json
        "notifyAllowed": self.notify_allowed,
                         ^^^^^^^^^^^^^^^^^^^
      File "/usr/local/src/powa-web.git/powa/dashboards.py", line 153, in notify_allowed
        cur.execute(
      File "/usr/local/src/powa-web.git/powa/framework.py", line 84, in execute
        log_query(self, query, params, e)
      File "/usr/local/src/powa-web.git/powa/framework.py", line 108, in log_query
        fmt.format(
    IndexError: Replacement index 0 out of range for positional args tuple
[E 241121 13:43:47 web:2348] 500 GET /server/ (172.18.0.1) 10.39ms

@rjuju
Copy link
Member

rjuju commented Nov 21, 2024

Are you using postgres 13 or lower? Those older versions have 2 known bugs, this one (#220) and also #221

@krynju
Copy link
Author

krynju commented Nov 21, 2024

Yes, I'm on 13.17. Hitting #220 I guess

@mbanck-ntap
Copy link

I guess the installation instructions on https://powa.readthedocs.io/en/latest/components/powa-web/index.html#manual-install need a massive overhaul as well

@rjuju
Copy link
Member

rjuju commented Nov 22, 2024

@krynju I just pushed fixes for #220 and #221. I tested a bit the UI with postgres 13 and didn't notice any other problem so hopefully it's ok, but there are a lot of scenario possible when mixing the various extension so you might hit other problem. If that's the case feel free to report them.

@krynju
Copy link
Author

krynju commented Nov 22, 2024

Thanks! I did just try out the latest image and it seems to work as expected!

I think I'm hitting this issue now now as I don't get many of the predicates populated in index suggestions and I do have many arguments in my queries (not only in where/join)
I do see all the stats though and that's more important to me

I'll leave this issue open, because the original issue was about pip/pipx install and that's not fixed so feel free to close anytime that's done

@rjuju
Copy link
Member

rjuju commented Nov 22, 2024

Thanks! I did just try out the latest image and it seems to work as expected!

Very good news, thanks a lot for testing and the confirmation!

I think I'm hitting powa-team/pg_qualstats#41 now as I don't get many of the predicates populated in index suggestions and I do have many arguments in my queries (not only in where/join)

Yes this is a very common limitation. We have some plans on improving that. One is to rely on the new GENERIC_PLAN option of EXPLAIN, to at least be able to test a suggested index even without the predicate values. Bbut that unfortunately won't work for you as it's for pg16+ (#216). I'm wondering if we could teach pg_qualstats to extract the values from the parameters too, which would help for scenario like extended protocol. All of that will probably be worked on after powa 5 is stabilized, which hopefully won't take too long.

I'll leave this issue open, because the original issue was about pip/pipx install and that's not fixed so feel free to close anytime that's done

Definitely, that's a good reminder to not mess up again for the next release, thanks a lot!

@GChuf
Copy link

GChuf commented Nov 26, 2024

The package installed with "apt" is simply missing the "dist" directory.
on my ubuntu system powa-web binary wants directory to exist here:
/usr/lib/python3/dist-packages/powa/static/dist

but all that exists under static is "img" folder. dist is missing.

workaround for people able to build frontend asssets is to copy the dist folder inside /usr/lib/python3/dist-packages/powa/static/.
however this should have never happened in a published package.
Include the dist folder asap and publish 5.0.1.

@pgiraud
Copy link
Member

pgiraud commented Nov 26, 2024

@GChuf we're very sorry about that. This has already been taken into account and a new release publish is in process. See #238

@rjuju
Copy link
Member

rjuju commented Dec 8, 2024

Hi,

Version 5.0.1 is now ready and was pushed a few minutes ago, so pip install should now work out of the box.

@rjuju rjuju closed this as completed Dec 13, 2024
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