Can't upload any image files .png or .jpeg

Nextcloud version
Operating system and version (eg, Ubuntu 20.04): Webserver shared
Apache or nginx version (eg, Apache 2.4.25):
PHP version 8.0

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Create a folder
  2. Upload any image file xxx.png or yyy.jpeg
  3. A message apears : Destination (Target) folder “/example” no longer exists.
  4. Can upload any other files like .txt .doc .pdf . xml etc

“system”: {
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“dbtype”: “mysql”,
“version”: “”,
“overwrite.cli.url”: “”,
“dbport”: “”,
“dbtableprefix”: “l0en_”,
“filesystem_check_changes”: 1,
“knowledgebaseenabled”: false,
“filelocking.enabled”: true,
“default_language”: “pt_BR”,
“force_language”: “pt_BR”,
“default_locale”: “pt_BR”,
“force_locale”: “pt_BR”,
“mysql.utf8mb4”: true,
“installed”: true,
“mail_from_address”: “REMOVED SENSITIVE VALUE”,
“mail_smtpmode”: “smtp”,
“mail_sendmailmode”: “smtp”,
“mail_smtptimeout”: “30”,
“mail_smtpauthtype”: “LOGIN”,
“mail_smtpauth”: 1,
“mail_smtphost”: “REMOVED SENSITIVE VALUE”,
“mail_smtpport”: “2525”,
“mail_smtpname”: “REMOVED SENSITIVE VALUE”,
“mail_smtppassword”: “REMOVED SENSITIVE VALUE”,
“maintenance”: false,
“theme”: “”,
“loglevel”: 2

Please post the content of your nextcloud.log (or an excerpt from the time period when you reproduce this error).

Unfortunately you’re running an unsupported version that no longer receives updates. It’s entirely possible you’re simply encountering an old big that has been fixed.

Is /example a local folder or on an external mount of some sort?

My nextcloud.log dont show nothing about the error.

My nextcloud is installed on a shared server.
The only error that appears is the one I mentioned in the post, a message in the upper right corner written: Destination (Target) folder “/example” no longer exists.
I have another nextcloud on the same shared server with the same version, and there I can upload .PNG or .JPEG files.
Server 1:
Server 2:
The 2 same base, same system.

\Exception",“type”:“::”},{“file”:“/home/u277095962/domains/”,“line”:1057,“function”:“execute”,“class”:“Doctrine\DBAL\Driver\PDO\Statement”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:236,“function”:“executeQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:345,“function”:“executeQuery”,“class”:“OC\DB\Connection”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:287,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuilder”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:105,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:119,“function”:“getUserToScan”,“class”:“OCA\Files\BackgroundJob\ScanFiles”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:51,“function”:“run”,“class”:“OCA\Files\BackgroundJob\ScanFiles”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:58,“function”:“execute”,“class”:“OC\BackgroundJob\Job”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:150,“function”:“execute”,“class”:“OC\BackgroundJob\TimedJob”,“type”:“->”}],“File”:“/home/u277095962/domains/”,“Line”:26,“Previous”:{“Exception”:“PDOException”,“Message”:“SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”,“Code”:“HY000”,“Trace”:[{“file”:“/home/u277095962/domains/”,“line”:92,“function”:“execute”,“class”:“PDOStatement”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:1057,“function”:“execute”,“class”:“Doctrine\DBAL\Driver\PDO\Statement”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:236,“function”:“executeQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:345,“function”:“executeQuery”,“class”:“OC\DB\Connection”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:287,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuilder”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:105,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:119,“function”:“getUserToScan”,“class”:“OCA\Files\BackgroundJob\ScanFiles”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:51,“function”:“run”,“class”:“OCA\Files\BackgroundJob\ScanFiles”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:58,“function”:“execute”,“class”:“OC\BackgroundJob\Job”,“type”:“->”},{“file”:“/home/u277095962/domains/”,“line”:150,“function”:“execute”,“class”:“OC\BackgroundJob\TimedJob”,“type”:“->”}],“File”:“/home/u277095962/domains/”,“Line”:92}},“CustomMessage”:“Error while running background job (class: OCA\Files\BackgroundJob\ScanFiles, arguments: )”}}

Since you are on a shared server, this could be related to your problem:

So you may have to increase the respective timeout values for wait_timeout and interactive_timeout in your database configuration.

1 Like

I’m gonna try this.
I will come back to tell you what happens.

Thank you.

Unfortunately it didn’t work out. These errors have nothing to do with my problem. What actually happens is that the photo files like .PNG or .JPEG are not uploaded, saying that the destination folder does not exist. I do not know what to do.

and that’s exactly what looks to me like a consequential error of the database timeout.

But I don’t have your machine here. You have to debug this thoroughly yourself, but without ruling out possibilities in advance if they don’t rhyme instantaneous with the error-message.

in my database there is nothing related to " wait_timeout " and " interactive_timeout " . Would I have to create these instances?

Open a terminal, enter

mysql -h localhost -u $DatabaseUser -p$DatabasePassword $DatabaseName

where DatabaseUser, DatabasePassword and DatabaseName must be the same as in config/config.php.
Atention: between -u and the username is a space but between the -p and the password must be NO space!

Now you are in the Mysql/MariaDB console. The prompt should look like this:

MariaDB [nextcloud]>

Now enter:

SHOW VARIABLES LIKE ‘wait_timeout’;
SHOW VARIABLES LIKE ‘interactive_timeout’;

One line at a time, it will answer with the vallue that is set on your server.

For a server with the default vallues that should look like this:

MariaDB [nextcloud]> SHOW VARIABLES LIKE 'wait_timeout';
| Variable_name | Value |
| wait_timeout  | 28800 |
1 row in set (0.002 sec)

MariaDB [nextcloud]> SHOW VARIABLES LIKE 'interactive_timeout';
| Variable_name       | Value |
| interactive_timeout | 28800 |
1 row in set (0.002 sec)

MariaDB [nextcloud]>

with \q you can leave the console:

MariaDB [nextcloud]> \q

Some shared servers use much shorter timeouts and that is what you should look first.


With this comand mysql localhost -u $DatabaseUser -p$DatabasePassword $DatabaseName


I redid nextcloud from the beginning, all new.
It worked for 1 month everything correctly. Now the same problem of not being able to upload image files such as .jpeg or .png has returned giving the same message: Destination folder “/” no longer exists

Maybe you can re-scan all files see documentation

sudo -u www-data php occ files:scan --all

Same problem, it doesn’t allow me to upload or open images, all the other types of files work correctly, but the images for some reason don’t, I get an error when opening an image “This file no longer exists”, I already tried with “occ files:scan” --all" without I exist.

Did you find a solution?
I´m still facing this issue, even after doing a fresh install.
Can anyone point me a direction?!