I am trying to create a docker-compose
stack with pg
and pgadmin
as follows,
version: '3.1'
services:
pg-admin:
image: dpage/pgadmin4
volumes:
- /Users/pkaramol/Desktop/backup.tar:/pgadmin4/dvdrental.tar
ports:
- "8181:80"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: 1234
depends_on:
- pg
pg:
image: postgres:12
volumes:
- ./pg-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: always
but pgadmin
logs error out as follows:
pg-admin_1 | Traceback (most recent call last):
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1811, in full_dispatch_request
pg-admin_1 | rv = self.preprocess_request()
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2087, in preprocess_request
pg-admin_1 | rv = func()
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask_wtf/csrf.py", line 224, in csrf_protect
pg-admin_1 | self.protect()
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask_wtf/csrf.py", line 259, in protect
pg-admin_1 | self._error_response(e.args[0])
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask_wtf/csrf.py", line 302, in _error_response
pg-admin_1 | raise CSRFError(reason)
pg-admin_1 | flask_wtf.csrf.CSRFError: 400 Bad Request: The CSRF session token is missing.
Any suggestions?
Invalid or missing CSRF token This error message means that your browser couldn't create a secure cookie, or couldn't access that cookie to authorize your login. This can be caused by ad- or script-blocking plugins, but also by the browser itself if it's not allowed to set cookies.
PgAdmin Docker Setup: Docker Images and Docker Compose. PgAdmin Docker Setup: Creating The Docker Compose File. PgAdmin Docker Setup: Verification of Docker Connection. PgAdmin Docker Setup: Set up the PostgreSQL Connection.
Make sure that you close tab that were connected to pgAdmin before start the container.
Maybe you are running multiple instances of pgAdmin on the same host? At least for us this was the problem. Shutting down one of them resolved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With