skip to Main Content

I pretty much followed this post to set up pgadmin 4 on my ubuntu 16.04, I skipped the 1st step which installs PostgreSql, since I would like to use AWS RDS. But when I tried to launch http://myipaddress/pgadmin4/, I got 500 Internal Server Error. http://myipaddress did get me to the Apache2 Ubuntu Default Page, not sure what configuration I am missing.

I also followed this and added the suggested fix, but it doesn’t work for me.

Here is the error in the error.log

[wsgi:warn] [pid 19605:tid 140528707069824] mod_wsgi: Compiled for Python/3.5.1+.  
[wsgi:warn] [pid 19605:tid 140528707069824] mod_wsgi: Runtime using Python/3.5.2.  
[mpm_event:notice] [pid 19605:tid 140528707069824] AH00489: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/3.5.2 configured -- resuming normal operations  
[core:notice] [pid 19605:tid 140528707069824] AH00094: Command line: '/usr/sbin/apache2'  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0] mod_wsgi (pid=19608): Exception occurred processing WSGI script '/usr/share/pgadmin4/web/pgAdmin4.wsgi'.  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0] Traceback (most recent call last):  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0]   File "/usr/lib/python3/dist-packages/flask/app.py", line 1836, in __call__  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0]     return self.wsgi_app(environ, start_response)  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0]   File "/usr/share/pgadmin4/web/pgAdmin4.py", line 95, in __call__  
[pid 19608:tid 140528601200384] [remote 8.28.16.254:0]     return self.app(environ, start_response)  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0] AttributeError: 'ReverseProxied' object has no attribute 'app'

2

Answers


  1. I had exactly the same problem as you did and I tried to fix as per those links above as well, and this is what I did wrong: when I was editing /usr/share/pgadmin4/web/pgAdmin4.py I mistakenly put the plus symbol before self.app = app

     class ReverseProxied(object):
         def __init__(self, app):
             # https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
    +        self.app = app
             try:
                 from werkzeug.middleware.proxy_fix import ProxyFix
                 self.app = ProxyFix(app
    

    once I put

     class ReverseProxied(object):
         def __init__(self, app):
             # https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
             self.app = app
             try:
                 from werkzeug.middleware.proxy_fix import ProxyFix
                 self.app = ProxyFix(app
    

    pgAdmin4 worked fine after system reboot. The + symbol is diff’s command way to let user know about the differences between files being compared – that is what confused me. This solved my problem.

    Login or Signup to reply.
  2. I don’t have the +symbol. For some reason, my indentation was messed up. Once I fixed it, it works fine.

      File "/usr/share/pgadmin4/web/pgAdmin4.py", line 83
        except ImportError:
                          ^
    IndentationError: unindent does not match any outer indentation level
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search