Actions
Issue #4069
closedAttributeError: 'Blueprint' object has no attribute 'json_encoder'
Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version - Crane:
Platform Release:
Target Release - Crane:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
Hi,
I'm using this documentation to configure crane and pulp-docker https://docs.pulpproject.org/en/2.6/pulp-docker.pdf
I have do this :
pulp-admin docker repo create --repo-id=busybox
pulp-admin docker repo uploads upload --repo-id=busybox -f /home/poil/busybox.tar
pulp-admin docker repo update --repo-id=busybox --repo-registry-id=repos.local/busybox
pulp-admin docker repo publish run --repo-id=busybox
Now when I go on https://repos.local:8443/crane/repositories/v2 I have my repo listed
But when I go with curl to have the json output I have a 500 Internal Server Error with this traceback :
==> error_log <==
[Mon Oct 08 14:12:49.480199 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] mod_wsgi (pid=16313): Exception occurred processing WSGI script '/usr/share/crane/crane.wsgi'.
[Mon Oct 08 14:12:49.480311 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] Traceback (most recent call last):
[Mon Oct 08 14:12:49.480365 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
[Mon Oct 08 14:12:49.481105 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] return self.wsgi_app(environ, start_response)
[Mon Oct 08 14:12:49.481134 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
[Mon Oct 08 14:12:49.481161 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] response = self.make_response(self.handle_exception(e))
[Mon Oct 08 14:12:49.481179 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
[Mon Oct 08 14:12:49.481197 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] reraise(exc_type, exc_value, tb)
[Mon Oct 08 14:12:49.481205 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
[Mon Oct 08 14:12:49.481218 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] response = self.full_dispatch_request()
[Mon Oct 08 14:12:49.481228 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
[Mon Oct 08 14:12:49.481240 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] rv = self.handle_user_exception(e)
[Mon Oct 08 14:12:49.481249 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
[Mon Oct 08 14:12:49.481261 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] reraise(exc_type, exc_value, tb)
[Mon Oct 08 14:12:49.481268 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
[Mon Oct 08 14:12:49.481281 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] rv = self.dispatch_request()
[Mon Oct 08 14:12:49.481289 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
[Mon Oct 08 14:12:49.481301 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] return self.view_functions[rule.endpoint](**req.view_args)
[Mon Oct 08 14:12:49.481314 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/crane/views/crane.py", line 41, in repositories_v2
[Mon Oct 08 14:12:49.481388 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] response = current_app.make_response(json.dumps(repos_json))
[Mon Oct 08 14:12:49.481410 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/json/__init__.py", line 177, in dumps
[Mon Oct 08 14:12:49.481544 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] _dump_arg_defaults(kwargs)
[Mon Oct 08 14:12:49.481559 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] File "/usr/lib/python2.7/site-packages/flask/json/__init__.py", line 98, in _dump_arg_defaults
[Mon Oct 08 14:12:49.481578 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] bp.json_encoder if bp and bp.json_encoder
[Mon Oct 08 14:12:49.481612 2018] [:error] [pid 16313] [remote 10.239.236.113:5872] AttributeError: 'Blueprint' object has no attribute 'json_encoder'
==> access_log <==
10.239.236.113 - - [08/Oct/2018:14:12:49 +0000] "GET /crane/repositories/v2 HTTP/1.1" 500 527 "-" "curl/7.58.0"
Also I have the same traceback when doing a pull
# docker pull repos.local:8443/busybox
Using default tag: latest
Error response from daemon: received unexpected HTTP status: 500 Internal Server Error
/etc/crane.conf :
[general]
data_dir: /var/lib/pulp/published/docker/v2/app
debug: true
endpoint: repos.local:8443
[serve_content]
enable: true
/etc/httpd/conf.d/pulp_crane.conf
<VirtualHost *:8443>
ServerName repos.local
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/repos.local.cer
SSLCertificateKeyFile /etc/pki/tls/private/repos.local.key
WSGIScriptAlias / /usr/share/crane/crane.wsgi
<Location /crane>
#Require host localhost
Require all granted
</Location>
<Directory /usr/share/crane/>
Require all granted
</Directory>
</VirtualHost>
Best regards,
Actions