SleepProgger
2018-11-05 13:43:35 UTC
Hi all.
When trying to use any of the maintenance features (right click on table
-> maintenance) i get a "Maintenance job creation failed." popup.
~/.pgadmin/pgadmin4.log says:
|2018-11-05 14:35:43,015: ERROR werkzeug: Error on request:||
||Traceback (most recent call last):||
|| File "/usr/lib/python3.7/site-packages/werkzeug/serving.py", line
270, in run_wsgi||
|| execute(self.server.app)||
|| File "/usr/lib/python3.7/site-packages/werkzeug/serving.py", line
258, in execute||
|| application_iter = app(environ, start_response)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1997, in __call__||
|| return self.wsgi_app(environ, start_response)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1985, in wsgi_app||
|| response = self.handle_exception(e)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1540, in handle_exception||
|| reraise(exc_type, exc_value, tb)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/_compat.py",
line 33, in reraise||
|| raise value||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1982, in wsgi_app||
|| response = self.full_dispatch_request()||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1614, in full_dispatch_request||
|| rv = self.handle_user_exception(e)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1517, in handle_user_exception||
|| reraise(exc_type, exc_value, tb)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/_compat.py",
line 33, in reraise||
|| raise value||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1612, in full_dispatch_request||
|| rv = self.dispatch_request()||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1598, in dispatch_request||
|| return self.view_functions[rule.endpoint](**req.view_args)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask_login.py",
line 792, in decorated_view||
|| return func(*args, **kwargs)||
|| File "/usr/lib/pgadmin4/web/pgadmin/tools/maintenance/__init__.py",
line 181, in create_maintenance_job||
|| data = json.loads(data['data'][0], encoding='utf-8')||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/simplejson/__init__.py",
line 535, in loads||
|| return cls(encoding=encoding, **kw).decode(s)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/simplejson/decoder.py",
line 370, in decode||
|| obj, end = self.raw_decode(s)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/simplejson/decoder.py",
line 400, in raw_decode||
|| return self.scan_once(s, idx=_w(s, idx).end())||
||simplejson.errors.JSONDecodeError: Expecting property name enclosed in
double quotes or '}': line 1 column 2 (char 1)|
I tracked this bug down and it looks like the reason is the
'data['data'][0]' in
https://github.com/postgres/pgadmin4/blob/master/web/pgadmin/tools/maintenance/__init__.py#L181
.
The [0] doesn't really make any sense there, and after removing it the
problem was fixed.
PGadmin4 version: 3.4
Browser: 63.0.1 (64-bit)
(Altho i don't think it matters in this case)
When trying to use any of the maintenance features (right click on table
-> maintenance) i get a "Maintenance job creation failed." popup.
~/.pgadmin/pgadmin4.log says:
|2018-11-05 14:35:43,015: ERROR werkzeug: Error on request:||
||Traceback (most recent call last):||
|| File "/usr/lib/python3.7/site-packages/werkzeug/serving.py", line
270, in run_wsgi||
|| execute(self.server.app)||
|| File "/usr/lib/python3.7/site-packages/werkzeug/serving.py", line
258, in execute||
|| application_iter = app(environ, start_response)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1997, in __call__||
|| return self.wsgi_app(environ, start_response)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1985, in wsgi_app||
|| response = self.handle_exception(e)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1540, in handle_exception||
|| reraise(exc_type, exc_value, tb)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/_compat.py",
line 33, in reraise||
|| raise value||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1982, in wsgi_app||
|| response = self.full_dispatch_request()||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1614, in full_dispatch_request||
|| rv = self.handle_user_exception(e)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1517, in handle_user_exception||
|| reraise(exc_type, exc_value, tb)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/_compat.py",
line 33, in reraise||
|| raise value||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1612, in full_dispatch_request||
|| rv = self.dispatch_request()||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask/app.py", line
1598, in dispatch_request||
|| return self.view_functions[rule.endpoint](**req.view_args)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/flask_login.py",
line 792, in decorated_view||
|| return func(*args, **kwargs)||
|| File "/usr/lib/pgadmin4/web/pgadmin/tools/maintenance/__init__.py",
line 181, in create_maintenance_job||
|| data = json.loads(data['data'][0], encoding='utf-8')||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/simplejson/__init__.py",
line 535, in loads||
|| return cls(encoding=encoding, **kw).decode(s)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/simplejson/decoder.py",
line 370, in decode||
|| obj, end = self.raw_decode(s)||
|| File
"/usr/lib/pgadmin4/venv/lib/python3.7/site-packages/simplejson/decoder.py",
line 400, in raw_decode||
|| return self.scan_once(s, idx=_w(s, idx).end())||
||simplejson.errors.JSONDecodeError: Expecting property name enclosed in
double quotes or '}': line 1 column 2 (char 1)|
I tracked this bug down and it looks like the reason is the
'data['data'][0]' in
https://github.com/postgres/pgadmin4/blob/master/web/pgadmin/tools/maintenance/__init__.py#L181
.
The [0] doesn't really make any sense there, and after removing it the
problem was fixed.
PGadmin4 version: 3.4
Browser: 63.0.1 (64-bit)
(Altho i don't think it matters in this case)