|
Joined: Jun 2006
Posts: 996 Likes: 24
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 996 Likes: 24 |
I have a problem with attachment images that are being lost in a folder. There should be around 15000 images in that folder but something is emptying the folder.I noticed below error log in our forums the path is /xxxx/xxxxx/xxxxx/forums/0/attachment I have restored the files in attachment folder from July 26 backup as the backup from 27th and 28th are empty. I was addressed on the 27th and restored the backup from the 26th, now today (28th) the attachment folder was empty again so I had to goback and restore the folder from 26th again. 27 and 28 are empty. So if there is an memory issue I wonder why it empty the attachment folder, also which memory is the trouble?Please advise Thanks Morgan There are more errors but I show one from ea day below [26-Jul-2023 23:27:23 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in /xxxxx/xxxxx/xxxxx/forums/libs/image.inc.php on line 44 [27-Jul-2023 21:46:00 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in /xxxxx/xxxxx/xxxxx/forums/libs/image.inc.php on line 44 [28-Jul-2023 00:14:53 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in /xxxxx/xxxxx/xxxxx/forums/libs/image.inc.php on line 44
Last edited by Morgan; 07/28/2023 7:16 AM.
|
|
|
|
Joined: Jun 2006
Posts: 16,348 Likes: 124
|
Joined: Jun 2006
Posts: 16,348 Likes: 124 |
Your PHP Fatal Error is regarding the PHP Max Memory setting
|
|
|
|
Joined: Jun 2006
Posts: 996 Likes: 24
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 996 Likes: 24 |
Thanks Giz,
PHP memory was raised from 128M to 2048M by the provider.
I do wonder what actually caused the system to drop or delete all 15000+ images in attachment folder. is that done automatically when php hits memory limit? If so it might be good to warn about this in the admin cp or installation guide.
I'm glad I had backups..
Cheers
Last edited by Morgan; 08/02/2023 4:47 AM.
|
|
|
|
Joined: Dec 2003
Posts: 6,621 Likes: 84
|
Joined: Dec 2003
Posts: 6,621 Likes: 84 |
Something to say about number of files per folder is. A lot of hosts will limit how many files per folder. Or at least used to. Meaning you have say 15000 files but when you ftp you only see say 9000.
With that said I have always asked that we have the option when setting attachments or any uploaded file locations to be able to add multiple folders and set limits to each folder. A couple of other vendors allow this.
SD had a good idea on pic upload that did just that. As well as it auto created folders based on the month/year uploaded. So you never exceeded that limit. But it was discovered for other reasons that the mod had some modern security risks. But the concept was still a good idea.
Blue Man Group There is no such thing as stupid questions. Just stupid answers
|
|
|
|
Joined: Apr 2004
Posts: 1,972 Likes: 154
|
Joined: Apr 2004
Posts: 1,972 Likes: 154 |
Something to say about number of files per folder is. A lot of hosts will limit how many files per folder. Or at least used to. Meaning you have say 15000 files but when you ftp you only see say 9000. The maximum number of files by file system:FAT32: Maximum number of files: 268,173,300 Maximum number of files per directory: 65,535 NTFS: Maximum number of files: 4,294,967,295 ext2: Maximum number of files: 1,000,000,000,000,000,000 Maximum number of files per directory: ~1.3 × 100,000,000,000,000,000,000 (performance issues past 10,000) ext3: Maximum number of files: min(volumeSize / 8,192, numberOfBlocks) ext4: Maximum number of files: 4,294,967,295 Maximum number of files per directory: 10 million approximately (can be extended with large_dir feature) source: https://stackoverflow.com/questions/466521/how-many-files-can-i-put-in-a-directoryThough, when you say you only see 9,000 files in the directory, what you may be referring to is How many How to Increase FTP Visible File LimitsBy default, the FTP server on the cPanel set a limit to the number of files displayed through an FTP client. It is usually 9,000, if you wish to view more than 9,000 files through your FTP server, then you can follow-up this quick tutorial. continued at: https://www.interserver.net/tips/kb/how-to-increase-ftp-visible-file-limits/
|
|
|
|
Joined: Jun 2006
Posts: 16,348 Likes: 124
|
Joined: Jun 2006
Posts: 16,348 Likes: 124 |
I do wonder what actually caused the system to drop or delete all 15000+ images in attachment folder. is that done automatically when php hits memory limit? If so it might be good to warn about this in the admin cp or installation guide I know of no PHP mechanism which would clear out your attachments folder, this is not a standard behavior
|
|
|
|
Joined: Jun 2006
Posts: 996 Likes: 24
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 996 Likes: 24 |
I know of no PHP mechanism which would clear out your attachments folder, this is not a standard behavior In the past I have experienced other files to that has been cleared out. Files in includes folder has been emptied but it was some years back. The attachment folder has been emptied 4 times, one last spring and then three days in a row a few days ago. I kept restoring it with the backup function. Then we increased php max limit size from 128M to 2048M and it has worked since. Honestly I have no clue what caused it but now you programmers now it can happen. Oh now while editing this post I remember when editing and submitting it takes me back but tha doesn’t happen anymore on my forum. But it’s another topic. Thanks
Last edited by Morgan; 08/03/2023 3:01 AM.
|
|
|
|
Joined: Jun 2006
Posts: 16,348 Likes: 124
|
Joined: Jun 2006
Posts: 16,348 Likes: 124 |
I understand that, but it's not in the documentation for these very basic functions of PHP, so there's no where to "seek advice" without an lot of users experiencing the same behavior and logs indicating that something is happening; just checking "php memory limit unlinking files" doesn't return anything usable (unlink is how PHP would delete physical files on the drive) but we're all ears if something comes up.
|
|
|
1 members (Ruben),
574
guests, and
101
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|