pgAdmin4 startet nicht mehr

Hallo zusammen,
nach kürzlichem Update auf pgAdmin 4.19 und python 3.8 startet pgAdmin nicht kehr. Ich bekomme folgende Fehlermeldung:

ImportError: cannot import name ‘default_render_json’ from ‘flask_security.views’ (/usr/lib/python3.8/site-packages/flask_security/views.py)

Bin ich allein?

Danke für Rückmeldungen

Hallo HFSuse,

Zuerst Entschuldigung für meinem schlechten Deutsch, ich bin Franzose.
Du bist warscheinlich nicht allein, aber vielleicht sind wir nicht so viele, pgAdmin4 anzuwenden.
pgAdmin4 wirkt für mich auch nicht seit dem Update von Python, aber die Symptoms sind andere.
Ich bekomme die Nachricht, dass der Server nicht erreicht geworden könnte. Wenn ich noch einmal versuche, habe ich dann ein Dialogfenster, um den Weg zum Browser einzustellen. Danach wirkt es leider nicht besser.
Ich hoffe, dass die nächsten Updates diese Probleme lösen werden. Ich wollte phpPgAdmin installieren, aber es funktioniert gar nicht.
Viele Grüsse !

Hallo Voronamanga,
Dein Deutsch ist besser als mein Französich. :wink:
So- let’s continue in English.
Thanks for the massage. At least it shows that it’s not hopeless waiting for the next uptates.

My errror-message is from the logfile not from the message-box. Look at ‘View log’ with right-klick on the elephant in the sys-tray.

phpPgAdmin doesn’t work for me either. So back to the console and psql and wait for mitigation.

Greetings

Hallo HFSuse,

Thanks for your kind reply. OK I’ll try the right-click out this evening - I’m at work for the moment (Reunion Island : GMT+4). I remember that I got that kind of message like yours when I tried to launch pgAdmin4 as su in a terminal, but anyway it was not the good method so I didn’t take care that much.

pgAdmin4 was rebuilt very recently, because on sunday it wasn’t yet available, but now that it’s done I wonder if we should file a bug ; I’ll wait a couple of days but I really need it because I have some sites in development and I can’t rely only on the phpPgAdmin of my provider’s Cpanel. Fortunately I still have a machine here which is not updated, but I work on internet sites mostly at home.

Have a good day and take care of yourself !

Hallo HFSuse,

I’m really glad that you made me focus my attention on this error message. I had the same, and it showed the way to get out of the problem. Nevertheless, I’ll file a bug, because it’s a bug - a tiny one.

So the last lines are :

    File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/browser/__init__.py", line 32, in <module>
        from flask_security.views import _security, _commit, default_render_json, _ctx
ImportError: cannot import name 'default_render_json' from 'flask_security.views' (/usr/lib/python3.8/site-packages/flask_security/views.py)

If you edit /usr/lib/python3.8/site-packages/flask_security/views.py, you’ll see that there is actually no definition for default_render_json, but there’s one for _render_json.

So you go to /usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/browser/init.py (I hope I made no typo), you edit it as su and you simply replace on line 32 default_render_json with _render_json. Register the file and launch pgAdmin4.

Nun muss es starten ! Wir haben es zusammen gelöst.

Hi Voronamanga,

Great!!! - Just made the modification and now it works.

As I am not fit with Python, I would never had a chance without your help. Merci beaucoup.
Maybe I ought to spend some time with Python ;-).

Is there a forum to report this bug?

Greetings

Bonjour HFSuse,

Ich freue mich sehr, dass es fûr dich auch werken konnte.

I’m not that much experienced in Python (a lot of valuable tutos and complete trainings on the web), but it’s not very different from other programmation languages. I just noticed, after your remark, that there was an unsuccessful call from a file to another one, so I looked for the name it was looking for, and as there was none but just a similar one, I did’nt want to leave without trying to rename the function. Beyond that, I couldn’t have done more.

I already filed a bug : #1166991 on https://bugzilla.opensuse.org.

Be careful during updates, because for the moment this version of pgAdmin4 has been dropped out of the repo. I think we’ll have to wait a couple of days before the official package comes back.

Thanks for the reputation bonus ! Take care of yourself.