Bug: cpanel html editor not linking directory images big red "X".

Operating System & Version
CentOS 7.7
cPanel & WHM Version
v84.0.21

jeffschips

Well-Known Member
Jun 5, 2016
137
12
18
new york
cPanel Access Level
Root Administrator
CENTOS 7.7 kvm v84.0.21

Anybody have a solution to cpanel html editor not displaying .jpg, .png, .gif images in the editor and showing a big red "X" when importing images into an .html page? I brought this up with tech support and they confirmed on their end that this is an issue as well but I find it odd such an important feature remains unresolved. And this has only happened recently. I've been using the cpanel html editor for years with no problem. Here is how it happens:

Login into cpanel, navigate to a directory with an html web pages. Create an html page and attempt to import an image using the cpanel html editor for images. Remember, the actual images are located in the same directory as the html page - yet nothing shows, just a big red "X" indicating the image is not being imported.

I've checked that all permissions are proper 755 for directory and 644 for image files. Even changing the directory to 750 doesn't change the issue. I've checked source of html page and paths are correct.

This is truly odd.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Can you give me more precise steps to replicate this or a case ID if it's a known issue?
I went to cPanel>>File Manager->public_html for my domain -> Selected an HTML File -> HTML Editor -> Clicked the "Image" button -> Upload Image -> Selected my Image and uploaded it and I'm not seeing any issue with the image I uploaded.
 

jeffschips

Well-Known Member
Jun 5, 2016
137
12
18
new york
cPanel Access Level
Root Administrator
Hi and thanks for the quick response! Appreciate that. The case ID is CPANEL-31403. I did the exact same steps you have and I only get the red X. Of note, when working in this directory I can, for some reason, succesfully import images from a subdomain of the domain I'm working with but not from within the main domain. Very strange.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Hi @jeffschips

There's actually a comment in the case about the hostname that is interesting. Uunfortunately your ticket is the only one that is added to this case right now - though it was just opened yesterday.

One of the PO's noted that they were only able to reproduce this in the event the hostname of the server didn't resolve (most of our test environments don't actually have working hostnames/domains) - he noted that when they put the hostname in their local /etc/hosts/ file (local hosts file) the issue was resolved. This would explain why the analyst was able to replicate the behavior as well.

They did note that either way it's an issue and should be resolved but it could be a direction to explore?

I see your hostname resolves but I wonder if there isn't some further resolution related issue involved occurring on the server itself.
 
Last edited:

jeffschips

Well-Known Member
Jun 5, 2016
137
12
18
new york
cPanel Access Level
Root Administrator
Wow that's interesting. So you are suggesting I put the domain name in my server's /etc/hosts file? And why in the first place wouldn't this TLD resolve anyway, I'm wondering.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
I'm sorry, no I'm not suggesting that, I was just explaining the full situation. I was saying that internally (here) most of our hostnames don't resolve (at least on our test environments), in order to work around this we have to add our hostnames/domains to our local hosts file.

The server the analyst was using and the server that the development team used to replicate your issue both had non-resolving hostnames.

The product owner for the team employed the workaround of adding the hostname of his test environment to his own local hosts file and found that the image preview began to work.

I checked your DNS for the hostname externally it looks great. What I was suggesting was that in light of that information, ensuring that locally DNS resolution is functioning normally.
 

jeffschips

Well-Known Member
Jun 5, 2016
137
12
18
new york
cPanel Access Level
Root Administrator
Ah okay I see. Thanks for clearing that up. I'll check into that. Strange that, though, it works locally when the links to images references a directory *outside* the one with the images. . .
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Ah okay I see. Thanks for clearing that up. I'll check into that. Strange that, though, it works locally when the links to images references a directory *outside* the one with the images. . .
I agree fully! It doesn't make a lot of sense and actually I was curious about something - if you use the developers tools in chrome or firefox (or whichever browser) where does the URL point for the image? What URL are you using to access your cPanel UI?
 

jeffschips

Well-Known Member
Jun 5, 2016
137
12
18
new york
cPanel Access Level
Root Administrator
Dude! You're the dude! Using web developer has revealed the issue but frankly, I don't know how to resolve it. So, when loading an image web developer shows a 404 error with the following link, which obviously is wrong (the domain names have been changed but you will get the idea):


When it works it should show the link as follows:


Don't know why cpanel is pre-pending a mash-up with the following domains/link:

domain1.com.cpanel-account-domain-name.com

Maybe you have a clue but this is definitely the reason why this is occurring - wrong domain request.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston