kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.12k stars 364 forks source link

Images do not appear in Kimchi interface #1109

Closed crosscutrat closed 7 years ago

crosscutrat commented 7 years ago

On two different fresh CentOS 7 64 bit installs, the logos are not visible (https://:8001):

image

However, an "Inspect Element" shows all 200 OK for the GET requests and you can right click on both images and get the URL which does get the image.

alinefm commented 7 years ago

Hi @crosscutrat

I've just tried that on a centOS VM I have in my system and all the logos are displayed as we can see below.

screenshot from 2017-03-02 13-10-29

I got the packages from http://kimchi-project.github.io/[wok/gingerbase/kimchi]/downloads/

Maybe it is an issue with your setup as I could not get the same behavior here.

user77 commented 7 years ago

Same issue as OP. Browser and system independent. Installed rpm as per official instructions. If I open the image location it's fine.

https://:8001/plugins/gingerbase/images/gingerbase.svg
https://:8001/plugins/kimchi/images/kimchi.svg

nginx logs are suggesting its serving them up just fine.

[13/Mar/2017:15:15:10 +0000] "GET /plugins/kimchi/images/kimchi.svg HTTP/1.1" 200 3476 "https://:8001/login.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36" "-"

If I open up the developer tools in chrome and change the image it displays fine. wok

I've disabled selinux, no dice.

NotoriousPyro commented 7 years ago

I used to be able to access Kimchi with no problems, any page would work fine and then all of a sudden I started getting errors on the pages saying a problem had occurred and the data couldn't be loaded. I noticed I couldn't access previously-accessible pages.

Then I noticed the log files... So here we are. Something in an update has been broken along the way.

alinefm commented 7 years ago

Please, try on a private browser session just to make sure any older JS is prevent the image to get uploaded.

NotoriousPyro commented 7 years ago

I've already cleared the cache and tried that. No change.

alinefm commented 7 years ago

Ok. I will create a clean Debian and CentOS VMs and install the most recent Wok and Kimchi packages and turn back to you soon.

alinefm commented 7 years ago

\o/ I probably found the problem! On my tests, I identified only the SVG images were not being loaded and that was because the system didn't have a mimetype specified for this type of file.

import mimetypes
mimetypes.types_map.get('.svg')

Could you confirm that too?

I will work on a patch to set a content type for SVG files.

user77 commented 7 years ago
/etc/nginx/mime.types
image/svg+xml                         svg svgz;

Or is this specified elsewhere? I didn't see it in /etc/nginx/conf.d/wok.conf

alinefm commented 7 years ago

You need to check that on mimetypes python module as it is what cherrypy uses (and consequently, Wok)

user77 commented 7 years ago

Confirmed Python 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mimetypes >>> mimetypes.types_map.get('.svg') >>>

alinefm commented 7 years ago

Fixed by https://github.com/kimchi-project/wok/commit/9454b1dc59f59dd33f0820af15b3d2a4413f815c https://github.com/kimchi-project/kimchi/commit/64a6502aa850702ae89bebfb9f71a15ddd5331e4 https://github.com/kimchi-project/gingerbase/commit/00f999717222f3aeb6e181b4b42301a189386c25 https://github.com/kimchi-project/ginger/commit/d235d4c33bcc61581b25e3e9d5ce7ae0be6c03e2

Bogumilul commented 7 years ago

Issue is still present with WOK 2.4 , Kimchi 2.4.0-0 and Gingerbase 2.3.0-0 This is the centos latest release.

alinefm commented 7 years ago

@Bogumilul The fixes are already upstream but they will be available on an official release only by the end of June (next release)

mike-scchen commented 6 years ago

Issue is still present with WOK 2.5.0, Kimchi 2.5.0, Ginger 2.4.0 and Ginger-base 2.3.0. Installed on CentOS 7.5.1804 with downloaded rpm files. Install with source-built rpm does not have this problem, though.