Previous Thread
Next Thread
Print Thread
Hop To
#265668 07/28/2023 3:09 AM
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
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
Quote
[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.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Your PHP Fatal Error is regarding the PHP Max Memory setting


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
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.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
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,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
Originally Posted by Ruben
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-directory


Though, 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 Limits
By 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/


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Originally Posted by Morgan
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


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Originally Posted by Gizmo
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.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
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.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Mors), 833 guests, and 197 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)