Tried to upload PDF, now entire site is down: An image could not be created from the given input

Permalink
So I just built a site in 5.8. Everything was going fine. Then I tried to upload a PDF file. I have uploaded images with no problem. Now I get this message:

An image could not be created from the given input

But, it's not just the page where the I tried to upload the file. Now every page on the entire site delivers the same message. Obviously, the client is none too pleased. Is concrete5 v8 really not usable? I used to love concrete5, because it just worked. Now uploading a PDF file crashes the whole site? Maybe it's something in my server environment, but this is honestly just ridiculous. Color me extremely aggravated and ready to learn a new system. Anybody?

 
JohntheFish replied on at Permalink Reply
JohntheFish
There is a similar issue for .svg files, where the file manager tries to create a thumbnail and fails. If you look on the GitHub issues, you may get some ideas.
DBKG replied on at Permalink Reply
Thanks for the reply. So far, I haven't found anything useful there. I'll keep digging. The error log message is:

PHP Deprecated: Comments starting with a '#' are deprecated in /#####/php.ini on line 420 in Unknown on line 0
DBKG replied on at Permalink Reply
Am I the only one with this issue? I can't find a fix. Nor can I access any pages on the website. Unbelievable.
Gondwana replied on at Permalink Reply
Gondwana
I'm wondering if this could be because the environment doesn't include the preferred graphics package, so c5 is falling back to a default package. Is it image_magic or something??
Gondwana replied on at Permalink Reply
Gondwana
I'm also wondering whether it could be an out-of-memory issue. Was the PDF a large file? Extra memory can be consumed by the attempted creation of thumbnails (if that happens for PDFs).
DBKG replied on at Permalink Reply
The PDF was a whopping 360 KB. Not sure about your other question regarding the graphics package. Could be.
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi DBKG,

Using concrete5 version 8.1.0, I was able to successfully upload a PDF using the file manager.

Please include the specific steps for how and where you uploaded a PDF. This would include what block, add-on, and if you are using any custom code.

Have you tried logging into the dashboard directly?
Example:
your_site_address.com/index.php/dashboard/files/search
DBKG replied on at Permalink Reply
Thanks for the reply. I get a Page Not Found with the theme and menu at that address. But anywhere I navigate from there goes back to the error message.

This was a straightforward (I thought) upload through the File Manager in a regular Content block. I did not notice a separate upload function for a file (unlike in 5.7> if I recall correctly), so I clicked on the Insert Image icon (if I missed something there, I suppose that's on me...) From the File Manager, I did the usual "Browse the computer" and dragged the PDF file into the window. Clicked Close. And voilà!

I have done no custom coding. The theme is Stride. The web address ishttp://bam-academy.com

Thanks again. I can modify code, noodle around in phpMyAdmin, and have access to edit the php.ini, but I am not a developer. So I'm baffled where to go to fix the durn thing.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@DBKG

The picture icon in the rich text editor toolbar opens an Image Properties popup for inserting images. The issue was caused by a non-image being selected.

When you select a non-image, the preview displays a large red square with a white X inside. If the warning is ignored and the page is saved, this creates the error.

I will take a look to see how this error can be resolved and checks can be added to prevent it.
DBKG replied on at Permalink Reply
When I was uploading, even in the back of my mind I thought it didn't feel like the right way to do that. I did not see the red square with the X. In fact, the PDF filename showed up in the Content block as if it had been linked. Then all heck broke loose.
DBKG replied on at Permalink Reply
I should add that it's a new site with a clean 8.1 install. This was one of the final elements, and my next step was to do a backup. (Yay.) The web server is older, but it's running PHP 5.6.30
JohntheFish replied on at Permalink Reply
JohntheFish
Can you get directly into the dashboard and revert the page version for the page or global you were editing?
DBKG replied on at Permalink Reply
No. I did try that. Thanks.
incipio replied on at Permalink Best Answer Reply
I've seen this before and to the extent it helps you and helps someone figure out what is happening, I've always been able to fix it by using:
SELECT * FROM `FileImageThumbnailPaths` WHERE `isBuilt` = 0 and change them to 1
If you have a large number for results, then use: UPDATE `FileImageThumbnailPaths` SET `isBuilt` = 1 WHERE `isBuilt` = 0
MrKDilkington replied on at Permalink Reply
MrKDilkington
@incipio

Both approaches worked, thank you.

@DBKG

After you use incipio's instructions, you can edit the Content block, highlight the broken image link text, and delete it.
DBKG replied on at Permalink Reply
Maybe I missed it—where do I make these changes?

Thanks for your help.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@DBKG

This can be done through phpMyAdmin:
- select your concrete5 database
- click the SQL tab in the top menu bar in the right pane
- in the textarea, you can enter the SQL query (one or the other, not both)
SELECT * FROM FileImageThumbnailPaths WHERE isBuilt = 0;

UPDATE FileImageThumbnailPaths SET isBuilt = 1 WHERE isBuilt = 0;

I recommend making a full backup (files and database) before making any database changes.

Also, please mark incipio's reply as the correct answer.

I tested this issue using the latest version of concrete5 on GitHub and no error is thrown.
DBKG replied on at Permalink Reply
Thanks. It's been a long day, but I found them in the table. I probably stared at the text area without seeing it, but I was able to select each one and then change the 0 to a 1. Site is back up. (And backed up.)
DBKG replied on at Permalink Reply
Thank you to everyone! Y'all are lifesavers. I am much obliged.
micihch replied on at Permalink Reply
I came to this thread because I had "Could not load image from string" on the login page, i fact on every page (red banner and no content).

I then updated all svg files in FileImageThumbnailPaths: I set the field isBuilt to 1.

After that everything works fine. I'm on v8.1.0
This happened suddenly without any changes I consciously did, very strange. Never had this on v5.7. The error msg seems to come from the imagine library. I tried to debug this further but had no luck. File permissions were OK and imagemagick seems to work fine.

Anyway: thanks for the hints here!
MrKDilkington replied on at Permalink Reply
MrKDilkington
@micihch

The issue with SVG files in 8.1.0 has been fixed in the upcoming version.
micihch replied on at Permalink Reply
Great!